Panzer Version of the Day
Loading...
Searching...
No Matches
panzer::Expr Namespace Reference

Contains all symbols which support panzer::Expr::Eval. More...

Classes

class  EvalBase
 Base class for panzer::Expr::Eval, does everything that is independent of the Kokkos::View template parameter. More...
struct  RebindDataType
 Rebinds a Kokkos::View data type to use a new scalar type. More...
struct  RebindDataType< NestedDataType *, NewScalarType >
struct  RebindDataType< NestedDataType[], NewScalarType >
struct  RebindDataType< NestedDataType[N], NewScalarType >
struct  RebindViewType
 Builds on RebindDataType, but acts directly on a Kokkos::View type. More...
struct  RebindViewType< Kokkos::View< DT, VP ... >, NewScalarType >
class  Eval
 Interprets mathematical expressions in a string and evaluates them using Kokkos::View objects as values and Kokkos::parallel_for for the operators. This class is mean to support Kokkos-parallel execution of user-provided mathematical expressions. Example uses include evaluating analytic boundary and initial conditions for a PDE problem. The API of this class (namely Eval::read_string or another read_* function inherited from Teuchos::Reader) is only meant to be called once for a given set of evaluation points. Variables should be predefined with point-dependent values all stored in a single Kokkos::View. For example, X coordinates for all points could be stored in a Kokkos::View<double*>, whose extent is the number of points. Values which are the same for all points are still supported, for example the current time. Then if the expression is for example "x^t", this class launches a single parallel_for to raise the coordinate of all points at once to the "t" power. More...
struct  ScalarTernary
struct  ScalarOr
struct  ScalarAnd
struct  ScalarGT
struct  ScalarLT
struct  ScalarGEQ
struct  ScalarLEQ
struct  ScalarEQ
struct  ScalarAdd
struct  ScalarSub
struct  ScalarMul
struct  ScalarDiv
struct  ScalarPow
struct  ScalarNeg
struct  Indexer
struct  Indexer< ViewType, 1, 0 >
struct  Indexer< ViewType, 1, 1 >
struct  Indexer< ViewType, 2, 0 >
struct  Indexer< ViewType, 2, 1 >
struct  Indexer< ViewType, 2, 2 >
struct  MaxRank
struct  MaxRank< T >
struct  ResultType
struct  TernaryResultType
struct  BinaryFunctor
struct  BinaryFunctor< Op, Result, Left, Right, 0 >
struct  BinaryFunctor< Op, Result, Left, Right, 1 >
struct  BinaryFunctor< Op, Result, Left, Right, 2 >
struct  TernaryFunctor
struct  TernaryFunctor< Cond, Left, Right, 1 >
struct  TernaryFunctor< Cond, Left, Right, 2 >
struct  UnaryFunctor
struct  UnaryFunctor< Op, Result, 0 >
struct  UnaryFunctor< Op, Result, 1 >
struct  UnaryFunctor< Op, Result, 2 >
struct  ScalarAbs
struct  ScalarExp
struct  ScalarLog
struct  ScalarSqrt
struct  ScalarSin
struct  ScalarCos
struct  ScalarTan
struct  UnaryFunction

Enumerations

enum class  BinaryOpCode {
  OR , AND , GT , LT ,
  GEQ , LEQ , EQ , ADD ,
  SUB , MUL , DIV , POW
}
 Denotes the native binary operators in the Teuchos::MathExpr language. More...

Functions

static const char * get_op_syntax (BinaryOpCode code)
template<typename DT, typename ... VP>
void set_cmath_functions (Eval< DT, VP ... > &eval)
 Add support for functions such as sqrt(), sin(), and cos().

Detailed Description

Contains all symbols which support panzer::Expr::Eval.

Enumeration Type Documentation

◆ BinaryOpCode

enum class panzer::Expr::BinaryOpCode
strong

Denotes the native binary operators in the Teuchos::MathExpr language.

Enumerator
OR 
AND 
GT 
LT 
GEQ 
LEQ 
EQ 
ADD 
SUB 
MUL 
DIV 
POW 

Definition at line 39 of file Panzer_ExprEval.hpp.

Function Documentation

◆ get_op_syntax()

const char * panzer::Expr::get_op_syntax ( BinaryOpCode code)
static

Definition at line 196 of file Panzer_ExprEval.cpp.

◆ set_cmath_functions()

template<typename DT, typename ... VP>
void panzer::Expr::set_cmath_functions ( Eval< DT, VP ... > & eval)

Add support for functions such as sqrt(), sin(), and cos().

After this call, (eval) is able to interpret strings which include calls to these functions:

  • abs(x)
  • exp(x)
  • log(x)
  • sqrt(x)
  • sin(x)
  • cos(x)
  • tan(x)
Note
This function is kept separate in case users want to use Expr::Eval with a scalar type that only supports basic operators but doesn't support these higher-level math functions (an integer for example).

Definition at line 677 of file Panzer_ExprEval_impl.hpp.