Extension: Geometries
#include "dg/geometries/geometries.h"
5. Miscellaneous additions

\( q(\psi_p)\) and \( \nabla \psi_p ( R_X, Z_X) = 0\) More...

Classes

struct  dg::geo::FluxSurfaceIntegral< container >
 Flux surface integral of the form \( \int dR dZ f(R,Z) \delta(\psi_p(R,Z)-\psi_0) g(R,Z) \). More...
 
struct  dg::geo::FluxVolumeIntegral< container >
 Flux volume integral of the form \( \int dR dZ f(R,Z) \Theta(\psi_p(R,Z)-\psi_0) g(R,Z) \). More...
 
struct  dg::geo::FluxSurfaceAverage< container >
 Flux surface average (differential volume average) over quantity \( \langle f\rangle(\psi_0) = \frac{1}{A} \int dR dZ \delta(\psi_p(R,Z)-\psi_0) f(R,Z)H(R,Z) \). More...
 
struct  dg::geo::SafetyFactorAverage
 Class for the evaluation of the safety factor q based on a flux-surface integral \( q(\psi_0) = \frac{1}{2\pi} \int dRdZ \frac{I(\psi_p)}{R} \delta(\psi_p - \psi_0)H(R,Z) \). More...
 
struct  dg::geo::SafetyFactor
 Evaluation of the safety factor q based on direct integration of \( q(\psi_0) = \frac{1}{2\pi} \int d\Theta \frac{B^\varphi}{B^\Theta} \). More...
 

Functions

static int dg::geo::findCriticalPoint (const CylindricalFunctorsLvl2 &psi, double &RC, double &ZC)
 This function finds critical points of psi (any point with vanishing gradient, including the X-point or O-point) via Newton iteration applied to the gradient of psi. More...
 
static int dg::geo::findOpoint (const CylindricalFunctorsLvl2 &psi, double &RC, double &ZC)
 This function finds O-points of psi. More...
 
static void dg::geo::findXpoint (const CylindricalFunctorsLvl2 &psi, double &RC, double &ZC)
 This function finds X-points of psi. More...
 

Detailed Description

\( q(\psi_p)\) and \( \nabla \psi_p ( R_X, Z_X) = 0\)

Function Documentation

◆ findCriticalPoint()

static int dg::geo::findCriticalPoint ( const CylindricalFunctorsLvl2 psi,
double &  RC,
double &  ZC 
)
inlinestatic

This function finds critical points of psi (any point with vanishing gradient, including the X-point or O-point) via Newton iteration applied to the gradient of psi.

Newton iteration applied to \( \nabla \psi (\vec x) = 0 \) reads

\[ \vec x_{i+1} = \vec x_i - H^{-1} \nabla \psi (\vec x_i)\]

where H is the Hessian matrix. The inverse of the Hessian matrix is computed analytically

Parameters
psi\( \psi(R,Z)\)
RCstart value on input, critical point on output
ZCstart value on input, critical point on output
Returns
0 if no critical point or Hessian (determinant) is zero, 1 if local minimum, 2 if local maximum, 3 if saddle point

◆ findOpoint()

static int dg::geo::findOpoint ( const CylindricalFunctorsLvl2 psi,
double &  RC,
double &  ZC 
)
inlinestatic

This function finds O-points of psi.

Same as findCriticalPoint except that this function throws if it does not find a local minimum or a local maximum

Parameters
psi\( \psi(R,Z)\)
RCstart value on input, O-point on output
ZCstart value on input, O-point on output
Returns
1 if local minimum, 2 if local maximum,

◆ findXpoint()

static void dg::geo::findXpoint ( const CylindricalFunctorsLvl2 psi,
double &  RC,
double &  ZC 
)
inlinestatic

This function finds X-points of psi.

Same as findCriticalPoint except that this function throws if it does not find a saddle point

Parameters
psi\( \psi(R,Z)\)
RCstart value on input, X-point on output
ZCstart value on input, X-point on output