Opm::MathToolbox< ScalarT, true > Struct Template Reference

#include <MathToolbox.hpp>

Public Types

typedef ScalarT Scalar
 The type used to represent scalar values. More...
 
typedef ScalarT Evaluation
 The type used to represent function evaluations. More...
 

Static Public Member Functions

static Scalar value (const Evaluation &eval)
 Return the value of the function at a given evaluation point. More...
 
static Scalar createConstant (Scalar value)
 Given a scalar value, return an evaluation of a constant function. More...
 
static Scalar createVariable (Scalar value, int)
 Given a scalar value, return an evaluation of a linear function. More...
 
template<class LhsEval >
static LhsEval toLhs (const Evaluation &eval)
 Given a function evaluation, constrain it to its value (if necessary). More...
 
static Scalar passThroughOrCreateConstant (Scalar value)
 Pass a value through if it is an evaluation, or create a constant evaluation if it is a scalar. More...
 
static Scalar max (Scalar arg1, Scalar arg2)
 The maximum of two arguments. More...
 
static Scalar min (Scalar arg1, Scalar arg2)
 The minimum of two arguments. More...
 
static Scalar abs (Scalar arg)
 The absolute value. More...
 
static Scalar tan (Scalar arg)
 The tangens of a value. More...
 
static Scalar atan (Scalar arg)
 The arcus tangens of a value. More...
 
static Scalar atan2 (Scalar arg1, Scalar arg2)
 The arcus tangens of a value. More...
 
static Scalar sin (Scalar arg)
 The sine of a value. More...
 
static Scalar asin (Scalar arg)
 The arcus sine of a value. More...
 
static Scalar cos (Scalar arg)
 The cosine of a value. More...
 
static Scalar acos (Scalar arg)
 The arcus cosine of a value. More...
 
static Scalar sqrt (Scalar arg)
 The square root of a value. More...
 
static Scalar exp (Scalar arg)
 The natural exponentiation of a value. More...
 
static Scalar log (Scalar arg)
 The natural logarithm of a value. More...
 
static Scalar pow (Scalar base, Scalar exp)
 Exponentiation to an arbitrary base. More...
 

Member Typedef Documentation

template<class ScalarT >
typedef ScalarT Opm::MathToolbox< ScalarT, true >::Evaluation

The type used to represent function evaluations.

In general, that is the value of the function plus a number of derivatives at the evaluation point. In the case of the scalar toolbox, no derivatives will be evaluated.

template<class ScalarT >
typedef ScalarT Opm::MathToolbox< ScalarT, true >::Scalar

The type used to represent scalar values.

Member Function Documentation

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::abs ( Scalar  arg)
inlinestatic

The absolute value.

References Opm::LocalAd::abs().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::acos ( Scalar  arg)
inlinestatic

The arcus cosine of a value.

References Opm::LocalAd::acos().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::asin ( Scalar  arg)
inlinestatic

The arcus sine of a value.

References Opm::LocalAd::asin().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::atan ( Scalar  arg)
inlinestatic

The arcus tangens of a value.

References Opm::LocalAd::atan().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::atan2 ( Scalar  arg1,
Scalar  arg2 
)
inlinestatic

The arcus tangens of a value.

References Opm::LocalAd::atan2().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::cos ( Scalar  arg)
inlinestatic

The cosine of a value.

References Opm::LocalAd::cos().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::createConstant ( Scalar  value)
inlinestatic

Given a scalar value, return an evaluation of a constant function.

For this toolbox, an evaluation is the value, so this method is the identity function. In general, this returns an evaluation object for which all derivatives are zero.

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::createVariable ( Scalar  value,
int   
)
inlinestatic

Given a scalar value, return an evaluation of a linear function.

i.e., Create an evaluation which represents f(x) = x and the derivatives with regard to x. For scalar evaluations (which do not consider derivatives), this method does nothing.

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::exp ( Scalar  arg)
inlinestatic

The natural exponentiation of a value.

References Opm::LocalAd::exp().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::log ( Scalar  arg)
inlinestatic

The natural logarithm of a value.

References Opm::LocalAd::log().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::max ( Scalar  arg1,
Scalar  arg2 
)
inlinestatic

The maximum of two arguments.

References Opm::LocalAd::max().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::min ( Scalar  arg1,
Scalar  arg2 
)
inlinestatic

The minimum of two arguments.

References Opm::LocalAd::min().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::passThroughOrCreateConstant ( Scalar  value)
inlinestatic

Pass a value through if it is an evaluation, or create a constant evaluation if it is a scalar.

In some sense, this method is the opposite of "toLhs()": If the function argument is a Scalar, an Evaluation which represents a constant value is returned, if the argument is an Evaluation, it is returned as is. This method makes it possible to uniformly handle the cases where some condition is either given by a constant value or as a value which depends on other variables. (E.g. boundary conditions.)

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::pow ( Scalar  base,
Scalar  exp 
)
inlinestatic

Exponentiation to an arbitrary base.

References Opm::LocalAd::pow().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::sin ( Scalar  arg)
inlinestatic

The sine of a value.

References Opm::LocalAd::sin().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::sqrt ( Scalar  arg)
inlinestatic

The square root of a value.

References Opm::LocalAd::sqrt().

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::tan ( Scalar  arg)
inlinestatic

The tangens of a value.

References Opm::LocalAd::tan().

template<class ScalarT >
template<class LhsEval >
static LhsEval Opm::MathToolbox< ScalarT, true >::toLhs ( const Evaluation eval)
inlinestatic

Given a function evaluation, constrain it to its value (if necessary).

If the left hand side is a scalar and the right hand side is an evaluation, the scalar gets the value of the right hand side assigned. Also if both sides are scalars, this method returns the identity. The final case (left hand side being an evaluation, right hand side is a scalar) yields a compiler error.

The purpose of this method is to be able to transparantly use evaluation objects in scalar computations.

template<class ScalarT >
static Scalar Opm::MathToolbox< ScalarT, true >::value ( const Evaluation eval)
inlinestatic

Return the value of the function at a given evaluation point.

For this toolbox, an evaluation is the value, so this method is the identity function.


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