Opm::UniformXTabulated2DFunction< Scalar > Class Template Reference

Implements a scalar function that depends on two variables and which is sampled uniformly in the X direction, but non-uniformly on the Y axis-. More...

#include <UniformXTabulated2DFunction.hpp>

Public Member Functions

 UniformXTabulated2DFunction ()
 
Scalar xMin () const
 Returns the minimum of the X coordinate of the sampling points. More...
 
Scalar xMax () const
 Returns the maximum of the X coordinate of the sampling points. More...
 
Scalar xAt (size_t i) const
 Returns the value of the X coordinate of the sampling points. More...
 
Scalar yAt (size_t i, size_t j) const
 Returns the value of the Y coordinate of a sampling point. More...
 
Scalar valueAt (size_t i, size_t j) const
 Returns the value of a sampling point. More...
 
size_t numX () const
 Returns the number of sampling points in X direction. More...
 
Scalar yMin (size_t i) const
 Returns the minimum of the Y coordinate of the sampling points for a given column. More...
 
Scalar yMax (size_t i) const
 Returns the maximum of the Y coordinate of the sampling points for a given column. More...
 
size_t numY (size_t i) const
 Returns the number of sampling points in Y direction a given column. More...
 
Scalar iToX (size_t i) const
 Return the position on the x-axis of the i-th interval. More...
 
Scalar jToY (size_t i, size_t j) const
 Return the position on the y-axis of the j-th interval. More...
 
Scalar xToI (Scalar x, OPM_OPTIM_UNUSED bool extrapolate=false) const
 Return the interval index of a given position on the x-axis. More...
 
Scalar yToJ (size_t i, Scalar y, OPM_OPTIM_UNUSED bool extrapolate=false) const
 Return the interval index of a given position on the y-axis. More...
 
bool applies (Scalar x, Scalar y) const
 Returns true iff a coordinate lies in the tabulated range. More...
 
Scalar eval (Scalar x, Scalar y, bool extrapolate=true) const
 Evaluate the function at a given (x,y) position. More...
 
template<class Evaluation >
Evaluation eval (const Evaluation &x, const Evaluation &y, bool extrapolate=false) const
 Evaluate the function at a given (x,y) position. More...
 
size_t appendXPos (Scalar nextX)
 Set the x-position of a vertical line. More...
 
size_t appendSamplePoint (size_t i, Scalar y, Scalar value)
 Append a sample point. More...
 
void print (std::ostream &os=std::cout) const
 Print the table for debugging purposes. More...
 

Detailed Description

template<class Scalar>
class Opm::UniformXTabulated2DFunction< Scalar >

Implements a scalar function that depends on two variables and which is sampled uniformly in the X direction, but non-uniformly on the Y axis-.

"Uniform on the X-axis" means that all Y sampling points must be located along a line for this value. This class can be used when the sampling points are calculated at run time.

Constructor & Destructor Documentation

template<class Scalar >
Opm::UniformXTabulated2DFunction< Scalar >::UniformXTabulated2DFunction ( )
inline

Member Function Documentation

template<class Scalar >
size_t Opm::UniformXTabulated2DFunction< Scalar >::appendSamplePoint ( size_t  i,
Scalar  y,
Scalar  value 
)
inline

Append a sample point.

Returns the i index of that line.

References Opm::UniformXTabulated2DFunction< Scalar >::iToX(), and Opm::UniformXTabulated2DFunction< Scalar >::numX().

template<class Scalar >
size_t Opm::UniformXTabulated2DFunction< Scalar >::appendXPos ( Scalar  nextX)
inline

Set the x-position of a vertical line.

Returns the i index of that line.

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::eval ( Scalar  x,
Scalar  y,
bool  extrapolate = true 
) const
inline
template<class Scalar >
template<class Evaluation >
Evaluation Opm::UniformXTabulated2DFunction< Scalar >::eval ( const Evaluation &  x,
const Evaluation &  y,
bool  extrapolate = false 
) const
inline
template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::iToX ( size_t  i) const
inline

Return the position on the x-axis of the i-th interval.

References Opm::UniformXTabulated2DFunction< Scalar >::numX().

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::appendSamplePoint().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::jToY ( size_t  i,
size_t  j 
) const
inline

Return the position on the y-axis of the j-th interval.

References Opm::UniformXTabulated2DFunction< Scalar >::numX().

template<class Scalar >
size_t Opm::UniformXTabulated2DFunction< Scalar >::numY ( size_t  i) const
inline

Returns the number of sampling points in Y direction a given column.

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::eval(), and Opm::UniformXTabulated2DFunction< Scalar >::print().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::valueAt ( size_t  i,
size_t  j 
) const
inline

Returns the value of a sampling point.

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::eval().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::xAt ( size_t  i) const
inline

Returns the value of the X coordinate of the sampling points.

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::eval().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::xMax ( ) const
inline
template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::xMin ( ) const
inline
template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::xToI ( Scalar  x,
OPM_OPTIM_UNUSED bool  extrapolate = false 
) const
inline

Return the interval index of a given position on the x-axis.

This method returns a floating point number. The integer part should be interpreted as interval, the decimal places are the position of the x value between the i-th and the (i+1)-th sample point.

References Opm::UniformXTabulated2DFunction< Scalar >::xMax(), and Opm::UniformXTabulated2DFunction< Scalar >::xMin().

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::applies(), and Opm::UniformXTabulated2DFunction< Scalar >::eval().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::yAt ( size_t  i,
size_t  j 
) const
inline

Returns the value of the Y coordinate of a sampling point.

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::eval().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::yMax ( size_t  i) const
inline

Returns the maximum of the Y coordinate of the sampling points for a given column.

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::applies(), Opm::UniformXTabulated2DFunction< Scalar >::print(), and Opm::UniformXTabulated2DFunction< Scalar >::yToJ().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::yMin ( size_t  i) const
inline

Returns the minimum of the Y coordinate of the sampling points for a given column.

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::applies(), Opm::UniformXTabulated2DFunction< Scalar >::print(), and Opm::UniformXTabulated2DFunction< Scalar >::yToJ().

template<class Scalar >
Scalar Opm::UniformXTabulated2DFunction< Scalar >::yToJ ( size_t  i,
Scalar  y,
OPM_OPTIM_UNUSED bool  extrapolate = false 
) const
inline

Return the interval index of a given position on the y-axis.

This method returns a floating point number. The integer part should be interpreted as interval, the decimal places are the position of the y value between the j-th and the (j+1)-th sample point.

References Opm::UniformXTabulated2DFunction< Scalar >::numX(), Opm::UniformXTabulated2DFunction< Scalar >::yMax(), and Opm::UniformXTabulated2DFunction< Scalar >::yMin().

Referenced by Opm::UniformXTabulated2DFunction< Scalar >::eval().


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