10 using namespace magfieldparam;
14 double p1[]={4.90541,17.8768,2.02355,0.0210538,0.000321885,2.37511,0.00326725,2.07656,1.71879};
15 double p2[]={4.41982,15.7732,3.02621,0.0197814,0.000515759,2.43385,0.00584258,2.11333,1.76079};
16 double p3[]={4.30161,15.2586,3.51926,0.0183494,0.000606773,2.45110,0.00709986,2.12161,1.77038};
17 double p4[]={4.24326,15.0201,3.81492,0.0178712,0.000656527,2.45818,0.00778695,2.12500,1.77436};
18 double p5[]={4.21136,14.8824,4.01683,0.0175932,0.000695541,2.45311,0.00813447,2.11688,1.76076};
20 if (fld==
"2_0T")
for (
int i=0;
i<9;
i++)
prm[
i]=p1[
i];
21 if (fld==
"3_0T")
for (
int i=0;
i<9;
i++)
prm[
i]=p2[
i];
22 if (fld==
"3_5T")
for (
int i=0;
i<9;
i++)
prm[
i]=p3[
i];
23 if (fld==
"3_8T")
for (
int i=0;
i<9;
i++)
prm[
i]=p4[
i];
24 if (fld==
"4_0T")
for (
int i=0;
i<9;
i++)
prm[
i]=p5[
i];
28 <<
"Defined keys are: \"2_0T\" \"3_0T\" \"3_5T\" \"3_8T\" and \"4_0T\"\n";
44 inline
void ffunkti(T u, T * __restrict__
ff) {
54 ff[3]=a2*ff[1]*(T(1)-4*u2);
58 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ > 4)
69 double rat=0.5*r*
ainv;
71 Bw[0]=
hb0*rat*(fuv[1][0]-fuv[1][1]-(fuv[3][0]-fuv[3][1])*rat2*0.5);
73 Bw[2]=
hb0*(fuv[0][0]+fuv[0][1]-(fuv[2][0]+fuv[2][1])*rat2);
95 double rat=0.5*r*
ainv;
97 Bw[0]=
hb0*rat*(fu[1]-gv[1]-(fu[3]-gv[3])*rat2*0.5);
99 Bw[2]=
hb0*(fu[0]+gv[0]-(fu[2]+gv[2])*rat2);
100 double corBr=
prm[4]*r*z*(az-
prm[5])*(az-
prm[5]);
117 Bcyl(
sqrt(x[0]*x[0]+x[1]*x[1]),x[2], Brfz);
122 double r=
sqrt(x[0]*x[0]+x[1]*x[1]);
124 double rinv=(r>0) ? 1/r:0;
125 Bxyz[0]=Bw[0]*x[0]*rinv;
126 Bxyz[1]=Bw[0]*x[1]*rinv;
class Geom::OnePiRange __attribute__
void getBrfz(double const *__restrict__ x, double *__restrict__ Brfz) const
B out in cylindrical.
Exp< T >::type exp(const T &t)
TkBfield(std::string T="3_8T")
void getBxyz(double const *__restrict__ x, double *__restrict__ Bxyz) const
B out in cartesian.
void Bcyl(double r, double z, double *__restrict__ Bw) const