40 Psip( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip,
double psi0,
double alpha,
double sign = -1) :
41 m_ipoly( psi0, alpha, sign), m_psip(psip), m_pred(predicate)
45 double psip = m_psip(R,Z);
47 return m_ipoly( psip);
53 std::function<double(
double,
double)> m_psip;
54 std::function<bool(
double,
double)> m_pred;
58 PsipR( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip, std::function<
double(
double,
double)> psipR,
double psi0,
double alpha,
double sign = -1) :
59 m_poly( psi0, alpha, sign), m_psip(psip), m_psipR(psipR), m_pred(predicate)
63 double psip = m_psip(R,Z);
64 double psipR = m_psipR(R,Z);
66 return psipR*m_poly( psip);
72 std::function<double(
double,
double)> m_psip, m_psipR;
73 std::function<bool(
double,
double)> m_pred;
77 PsipZ( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip, std::function<
double(
double,
double)> psipZ,
double psi0,
double alpha,
double sign = -1) :
78 m_poly( psi0, alpha, sign), m_psip(psip), m_psipZ(psipZ), m_pred(predicate)
82 double psip = m_psip(R,Z);
83 double psipZ = m_psipZ(R,Z);
85 return psipZ*m_poly( psip);
91 std::function<double(
double,
double)> m_psip, m_psipZ;
92 std::function<bool(
double,
double)> m_pred;
97 PsipZZ( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip, std::function<
double(
double,
double)> psipZ, std::function<
double(
double,
double)> psipZZ,
double psi0,
double alpha,
double sign = -1) :
98 m_poly( psi0, alpha, sign), m_dpoly( psi0, alpha, sign), m_psip(psip), m_psipZ(psipZ), m_psipZZ(psipZZ), m_pred(predicate)
102 double psip = m_psip(R,Z);
103 double psipZ = m_psipZ(R,Z);
104 double psipZZ = m_psipZZ(R,Z);
106 return psipZZ*m_poly( psip) + psipZ*psipZ*m_dpoly(psip);
113 std::function<double(
double,
double)> m_psip, m_psipZ, m_psipZZ;
114 std::function<bool(
double,
double)> m_pred;
119 PsipRR( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip, std::function<
double(
double,
double)> psipR, std::function<
double(
double,
double)> psipRR,
double psi0,
double alpha,
double sign = -1) :
120 m_poly( psi0, alpha, sign), m_dpoly( psi0, alpha, sign), m_psip(psip), m_psipR(psipR), m_psipRR(psipRR), m_pred(predicate)
124 double psip = m_psip(R,Z);
125 double psipR = m_psipR(R,Z);
126 double psipRR = m_psipRR(R,Z);
128 return psipRR*m_poly( psip) + psipR*psipR*m_dpoly(psip);
135 std::function<double(
double,
double)> m_psip, m_psipR, m_psipRR;
136 std::function<bool(
double,
double)> m_pred;
140 PsipRZ( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip, std::function<
double(
double,
double)> psipR, std::function<
double(
double,
double)> psipZ, std::function<
double(
double,
double)> psipRZ,
double psi0,
double alpha,
double sign = -1) :
141 m_poly( psi0, alpha, sign), m_dpoly( psi0, alpha, sign), m_psip(psip), m_psipR(psipR), m_psipZ(psipZ), m_psipRZ(psipRZ), m_pred(predicate)
145 double psip = m_psip(R,Z);
146 double psipR = m_psipR(R,Z);
147 double psipZ = m_psipZ(R,Z);
148 double psipRZ = m_psipRZ(R,Z);
150 return psipRZ*m_poly( psip) + psipR*psipZ*m_dpoly(psip);
157 std::function<double(
double,
double)> m_psip, m_psipR, m_psipZ, m_psipRZ;
158 std::function<bool(
double,
double)> m_pred;
176 const std::function<
bool(
double,
double)> predicate,
178 double psi0,
double alpha,
double sign = -1)
181 mod::Psip(predicate,psip.
f(), psi0, alpha, sign),
193 DampingRegion( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip,
double psi0,
double alpha,
double sign = -1) :
194 m_poly( psi0, alpha, sign), m_psip(psip), m_pred(predicate)
196 double do_compute(
double R,
double Z)
const
199 return m_poly( m_psip(R,Z));
205 std::function<double(
double,
double)> m_psip;
206 std::function<bool(
double,
double)> m_pred;
208struct MagneticTransition :
public aCylindricalFunctor<MagneticTransition>
210 MagneticTransition( std::function<
bool(
double,
double)> predicate, std::function<
double(
double,
double)> psip,
double psi0,
double alpha,
double sign = -1) :
211 m_dpoly( psi0, alpha, sign), m_psip(psip), m_pred(predicate)
213 double do_compute(
double R,
double Z)
const
215 double psip = m_psip(R,Z);
217 return m_dpoly( psip);
223 std::function<double(
double,
double)> m_psip;
224 std::function<bool(
double,
double)> m_pred;
227static bool nowhere(
double R,
double Z){
return false;}
228static bool everywhere(
double R,
double Z){
return !nowhere(R,Z);}
230 HeavisideZ(
double Z_X,
int side): m_ZX( Z_X), m_side(side) {}
231 bool operator()(
double R,
double Z){
232 if( Z < m_ZX && m_side <= 0)
return true;
233 if( Z >= m_ZX && m_side > 0)
return true;
253 std::function<
double(
double,
double)> fct1,
254 std::function<
double(
double,
double)> fct2) :
255 m_fct1(fct1), m_fct2(fct2), m_fct_mod( fct_mod)
259 return m_fct_mod( m_fct1(R,Z), m_fct2(R,Z));
262 std::function<double(
double,
double)> m_fct1, m_fct2, m_fct_mod;
272 SetUnion( std::function<
double(
double,
double)> fct1,
273 std::function<
double(
double,
double)> fct2) :
274 m_fct1(fct1), m_fct2(fct2)
278 double f1 = m_fct1(R,Z), f2 = m_fct2( R,Z);
279 return f1 + f2 - f1*f2;
282 std::function<double(
double,
double)> m_fct1, m_fct2;
293 std::function<
double(
double,
double)> fct2) :
294 m_fct1(fct1), m_fct2(fct2)
298 double f1 = m_fct1(R,Z), f2 = m_fct2( R,Z);
302 std::function<double(
double,
double)> m_fct1, m_fct2;
312 SetNot( std::function<
double(
double,
double)> fct) :
320 std::function<double(
double,
double)> m_fct;
static dg::geo::CylindricalFunctorsLvl2 createPsip(const std::function< bool(double, double)> predicate, const CylindricalFunctorsLvl2 &psip, double psi0, double alpha, double sign=-1)
Definition: modified.h:175
This struct bundles a function and its first and second derivatives.
Definition: fluxfunctions.h:219
const CylindricalFunctor & dfxy() const
Definition: fluxfunctions.h:251
const CylindricalFunctor & dfy() const
Definition: fluxfunctions.h:247
const CylindricalFunctor & dfx() const
Definition: fluxfunctions.h:245
const CylindricalFunctor & dfxx() const
Definition: fluxfunctions.h:249
const CylindricalFunctor & f() const
Definition: fluxfunctions.h:243
const CylindricalFunctor & dfyy() const
Definition: fluxfunctions.h:253
Represent functions written in cylindrical coordinates that are independent of the angle phi serving ...
Definition: fluxfunctions.h:66
Definition: modified.h:39
double do_compute(double R, double Z) const
Definition: modified.h:43
Psip(std::function< bool(double, double)> predicate, std::function< double(double, double)> psip, double psi0, double alpha, double sign=-1)
Definition: modified.h:40
Definition: modified.h:57
PsipR(std::function< bool(double, double)> predicate, std::function< double(double, double)> psip, std::function< double(double, double)> psipR, double psi0, double alpha, double sign=-1)
Definition: modified.h:58
double do_compute(double R, double Z) const
Definition: modified.h:61
Definition: modified.h:118
PsipRR(std::function< bool(double, double)> predicate, std::function< double(double, double)> psip, std::function< double(double, double)> psipR, std::function< double(double, double)> psipRR, double psi0, double alpha, double sign=-1)
Definition: modified.h:119
double do_compute(double R, double Z) const
Definition: modified.h:122
Definition: modified.h:139
double do_compute(double R, double Z) const
Definition: modified.h:143
PsipRZ(std::function< bool(double, double)> predicate, std::function< double(double, double)> psip, std::function< double(double, double)> psipR, std::function< double(double, double)> psipZ, std::function< double(double, double)> psipRZ, double psi0, double alpha, double sign=-1)
Definition: modified.h:140
Definition: modified.h:76
PsipZ(std::function< bool(double, double)> predicate, std::function< double(double, double)> psip, std::function< double(double, double)> psipZ, double psi0, double alpha, double sign=-1)
Definition: modified.h:77
double do_compute(double R, double Z) const
Definition: modified.h:80
Definition: modified.h:96
double do_compute(double R, double Z) const
Definition: modified.h:100
PsipZZ(std::function< bool(double, double)> predicate, std::function< double(double, double)> psip, std::function< double(double, double)> psipZ, std::function< double(double, double)> psipZZ, double psi0, double alpha, double sign=-1)
Definition: modified.h:97
Definition: modified.h:251
SetCompose(std::function< double(double, double)> fct_mod, std::function< double(double, double)> fct1, std::function< double(double, double)> fct2)
Definition: modified.h:252
double do_compute(double R, double Z) const
Definition: modified.h:257
Definition: modified.h:291
SetIntersection(std::function< double(double, double)> fct1, std::function< double(double, double)> fct2)
Definition: modified.h:292
double do_compute(double R, double Z) const
Definition: modified.h:296
Definition: modified.h:311
double do_compute(double R, double Z) const
Definition: modified.h:315
SetNot(std::function< double(double, double)> fct)
Definition: modified.h:312
Definition: modified.h:271
double do_compute(double R, double Z) const
Definition: modified.h:276
SetUnion(std::function< double(double, double)> fct1, std::function< double(double, double)> fct2)
Definition: modified.h:272