Extension: Geometries
#include "dg/geometries/geometries.h"
dg::geo::FluxSurfaceAverage< container > Struct Template Reference

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

Public Member Functions

 FluxSurfaceAverage (const dg::Grid2d &g2d, const TokamakMagneticField &mag, const container &f, container weights, double width_factor=1.)
 Construct from a field and a grid. More...
 
double get_deltapsi () const
 
void set_container (const container &f)
 Reset the function to average. More...
 
double operator() (double psip0)
 Calculate the Flux Surface Average. More...
 

Detailed Description

template<class container>
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) \).

with \( A = \int dRdZ \delta(\psi_p(R,Z)-\psi_0)H(R,Z)\) where H is a weight function that can be used to e.g. cut away parts of the domain below the X-point or contain a volume form

Constructor & Destructor Documentation

◆ FluxSurfaceAverage()

template<class container >
dg::geo::FluxSurfaceAverage< container >::FluxSurfaceAverage ( const dg::Grid2d g2d,
const TokamakMagneticField mag,
const container &  f,
container  weights,
double  width_factor = 1. 
)
inline

Construct from a field and a grid.

Parameters
g2d2d grid
magcontains psip, psipR and psipZ
fthe function to take the average over (until set_container() is called)
weightsWeight function H (can be used to cut away parts of the domain e.g. below the X-point and/or contain a volume form without dg weights)
width_factorcan be used to tune the width of the numerical delta function (width = h*GradPsi*width_factor)

Member Function Documentation

◆ get_deltapsi()

template<class container >
double dg::geo::FluxSurfaceAverage< container >::get_deltapsi ( ) const
inline

◆ operator()()

template<class container >
double dg::geo::FluxSurfaceAverage< container >::operator() ( double  psip0)
inline

Calculate the Flux Surface Average.

Parameters
psip0the actual psi value for q(psi)
Returns
q(psip0)

◆ set_container()

template<class container >
void dg::geo::FluxSurfaceAverage< container >::set_container ( const container &  f)
inline

Reset the function to average.

Parameters
fthe container containing the discretized function

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