File index_derivs.hxx

Definition of available derivative methods and registration within store

Copyright 2018 D.Dickinson, P.Hill, B.Dudson

Contact: Ben Dudson, bd512@york.ac.uk

This file is part of BOUT++.

BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.

Defines

DEFINE_STANDARD_DERIV_CORE(name, key, nGuards, type)
DEFINE_STANDARD_DERIV(name, key, nGuards, type)
DEFINE_UPWIND_DERIV_CORE(name, key, nGuards, type)
DEFINE_UPWIND_DERIV(name, key, nGuards, type)
DEFINE_FLUX_DERIV_CORE(name, key, nGuards, type)
DEFINE_FLUX_DERIV(name, key, nGuards, type)
DEFINE_STANDARD_DERIV_STAGGERED(name, key, nGuards, type)
DEFINE_UPWIND_DERIV_STAGGERED(name, key, nGuards, type)
DEFINE_FLUX_DERIV_STAGGERED(name, key, nGuards, type)
WRAP_ENUM(family, value)

Some helper defines for now that allow us to wrap up enums and the specific methods.

REGISTER_DERIVATIVE(name)
REGISTER_STAGGERED_DERIVATIVE(name)
REGISTER_STANDARD_DERIVATIVE(name, key, nGuards, type)
REGISTER_UPWIND_DERIVATIVE(name, key, nGuards, type)
REGISTER_FLUX_DERIVATIVE(name, key, nGuards, type)
REGISTER_STANDARD_STAGGERED_DERIVATIVE(name, key, nGuards, type)
REGISTER_STANDARD_DERIVATIVE_STAGGERED(name, key, nGuards, type)
REGISTER_UPWIND_STAGGERED_DERIVATIVE(name, key, nGuards, type)
REGISTER_UPWIND_DERIVATIVE_STAGGERED(name, key, nGuards, type)
REGISTER_FLUX_STAGGERED_DERIVATIVE(name, key, nGuards, type)
REGISTER_FLUX_DERIVATIVE_STAGGERED(name, key, nGuards, type)

Functions

inline std::ostream &operator<<(std::ostream &out, const metaData &meta)

Provide an easy way to report a Region’s statistics.

Variables

const BoutReal WENO_SMALL = 1.0e-8
struct metaData

Public Members

const char *key
const int nGuards
const DERIV derivType
template<typename FF>
class DerivativeType
#include <index_derivs.hxx>

Here we define a helper class that provides a means to use a supplied stencil using functor to calculate a derivative over the entire field. Note we currently have a different interface for some of the derivative types to avoid needing different classes to represent the different operations The use of a functor here makes it possible to wrap up metaData into the type as well.

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
inline BoutReal apply(const stencil &f) const
inline BoutReal apply(BoutReal v, const stencil &f) const
inline BoutReal apply(const stencil &v, const stencil &f) const

Public Static Attributes

static constexpr FF func = {}
static constexpr metaData meta = {FF::meta}
struct registerMethod
#include <index_derivs.hxx>

Following code is for dealing with registering a method/methods for all template combinations, in conjunction with the template_combinations code.

Public Functions

template<typename Direction, typename Stagger, typename FieldTypeContainer, typename Method>
inline void operator()(Direction, Stagger, FieldTypeContainer, Method)