Public Types | |
typedef ScalarT | Scalar |
The type used to represent "primitive" scalar values. | |
typedef ScalarT | ValueType |
The type used to represent values. | |
typedef Opm::MathToolbox< Scalar > | InnerToolbox |
The toolbox for the type of value objects. | |
Public Member Functions | |
static_assert (std::is_floating_point< ScalarT >::value,"This class expects floating point scalars! (specialization missing?)") | |
Static Public Member Functions | |
static Scalar | value (Scalar value) |
Return the value of the function at a given evaluation point. | |
static Scalar | scalarValue (Scalar value) |
Return the primitive scalar value of a value object. | |
static Scalar | createConstant (Scalar value) |
Given a scalar value, return an evaluation of a constant function. | |
static Scalar | createVariable (Scalar value, unsigned) |
Given a scalar value, return an evaluation of a linear function. | |
template<class LhsEval > | |
static LhsEval | decay (Scalar value) |
Given a function evaluation, constrain it to its value (if necessary). | |
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. |
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...
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.
static Scalar Opm::MathToolbox< ScalarT >::createConstant | ( | Scalar | value | ) | [inline, static] |
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.
static Scalar Opm::MathToolbox< ScalarT >::createVariable | ( | Scalar | value, | |
unsigned | ||||
) | [inline, static] |
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.
static LhsEval Opm::MathToolbox< ScalarT >::decay | ( | Scalar | value | ) | [inline, static] |
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.
static Scalar Opm::MathToolbox< ScalarT >::scalarValue | ( | Scalar | value | ) | [inline, static] |
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.
static Scalar Opm::MathToolbox< ScalarT >::value | ( | Scalar | value | ) | [inline, static] |
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.