44 Psip(
Parameters gp ): m_R0(gp.R_0), m_pp(gp.pp), m_horner(gp.c, gp.M, gp.N) {}
47 return m_R0*m_pp*m_horner( R/m_R0,Z/m_R0);
58 std::vector<double> beta ( (gp.
M-1)*gp.
N);
59 for(
unsigned i=0; i<gp.
M-1; i++)
60 for(
unsigned j=0; j<gp.
N; j++)
61 beta[i*gp.
N+j] = (
double)(i+1)*gp.
c[ ( i+1)*gp.
N +j];
66 return m_pp*m_horner( R/m_R0,Z/m_R0);
76 std::vector<double> beta ( (gp.
M-2)*gp.
N);
77 for(
unsigned i=0; i<gp.
M-2; i++)
78 for(
unsigned j=0; j<gp.
N; j++)
79 beta[i*gp.
N+j] = (
double)((i+2)*(i+1))*gp.
c[ (i+2)*gp.
N +j];
84 return m_pp/m_R0*m_horner( R/m_R0,Z/m_R0);
94 std::vector<double> beta ( gp.
M*(gp.
N-1));
95 for(
unsigned i=0; i<gp.
M; i++)
96 for(
unsigned j=0; j<gp.
N-1; j++)
97 beta[i*(gp.
N-1)+j] = (double)(j+1)*gp.
c[ i*gp.
N +j+1];
102 return m_pp*m_horner( R/m_R0,Z/m_R0);
112 std::vector<double> beta ( gp.
M*(gp.
N-2));
113 for(
unsigned i=0; i<gp.
M; i++)
114 for(
unsigned j=0; j<gp.
N-2; j++)
115 beta[i*(gp.
N-2)+j] = (double)((j+2)*(j+1))*gp.
c[ i*gp.
N +j+2];
120 return m_pp/m_R0*m_horner(R/m_R0,Z/m_R0);
130 std::vector<double> beta ( (gp.
M-1)*(gp.
N-1));
131 for(
unsigned i=0; i<gp.
M-1; i++)
132 for(
unsigned j=0; j<gp.
N-1; j++)
133 beta[i*(gp.
N-1)+j] = (double)((j+1)*(i+1))*gp.
c[ (i+1)*gp.
N +j+1];
138 return m_pp/m_R0*m_horner(R/m_R0,Z/m_R0);
@ polynomial
dg::geo::polynomial::Psip
static dg::geo::CylindricalFunctorsLvl2 createPsip(Parameters gp)
Definition: polynomial.h:145
static dg::geo::CylindricalFunctorsLvl1 createIpol(Parameters gp)
Definition: polynomial.h:150
static dg::geo::TokamakMagneticField createPolynomialField(dg::geo::polynomial::Parameters gp)
Create a Polynomial Magnetic field.
Definition: polynomial.h:167
Definition: fluxfunctions.h:114
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 polynomial fields.
Definition: polynomial_parameters.h:46
std::string description
Definition: polynomial_parameters.h:56
double triangularity
triangularity of the magnetic surfaces
Definition: polynomial_parameters.h:52
std::vector< double > c
M*N coefficients for the polynomial equilibrium, c[i*N+j] corresponds to R^i Z^j;.
Definition: polynomial_parameters.h:55
double R_0
major tokamak radius
Definition: polynomial_parameters.h:47
double a
little tokamak radius
Definition: polynomial_parameters.h:50
unsigned N
number of coefficients in Z
Definition: polynomial_parameters.h:54
double elongation
elongation of the magnetic surfaces
Definition: polynomial_parameters.h:51
unsigned M
number of coefficients in R
Definition: polynomial_parameters.h:53
double pi
prefactor for current I
Definition: polynomial_parameters.h:49
Definition: polynomial.h:38
Psip(Parameters gp)
Construct from given geometric parameters.
Definition: polynomial.h:44
double do_compute(double R, double Z) const
Definition: polynomial.h:45
Definition: polynomial.h:55
PsipR(Parameters gp)
Construct from given geometric parameters.
Definition: polynomial.h:57
double do_compute(double R, double Z) const
Definition: polynomial.h:64
Definition: polynomial.h:73
PsipRR(Parameters gp)
Construct from given geometric parameters.
Definition: polynomial.h:75
double do_compute(double R, double Z) const
Definition: polynomial.h:82
Definition: polynomial.h:127
PsipRZ(Parameters gp)
Construct from given geometric parameters.
Definition: polynomial.h:129
double do_compute(double R, double Z) const
Definition: polynomial.h:136
Definition: polynomial.h:91
PsipZ(Parameters gp)
Construct from given geometric parameters.
Definition: polynomial.h:93
double do_compute(double R, double Z) const
Definition: polynomial.h:100
Definition: polynomial.h:109
double do_compute(double R, double Z) const
Definition: polynomial.h:118
PsipZZ(Parameters gp)
Construct from given geometric parameters.
Definition: polynomial.h:111