File index_derivs.cxx#

Functions

REGISTER_STANDARD_DERIVATIVE (DDX_C2, "C2", 1, DERIV::Standard)

central, 2nd order

REGISTER_STANDARD_DERIVATIVE (DDX_C4, "C4", 2, DERIV::Standard)

central, 4th order

REGISTER_STANDARD_DERIVATIVE (DDX_CWENO2, "W2", 1, DERIV::Standard)

Central WENO method, 2nd order (reverts to 1st order near shocks)

REGISTER_STANDARD_DERIVATIVE (DDX_S2, "S2", 2, DERIV::Standard)
REGISTER_STANDARD_DERIVATIVE (D2DX2_C2, "C2", 1, DERIV::StandardSecond)

Also CWENO3 but needs an upwind op so define later.

Second derivative: Central, 2nd order

REGISTER_STANDARD_DERIVATIVE (D2DX2_C4, "C4", 2, DERIV::StandardSecond)

Second derivative: Central, 4th order.

REGISTER_STANDARD_DERIVATIVE (D4DX4_C2, "C2", 2, DERIV::StandardFourth)
std::tuple<BoutReal, BoutReal> vUpDown(BoutReal v)#

Upwind non-staggered methods

Basic derivative methods. All expect to have an input grid cell at the same location as the output Hence convert cell centred values -> centred values, or left -> left

REGISTER_UPWIND_DERIVATIVE (VDDX_C2, "C2", 1, DERIV::Upwind)

Upwinding: Central, 2nd order.

REGISTER_UPWIND_DERIVATIVE (VDDX_C4, "C4", 2, DERIV::Upwind)

Upwinding: Central, 4th order.

REGISTER_UPWIND_DERIVATIVE (VDDX_U1, "U1", 1, DERIV::Upwind)

upwind, 1st order

REGISTER_UPWIND_DERIVATIVE (VDDX_U2, "U2", 2, DERIV::Upwind)

upwind, 2nd order

REGISTER_UPWIND_DERIVATIVE (VDDX_U3, "U3", 2, DERIV::Upwind)

upwind, 3rd order

REGISTER_UPWIND_DERIVATIVE (VDDX_WENO3, "W3", 2, DERIV::Upwind)

3rd-order WENO scheme

REGISTER_STANDARD_DERIVATIVE (DDX_CWENO3, "W3", 2, DERIV::Standard)

3rd-order CWENO. Uses the upwinding code and split flux

REGISTER_FLUX_DERIVATIVE (FDDX_U1, "U1", 1, DERIV::Flux)

Flux non-staggered methods

Basic derivative methods. All expect to have an input grid cell at the same location as the output Hence convert cell centred values -> centred values, or left -> left

REGISTER_FLUX_DERIVATIVE (FDDX_U2, "U2", 2, DERIV::Flux)
REGISTER_FLUX_DERIVATIVE (FDDX_C2, "C2", 2, DERIV::Flux)
REGISTER_FLUX_DERIVATIVE (FDDX_C4, "C4", 2, DERIV::Flux)
REGISTER_STANDARD_DERIVATIVE_STAGGERED (DDX_C2_stag, "C2", 1, DERIV::Standard)

Standard methods &#8212; first order.

Staggered methods

Map Centre -> Low or Low -> Centre

These expect the output grid cell to be at a different location to the input

The stencil no longer has a value in ‘C’ (centre) instead, points are shifted as follows:

mm -> -3/2 h m -> -1/2 h p -> +1/2 h pp -? +3/2 h

NOTE: Cell widths (dx, dy, dz) are currently defined as centre->centre for the methods above. This is currently not taken account of, so large variations in cell size will cause issues.

REGISTER_STANDARD_DERIVATIVE_STAGGERED (DDX_C4_stag, "C4", 2, DERIV::Standard)
REGISTER_STANDARD_DERIVATIVE_STAGGERED (D2DX2_C2_stag, "C2", 2, DERIV::StandardSecond)

Standard methods &#8212; second order.

REGISTER_UPWIND_DERIVATIVE_STAGGERED (VDDX_U1_stag, "U1", 1, DERIV::Upwind)

Upwind methods.

REGISTER_UPWIND_DERIVATIVE_STAGGERED (VDDX_U2_stag, "U2", 2, DERIV::Upwind)
REGISTER_UPWIND_DERIVATIVE_STAGGERED (VDDX_C2_stag, "C2", 1, DERIV::Upwind)
REGISTER_UPWIND_DERIVATIVE_STAGGERED (VDDX_C4_stag, "C4", 2, DERIV::Upwind)
REGISTER_FLUX_DERIVATIVE_STAGGERED (FDDX_U1_stag, "U1", 1, DERIV::Flux)

Flux methods.

REGISTER_FLUX_DERIVATIVE_STAGGERED (FDDX_U2_stag, "U2", 2, DERIV::Flux)

Variables

produceCombinations< Set< WRAP_ENUM(DIRECTION, Z)>, Set< WRAP_ENUM(STAGGER, None)>, Set< TypeContainer< Field3D > >, Set< FFTDerivativeType, FFT2ndDerivativeType > > registerFFTDerivative (registerMethod{})
produceCombinations< Set< WRAP_ENUM(DIRECTION, X), WRAP_ENUM(DIRECTION, Y), WRAP_ENUM(DIRECTION, YOrthogonal), WRAP_ENUM(DIRECTION, Z)>, Set< WRAP_ENUM(STAGGER, None), WRAP_ENUM(STAGGER, C2L), WRAP_ENUM(STAGGER, L2C)>, Set< TypeContainer< Field3D >, TypeContainer< Field2D > >, Set< SplitFluxDerivativeType > > registerSplitDerivative (registerMethod{})
class FFTDerivativeType#

Here’s an example of defining and registering a custom method that doesn’t fit into the standard stencil based approach.

Public Functions

template<DIRECTION direction, STAGGER stagger, int nGuards, typename T>
inline void standard(const T &var, T &result, const std::string &region) const#
template<DIRECTION direction, STAGGER stagger, int nGuards, typename T>
inline void upwindOrFlux(const T &vel, const T &var, T &result, const std::string &region) const#

Public Static Attributes

static constexpr metaData meta = {"FFT", 0, DERIV::Standard}#
class FFT2ndDerivativeType#

Public Functions

template<DIRECTION direction, STAGGER stagger, int nGuards, typename T>
inline void standard(const T &var, T &result, const std::string &region) const#
template<DIRECTION direction, STAGGER stagger, int nGuards, typename T>
inline void upwindOrFlux(const T &vel, const T &var, T &result, const std::string &region) const#

Public Static Attributes

static constexpr metaData meta = {"FFT", 0, DERIV::StandardSecond}#
class SplitFluxDerivativeType#

Public Functions

template<DIRECTION direction, STAGGER stagger, int nGuards, typename T>
inline void standard(const T&, T&, const std::string) const#
template<DIRECTION direction, STAGGER stagger, int nGuards, typename T>
inline void upwindOrFlux(const T &vel, const T &var, T &result, const std::string region) const#

Public Static Attributes

static constexpr metaData meta = {"SPLIT", 2, DERIV::Flux}#