9 using namespace magfieldparam;
34 unsigned M, vLen,
k = 0;
35 for (
unsigned L = 1;
L <=
N; ++
L) {
43 Br_vec.push_back (Pt_vec[0].GetDiff(0));
44 Bz_vec.push_back (Pt_vec[0].GetDiff(1));
46 Bphi_vec[0].CheatL(
L);
50 for (M = 1; M <=
L; ++M) {
51 Pt_vec.push_back (Pt_vec[M-1].LadderUp());
52 Br_vec.push_back (Pt_vec[M].GetDiff(0));
53 Bz_vec.push_back (Pt_vec[M].GetDiff(1));
54 Bphi_vec.push_back(Pt_vec[M].GetDecPow(0));
59 PtB.push_back (Pt_vec);
60 BrB.push_back (Br_vec);
61 BzB.push_back (Bz_vec);
62 BphiB.push_back(Bphi_vec);
86 for (
unsigned L = 1,
k = 0;
L <=
Dim; ++
L, ++
k) {
87 (*val) = B[
k][0].Eval(); ++val;
88 for (M = 1; M <=
L; ++M) {
91 (*val) = V*P->
GetCos(); ++val;
92 (*val) = V*P->
GetSin(); ++val;
106 for (
unsigned L = 1,
k = 0;
L <=
Dim; ++
L, ++
k) {
108 for (M = 1; M <=
L; ++M) {
111 (*val) = -V*P->
GetSin(); ++val;
112 (*val) = V*P->
GetCos(); ++val;
124 for (
unsigned k = 0;
k <
Len; ++
k) S += coeff[
k]*basis[
k];
131 unsigned jL, jM, wdt = 60;
132 char fc1 =
'-', fc0 = out.fill(fc1);
133 for (jL = 0; jL < B.size(); ++jL) {
134 out << std::setw(wdt) << fc1 << std::endl;
135 out <<
"Basis subset " << jL+1 << std::endl;
136 out << std::setw(wdt) << fc1 << std::endl;
137 for (jM = 0; jM < B[jL].size(); ++jM) {
138 B[jL][jM].Print(out);
147 out <<
"BASIS POLYNOMIALS FOR THE POTENTIAL:\n" << std::endl;
149 out <<
"\nBASIS POLYNOMIALS FOR R-COMPONENT OF THE FIELD:\n" << std::endl;
151 out <<
"\nBASIS POLYNOMIALS FOR Z-COMPONENT OF THE FIELD:\n" << std::endl;
153 out <<
"\nBASIS POLYNOMIALS FOR PHI-COMPONENT OF THE FIELD:\n" << std::endl;
virtual ~HarmBasis3DCyl()
void PrintBrB(std::ostream &out=std::cout)
void PrintBphiB(std::ostream &out=std::cout)
HarmBasis3DCyl(const unsigned N=18)
static void IncNPwr(const unsigned N)
std::vector< harm_poly_vec > harm_poly_arr
std::vector< rz_harm_poly > harm_poly_vec
void Print(harm_poly_arr &B, std::ostream &out=std::cout)
void EvalRZ(harm_poly_arr &B, double *val)
void PrintBzB(std::ostream &out=std::cout)
void PrintPtB(std::ostream &out=std::cout)
double GetVal(double *coeff, double *basis)