All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Opm::MathToolbox< ScalarT > Struct Template Reference

Public Types

typedef ScalarT Scalar
 The type used to represent "primitive" scalar values.
 
typedef ScalarT ValueType
 The type used to represent values. More...
 
typedef Opm::MathToolbox< ScalarInnerToolbox
 The toolbox for the type of value objects. More...
 

Static Public Member Functions

static Scalar value (Scalar value)
 Return the value of the function at a given evaluation point. More...
 
static Scalar scalarValue (Scalar value)
 Return the primitive scalar value of a value object. More...
 
static Scalar createConstant (Scalar value)
 Given a scalar value, return an evaluation of a constant function. More...
 
static Scalar createVariable (Scalar value, unsigned)
 Given a scalar value, return an evaluation of a linear function. More...
 
template<class LhsEval >
static LhsEval decay (Scalar value)
 Given a function evaluation, constrain it to its value (if necessary). More...
 
static bool isSame (Scalar a, Scalar b, Scalar tolerance)
 Returns true if two values are identical up to a specified tolerance.
 
static Scalar max (Scalar arg1, Scalar arg2)
 The maximum of two arguments.
 
static Scalar min (Scalar arg1, Scalar arg2)
 The minimum of two arguments.
 
static Scalar abs (Scalar arg)
 The absolute value.
 
static Scalar tan (Scalar arg)
 The tangens of a value.
 
static Scalar atan (Scalar arg)
 The arcus tangens of a value.
 
static Scalar atan2 (Scalar arg1, Scalar arg2)
 The arcus tangens of a value.
 
static Scalar sin (Scalar arg)
 The sine of a value.
 
static Scalar asin (Scalar arg)
 The arcus sine of a value.
 
static Scalar cos (Scalar arg)
 The cosine of a value.
 
static Scalar acos (Scalar arg)
 The arcus cosine of a value.
 
static Scalar sqrt (Scalar arg)
 The square root of a value.
 
static Scalar exp (Scalar arg)
 The natural exponentiation of a value.
 
static Scalar log (Scalar arg)
 The natural logarithm of a value.
 
static Scalar pow (Scalar base, Scalar exp)
 Exponentiation to an arbitrary base.
 
static bool isfinite (Scalar arg)
 Return true iff the argument's value and all its derivatives are finite values.
 
static bool isnan (Scalar arg)
 Return true iff the argument's value or any of its derivatives are NaN values.
 

Member Typedef Documentation

template<class ScalarT>
typedef Opm::MathToolbox<Scalar> Opm::MathToolbox< ScalarT >::InnerToolbox

The toolbox for the type of value objects.

For this class this is trivial because primitive floating point objects are endpoints in the "nesting graph". This typedef makes sense if nested automatic differentiation is used, though...

template<class ScalarT>
typedef ScalarT Opm::MathToolbox< ScalarT >::ValueType

The type used to represent values.

In general, these objects represent the function value at a given point plus a number of derivatives. In the case of the scalars, no derivatives will be evaluated.

Member Function Documentation

template<class ScalarT>
static Scalar Opm::MathToolbox< ScalarT >::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 >::createVariable ( Scalar  value,
unsigned   
)
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 scalars (which do not consider derivatives), this method does nothing.

template<class ScalarT>
template<class LhsEval >
static LhsEval Opm::MathToolbox< ScalarT >::decay ( Scalar  value)
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 >::scalarValue ( Scalar  value)
inlinestatic

Return the primitive scalar value of a value object.

Since this toolbox's value objects are primitive scalars, this method just passes through the argument it was given.

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

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

For this toolbox, there are no derivatives so this method is the identity function.


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