7#include <boost/math/special_functions.hpp>
48 cs_ = sqrt( c_[11]*c_[11]-c_[10]*c_[10]);
52 double Rn = R/R0_, Zn = Z/R0_;
53 double j1_c12 = boost::math::cyl_bessel_j( 1, c_[11]*Rn);
54 double y1_c12 = boost::math::cyl_neumann( 1, c_[11]*Rn);
55 double j1_cs = boost::math::cyl_bessel_j( 1, cs_*Rn);
56 double y1_cs = boost::math::cyl_neumann( 1, cs_*Rn);
60 + c_[1]*Rn*j1_cs*cos(c_[10]*Zn)
61 + c_[2]*Rn*y1_cs*cos(c_[10]*Zn)
62 + c_[3]*cos(c_[11]*sqrt(Rn*Rn+Zn*Zn))
63 + c_[4]*cos(c_[11]*Zn)
66 + c_[7]*Rn*j1_cs*sin(c_[10]*Zn)
67 + c_[8]*Rn*y1_cs*sin(c_[10]*Zn)
68 + c_[9]*sin(c_[11]*Zn));
73 std::vector<double> c_;
84 cs_=sqrt(c_[11]*c_[11]-c_[10]*c_[10]);
89 double Rn=R/R0_, Zn=Z/R0_;
90 double j1_c12R = boost::math::cyl_bessel_j(1, c_[11]*Rn) + c_[11]/2.*Rn*(
91 boost::math::cyl_bessel_j(0, c_[11]*Rn) - boost::math::cyl_bessel_j(2,c_[11]*Rn));
92 double y1_c12R = boost::math::cyl_neumann(1, c_[11]*Rn) + c_[11]/2.*Rn*(
93 boost::math::cyl_neumann(0, c_[11]*Rn) - boost::math::cyl_neumann(2,c_[11]*Rn));
94 double j1_csR = boost::math::cyl_bessel_j(1, cs_*Rn) + cs_/2.*Rn*(
95 boost::math::cyl_bessel_j(0, cs_*Rn) - boost::math::cyl_bessel_j(2, cs_*Rn));
96 double y1_csR = boost::math::cyl_neumann(1, cs_*Rn) + cs_/2.*Rn*(
97 boost::math::cyl_neumann(0, cs_*Rn) - boost::math::cyl_neumann(2, cs_*Rn));
98 double RZbar = sqrt( Rn*Rn+Zn*Zn);
99 double cosR = -c_[11]*Rn/RZbar*sin(c_[11]*RZbar);
103 + c_[1]*j1_csR*cos(c_[10]*Zn)
104 + c_[2]*y1_csR*cos(c_[10]*Zn)
108 + c_[7]*j1_csR*sin(c_[10]*Zn)
109 + c_[8]*y1_csR*sin(c_[10]*Zn) );
113 std::vector<double> c_;
122 cs_ = sqrt( c_[11]*c_[11]-c_[10]*c_[10]);
126 double Rn=R/R0_, Zn=Z/R0_;
127 double j1_c12R = c_[11]*(boost::math::cyl_bessel_j(0, c_[11]*Rn) - Rn*c_[11]*boost::math::cyl_bessel_j(1, c_[11]*Rn));
128 double y1_c12R = c_[11]*(boost::math::cyl_neumann( 0, c_[11]*Rn) - Rn*c_[11]*boost::math::cyl_neumann(1, c_[11]*Rn));
129 double j1_csR = cs_*(boost::math::cyl_bessel_j(0, cs_*Rn) - Rn*cs_*boost::math::cyl_bessel_j(1, cs_*Rn));
130 double y1_csR = cs_*(boost::math::cyl_neumann( 0, cs_*Rn) - Rn*cs_*boost::math::cyl_neumann( 1, cs_*Rn));
131 double RZbar = sqrt(Rn*Rn+Zn*Zn);
132 double cosR = -c_[11]/(RZbar*RZbar)*(c_[11]*Rn*Rn*cos(c_[11]*RZbar) +Zn*Zn*sin(c_[11]*RZbar)/RZbar);
136 + c_[1]*j1_csR*cos(c_[10]*Zn)
137 + c_[2]*y1_csR*cos(c_[10]*Zn)
141 + c_[7]*j1_csR*sin(c_[10]*Zn)
142 + c_[8]*y1_csR*sin(c_[10]*Zn) );
146 std::vector<double> c_;
155 cs_ = sqrt( c_[11]*c_[11]-c_[10]*c_[10]);
159 double Rn = R/R0_, Zn = Z/R0_;
160 double j1_c12 = boost::math::cyl_bessel_j( 1, c_[11]*Rn);
161 double y1_c12 = boost::math::cyl_neumann( 1, c_[11]*Rn);
162 double j1_cs = boost::math::cyl_bessel_j( 1, cs_*Rn);
163 double y1_cs = boost::math::cyl_neumann( 1, cs_*Rn);
165 - c_[1]*Rn*j1_cs*c_[10]*sin(c_[10]*Zn)
166 - c_[2]*Rn*y1_cs*c_[10]*sin(c_[10]*Zn)
167 - c_[3]*c_[11]*Zn/sqrt(Rn*Rn+Zn*Zn)*sin(c_[11]*sqrt(Rn*Rn+Zn*Zn))
168 - c_[4]*c_[11]*sin(c_[11]*Zn)
171 + c_[7]*Rn*j1_cs*c_[10]*cos(c_[10]*Zn)
172 + c_[8]*Rn*y1_cs*c_[10]*cos(c_[10]*Zn)
173 + c_[9]*c_[11]*cos(c_[11]*Zn));
177 std::vector<double> c_;
186 cs_ = sqrt( c_[11]*c_[11]-c_[10]*c_[10]);
190 double Rn = R/R0_, Zn = Z/R0_;
191 double j1_cs = boost::math::cyl_bessel_j( 1, cs_*Rn);
192 double y1_cs = boost::math::cyl_neumann( 1, cs_*Rn);
193 double RZbar = sqrt(Rn*Rn+Zn*Zn);
194 double cosZ = -c_[11]/(RZbar*RZbar)*(c_[11]*Zn*Zn*cos(c_[11]*RZbar) +Rn*Rn*sin(c_[11]*RZbar)/RZbar);
196 - c_[1]*Rn*j1_cs*c_[10]*c_[10]*cos(c_[10]*Zn)
197 - c_[2]*Rn*y1_cs*c_[10]*c_[10]*cos(c_[10]*Zn)
199 - c_[4]*c_[11]*c_[11]*cos(c_[11]*Zn)
200 - c_[7]*Rn*j1_cs*c_[10]*c_[10]*sin(c_[10]*Zn)
201 - c_[8]*Rn*y1_cs*c_[10]*c_[10]*sin(c_[10]*Zn)
202 - c_[9]*c_[11]*c_[11]*sin(c_[11]*Zn));
206 std::vector<double> c_;
215 cs_ = sqrt( c_[11]*c_[11]-c_[10]*c_[10]);
219 double Rn=R/R0_, Zn=Z/R0_;
220 double j1_c12R = boost::math::cyl_bessel_j(1, c_[11]*Rn) + c_[11]/2.*Rn*(
221 boost::math::cyl_bessel_j(0, c_[11]*Rn) - boost::math::cyl_bessel_j(2,c_[11]*Rn));
222 double y1_c12R = boost::math::cyl_neumann( 1, c_[11]*Rn) + c_[11]/2.*Rn*(
223 boost::math::cyl_neumann( 0, c_[11]*Rn) - boost::math::cyl_neumann( 2,c_[11]*Rn));
224 double j1_csR = boost::math::cyl_bessel_j(1, cs_*Rn) + cs_/2.*Rn*(
225 boost::math::cyl_bessel_j(0, cs_*Rn) - boost::math::cyl_bessel_j(2, cs_*Rn));
226 double y1_csR = boost::math::cyl_neumann( 1, cs_*Rn) + cs_/2.*Rn*(
227 boost::math::cyl_neumann( 0, cs_*Rn) - boost::math::cyl_neumann(2, cs_*Rn));
228 double RZbar = sqrt(Rn*Rn+Zn*Zn);
229 double cosRZ = -c_[11]*Rn*Zn/(RZbar*RZbar*RZbar)*( c_[11]*RZbar*cos(c_[11]*RZbar) -sin(c_[11]*RZbar) );
231 - c_[1]*j1_csR*c_[10]*sin(c_[10]*Zn)
232 - c_[2]*y1_csR*c_[10]*sin(c_[10]*Zn)
236 + c_[7]*j1_csR*c_[10]*cos(c_[10]*Zn)
237 + c_[8]*y1_csR*c_[10]*cos(c_[10]*Zn) );
241 std::vector<double> c_;
255 return c12_*psip_(R,Z);
271 return c12_*psipR_(R,Z);
286 return c12_*psipZ_(R,Z);
@ solovev
dg::geo::solovev::Psip
@ taylor
dg::geo::taylor::Psip
static dg::geo::TokamakMagneticField createTaylorField(dg::geo::solovev::Parameters gp)
Create a Taylor Magnetic field.
Definition: taylor.h:314
static CylindricalFunctorsLvl1 createIpol(solovev::Parameters gp)
Definition: taylor.h:297
dg::geo::solovev::Parameters Parameters
bring Parameters into the taylor namespace
Definition: taylor.h:33
static CylindricalFunctorsLvl2 createPsip(solovev::Parameters gp)
Definition: taylor.h:293
This struct bundles a function and its first derivatives.
Definition: fluxfunctions.h:182
This struct bundles a function and its first and second derivatives.
Definition: fluxfunctions.h:219
Meta-data about the magnetic field in particular the flux function.
Definition: magnetic_field.h:91
A tokamak field as given by R0, Psi and Ipol plus Meta-data like shape and equilibrium.
Definition: magnetic_field.h:162
Represent functions written in cylindrical coordinates that are independent of the angle phi serving ...
Definition: fluxfunctions.h:66
Constructs and display geometric parameters for the solovev and taylor fields.
Definition: solovev_parameters.h:46
double R_0
major tokamak radius
Definition: solovev_parameters.h:48
double a
little tokamak radius
Definition: solovev_parameters.h:51
std::string description
Definition: solovev_parameters.h:55
double elongation
elongation of the magnetic surfaces
Definition: solovev_parameters.h:52
double triangularity
triangularity of the magnetic surfaces
Definition: solovev_parameters.h:53
Ipol(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:252
double do_compute(double R, double Z) const
Definition: taylor.h:253
double do_compute(double R, double Z) const
Definition: taylor.h:269
IpolR(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:268
double do_compute(double R, double Z) const
Definition: taylor.h:284
IpolZ(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:283
Psip(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:47
double do_compute(double R, double Z) const
Definition: taylor.h:50
double do_compute(double R, double Z) const
Definition: taylor.h:87
PsipR(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:83
PsipRR(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:121
double do_compute(double R, double Z) const
Definition: taylor.h:124
double do_compute(double R, double Z) const
Definition: taylor.h:217
PsipRZ(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:214
PsipZ(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:154
double do_compute(double R, double Z) const
Definition: taylor.h:157
double do_compute(double R, double Z) const
Definition: taylor.h:188
PsipZZ(solovev::Parameters gp)
Construct from given geometric parameters.
Definition: taylor.h:185