Extension: Geometries
#include "dg/geometries/geometries.h"
dg::geo::SafetyFactorAverage Struct Reference

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...

Public Member Functions

 SafetyFactorAverage (const dg::Grid2d &g2d, const TokamakMagneticField &mag, double width_factor=1.)
 Construct from a field and a grid. More...
 
void set_weights (const thrust::host_vector< double > &weights)
 Weight function H (can be used to cut away parts of the domain e.g. below the X-point) More...
 
double operator() (double psip0)
 Calculate the q(psip0) More...
 

Detailed Description

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) \).

where H is a weights function that can optionally be used to cut away parts of the domain e.g. below the X-point.

Template Parameters
containerA data container class for which the blas1 functionality is overloaded. We assume that container is copyable/assignable and has a swap member function. Currently this is one of

Constructor & Destructor Documentation

◆ SafetyFactorAverage()

dg::geo::SafetyFactorAverage::SafetyFactorAverage ( const dg::Grid2d g2d,
const TokamakMagneticField mag,
double  width_factor = 1. 
)
inline

Construct from a field and a grid.

Parameters
g2d2d grid
magcontains psip, psipR and psipZ and Ipol
width_factorcan be used to tune the width of the numerical delta function (width = h*GradPsi*width_factor)

Member Function Documentation

◆ operator()()

double dg::geo::SafetyFactorAverage::operator() ( double  psip0)
inline

Calculate the q(psip0)

Parameters
psip0the flux surface
Returns
q(psip0)

◆ set_weights()

void dg::geo::SafetyFactorAverage::set_weights ( const thrust::host_vector< double > &  weights)
inline

Weight function H (can be used to cut away parts of the domain e.g. below the X-point)


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