File expr.hxx

Defines

DEFINE_BINARY_OP(name, op)

Binary operator classes.

DEFINE_OVERLOAD_FUNC(name, func)

Define functions add, mul which use operator structs.

Functions

template<typename ExprT1, typename ExprT2>
BinaryResult<ExprT1, ExprT2, Add>::type add(const ExprT1 &e1, const ExprT2 &e2)

Addition of two Expressions.

template<typename ExprT1, typename ExprT2>
BinaryResult<ExprT1, ExprT2, Multiply>::type mul(const ExprT1 &e1, const ExprT2 &e2)

Multiplication of two Expressions.

template<typename Expr>
const Field3D eval3D(Expr e)

A function to evaluate expressions.

class Literal
#include <expr.hxx>

Literal class to capture BoutReal values in expressions.

Public Types

using type = Literal

Type of this expression.

Public Functions

Literal(BoutReal v)
~Literal()
BoutReal operator()(int x, int y, int z) const

Private Members

const BoutReal val
class Field3DExpr

Public Types

using type = Field3D

Public Functions

Field3DExpr(const Field3D &f)
const BoutReal &operator()(int x, int y, int z) const

Private Members

const BoutReal *data
class Field2DExpr

Public Types

using type = Field2D

Public Functions

Field2DExpr(const Field2D &f)
const BoutReal &operator()(int x, int y, int z) const

Private Members

const BoutReal *data
template<class ExprT>
struct exprTraits
#include <expr.hxx>

Expression traits, to convert doubles etc. to Literal.

Public Types

template<>
using expr_type = ExprT
template<>
struct exprTraits<double>

Public Types

template<>
using expr_type = Literal
template<>
struct exprTraits<float>

Public Types

template<>
using expr_type = Literal
template<>
struct exprTraits<int>

Public Types

template<>
using expr_type = Literal
template<typename T>
struct asExpr

Public Types

template<>
using type = T

Public Static Functions

static const T &getExpr(const T &x)
template<>
struct asExpr<int>

Public Types

template<>
using type = Literal

Public Static Functions

static const Literal getExpr(const int &x)
template<>
struct asExpr<double>

Public Types

template<>
using type = Literal

Public Static Functions

static const Literal getExpr(const double &x)
template<>
struct asExpr<float>

Public Types

template<>
using type = Literal

Public Static Functions

static const Literal getExpr(const float &x)
template<>
struct asExpr<Field3D>

Public Types

template<>
using type = Field3DExpr

Public Static Functions

static const Field3DExpr getExpr(const Field3D &x)
template<typename Lhs, typename Rhs>
struct PromoteType

Public Types

template<>
using type = Field3D
template<class ExprT1, class ExprT2, class BinOp>
class BinaryExpr

Public Types

template<>
using ltype = typename exprTraits<ExprT1>::expr_type
template<>
using rtype = typename exprTraits<ExprT2>::expr_type
template<>
using type = typename PromoteType::type

Type of the resulting expression.

Public Functions

BinaryExpr(const ExprT1 &e1, const ExprT2 &e2)
BoutReal operator()(int x, int y, int z) const

Private Members

ltype const _expr1
rtype const _expr2
template<typename ExprT1, typename ExprT2, class name>
struct BinaryResult

Public Types

template<>
using arg1 = typename asExpr<ExprT1>::type
template<>
using arg2 = typename asExpr<ExprT2>::type
template<>
using type = BinaryExpr<arg1, arg2, name>
struct Add

Public Static Functions

template<typename T>
static T apply(T a, T b)
struct Subtract

Public Static Functions

template<typename T>
static T apply(T a, T b)
struct Multiply

Public Static Functions

template<typename T>
static T apply(T a, T b)
struct Divide

Public Static Functions

template<typename T>
static T apply(T a, T b)
struct Power

Public Static Functions

template<typename T>
static T apply(T a, T b)