Extension: Geometries
#include "dg/geometries/geometries.h"

Distance to wall along fieldline in phi or s coordinate More...

Inheritance diagram for dg::geo::WallFieldlineDistance:
[legend]

Public Member Functions

 WallFieldlineDistance (const dg::geo::CylindricalVectorLvl0 &vec, const dg::aRealTopology2d< double > &domain, double maxPhi, double eps, std::string type)
 Construct with vector field, domain. More...
 
double do_compute (double R, double Z) const
 Integrate fieldline until wall is reached. More...
 
 WallFieldlineDistance (const dg::geo::CylindricalVectorLvl0 &vec, const dg::aRealTopology2d< double > &domain, double maxPhi, double eps, std::string type)
 Construct with vector field, domain. More...
 
double do_compute (double R, double Z) const
 Integrate fieldline until wall is reached. More...
 
 WallFieldlineDistance (const dg::geo::CylindricalVectorLvl0 &vec, const dg::aRealTopology2d< double > &domain, double maxPhi, double eps, std::string type)
 Construct with vector field, domain. More...
 
double do_compute (double R, double Z) const
 Integrate fieldline until wall is reached. More...
 
- Public Member Functions inherited from dg::geo::aCylindricalFunctor< WallFieldlineDistance >
double operator() (double R, double Z) const
  do_compute(R,Z) More...
 
double operator() (double R, double Z, double phi) const
  do_compute(R,Z) More...
 

Detailed Description

Distance to wall along fieldline in phi or s coordinate

The following differential equation is integrated

\[ \frac{ d R}{d \varphi} = b^R / b^\varphi \\ \frac{ d Z}{d \varphi} = b^Z / b^\varphi \\ \frac{ d s}{s \varphi} = 1 / b^\varphi \]

for initial conditions \( (R,Z,0)\) until either a maximum angle is reached or until \( (R,Z) \) leaves the given domain. In the latter case a bisection algorithm is used to find the exact angle \(\varphi_l\) of leave. Either the angle \( \varphi_l\) or the corresponding \( s_l\) is returned by the function.

Attention
The sign of the angle coordinate in this class (unlike in Fieldaligned) is defined with respect to the direction of the magnetic field. Thus, for a positive maxPhi, the distance (both "phi" and "s") will be positive and for negative maxPhi the distance is negative.
The sign of the distance is defined with respect to the direction of the magnetic field (not the angle coordinate like in Fieldaligned)

Constructor & Destructor Documentation

◆ WallFieldlineDistance() [1/3]

dg::geo::WallFieldlineDistance::WallFieldlineDistance ( const dg::geo::CylindricalVectorLvl0 vec,
const dg::aRealTopology2d< double > &  domain,
double  maxPhi,
double  eps,
std::string  type 
)
inline

Construct with vector field, domain.

Parameters
vecThe vector field to integrate
domainThe box
maxPhithe maximum angle to integrate to (something like plus or minus 2.*M_PI)
epsthe accuracy of the fieldline integrator
typeeither "phi" then the distance is computed in the angle coordinate or "s" then the distance is computed in the s parameter

◆ WallFieldlineDistance() [2/3]

dg::geo::WallFieldlineDistance::WallFieldlineDistance ( const dg::geo::CylindricalVectorLvl0 vec,
const dg::aRealTopology2d< double > &  domain,
double  maxPhi,
double  eps,
std::string  type 
)
inline

Construct with vector field, domain.

Parameters
vecThe vector field to integrate
domainThe box
maxPhithe maximum angle to integrate to (something like +- 2.*M_PI)
Attention
The sign of the angle coordinate in this class (unlike in Fieldaligned) is defined with respect to the direction of the magnetic field. Thus, for a positive maxPhi, the distance (both "phi" and "s") will be positive and for negative maxPhi the distance is negative.
Parameters
epsthe accuracy of the fieldline integrator
typeeither "phi" then the distance is computed in the angle coordinate or "s" then the distance is computed in the s parameter

◆ WallFieldlineDistance() [3/3]

dg::geo::WallFieldlineDistance::WallFieldlineDistance ( const dg::geo::CylindricalVectorLvl0 vec,
const dg::aRealTopology2d< double > &  domain,
double  maxPhi,
double  eps,
std::string  type 
)
inline

Construct with vector field, domain.

Parameters
vecThe vector field to integrate
domainThe box
maxPhithe maximum angle to integrate to (something like +- 2.*M_PI)
Attention
The sign of the angle coordinate in this class (unlike in Fieldaligned) is defined with respect to the direction of the magnetic field. Thus, for a positive maxPhi, the distance (both "phi" and "s") will be positive and for negative maxPhi the distance is negative.
Parameters
epsthe accuracy of the fieldline integrator
typeeither "phi" then the distance is computed in the angle coordinate or "s" then the distance is computed in the s parameter

Member Function Documentation

◆ do_compute() [1/3]

double dg::geo::WallFieldlineDistance::do_compute ( double  R,
double  Z 
) const
inline

Integrate fieldline until wall is reached.

If wall is not reached integration stops at maxPhi given in the constructor

Parameters
Rstarting coordinate in R
Zstarting coordinate in Z
Returns
distance in phi or s
See also
dg::integrateERK

◆ do_compute() [2/3]

double dg::geo::WallFieldlineDistance::do_compute ( double  R,
double  Z 
) const
inline

Integrate fieldline until wall is reached.

If wall is not reached integration stops at maxPhi given in the constructor

Parameters
Rstarting coordinate in R
Zstarting coordinate in Z
Returns
distance in phi or s
See also
dg::integrateERK

◆ do_compute() [3/3]

double dg::geo::WallFieldlineDistance::do_compute ( double  R,
double  Z 
) const
inline

Integrate fieldline until wall is reached.

If wall is not reached integration stops at maxPhi given in the constructor

Parameters
Rstarting coordinate in R
Zstarting coordinate in Z
Returns
distance in phi or s
See also
dg::integrateERK

The documentation for this struct was generated from the following files: