Go to the documentation of this file.00001 #ifndef HarmBasis3DCyl_h
00002 #define HarmBasis3DCyl_h
00003
00004 #include "rz_harm_poly.h"
00005
00006 namespace magfieldparam {
00007
00008 typedef std::vector<rz_harm_poly> harm_poly_vec;
00009 typedef std::vector<harm_poly_vec> harm_poly_arr;
00010
00012
00013
00014
00016
00017 class HarmBasis3DCyl {
00018
00019 private:
00020 unsigned Dim;
00021 unsigned Len;
00022
00023 int *L_k, *M_k;
00024 double *P_k, *Br_k, *Bz_k, *Bphi_k;
00025
00026 harm_poly_arr PtB;
00027 harm_poly_arr BrB;
00028 harm_poly_arr BzB;
00029 harm_poly_arr BphiB;
00030
00031 void EvalRZ(harm_poly_arr &B, double *val);
00032 double GetVal(double *coeff, double *basis);
00033
00034 void Print(harm_poly_arr &B,std::ostream &out = std::cout);
00035
00036 public:
00037 HarmBasis3DCyl(const unsigned N = 18);
00038 virtual ~HarmBasis3DCyl();
00039
00040 unsigned GetDim() { return Dim;}
00041 unsigned GetLen() { return Len;}
00042 void GetLM(const unsigned j, int &Lj, int &Mj) { Lj = L_k[j]; Mj = M_k[j];}
00043
00044
00045 void SetPoint(const double r, const double z, const double phi)
00046 { rz_harm_poly::SetPoint(r, z, phi);}
00047
00048
00049
00050 void EvalPtn() { EvalRZ(PtB, P_k);}
00051 void EvalBr() { EvalRZ(BrB, Br_k);}
00052 void EvalBz() { EvalRZ(BzB, Bz_k);}
00053 void EvalBphi();
00054
00055
00056
00057 double GetPtn_k (const unsigned k) { return P_k[k];}
00058 double GetBr_k (const unsigned k) { return Br_k[k];}
00059 double GetBz_k (const unsigned k) { return Bz_k[k];}
00060 double GetBphi_k(const unsigned k) { return Bphi_k[k];}
00061
00062
00063
00064
00065 double GetPtn (double *coeff) { return GetVal(coeff, P_k);}
00066 double GetBr (double *coeff) { return GetVal(coeff, Br_k);}
00067 double GetBz (double *coeff) { return GetVal(coeff, Bz_k);}
00068 double GetBphi(double *coeff) { return GetVal(coeff, Bphi_k);}
00069
00070 void PrintPtB (std::ostream &out = std::cout) { Print(PtB, out);}
00071 void PrintBrB (std::ostream &out = std::cout) { Print(BrB, out);}
00072 void PrintBzB (std::ostream &out = std::cout) { Print(BzB, out);}
00073 void PrintBphiB(std::ostream &out = std::cout) { Print(BphiB, out);}
00074 void Print (std::ostream &out = std::cout);
00075
00076 };
00077 }
00078
00079 #endif