Opm::UniformTabulated2DFunction< Scalar > Class Template Reference

Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y grid. More...

#include <UniformTabulated2DFunction.hpp>

Public Member Functions

 UniformTabulated2DFunction ()
 
 UniformTabulated2DFunction (Scalar xMin, Scalar xMax, unsigned m, Scalar yMin, Scalar yMax, unsigned n)
 Constructor where the tabulation parameters are already provided. More...
 
void resize (Scalar xMin, Scalar xMax, unsigned m, Scalar yMin, Scalar yMax, unsigned n)
 Resize the tabulation to a new range. More...
 
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 yMin () const
 Returns the minimum of the Y coordinate of the sampling points. More...
 
Scalar yMax () const
 Returns the maximum of the Y coordinate of the sampling points. More...
 
unsigned numX () const
 Returns the number of sampling points in X direction. More...
 
unsigned numY () const
 Returns the number of sampling points in Y direction. More...
 
Scalar iToX (unsigned i) const
 Return the position on the x-axis of the i-th interval. More...
 
Scalar jToY (unsigned j) const
 Return the position on the y-axis of the j-th interval. More...
 
template<class Evaluation >
Evaluation xToI (const Evaluation &x) const
 Return the interval index of a given position on the x-axis. More...
 
template<class Evaluation >
Evaluation yToJ (const Evaluation &y) const
 Return the interval index of a given position on the y-axis. More...
 
template<class Evaluation >
bool applies (const Evaluation &x, const Evaluation &y) const
 Returns true iff a coordinate lies in the tabulated range. More...
 
template<class Evaluation >
Evaluation eval (const Evaluation &x, const Evaluation &y) const
 Evaluate the function at a given (x,y) position. More...
 
Scalar getSamplePoint (unsigned i, unsigned j) const
 Get the value of the sample point which is at the intersection of the $i$-th interval of the x-Axis and the $j$-th of the y-Axis. More...
 
void setSamplePoint (unsigned i, unsigned j, Scalar value)
 Set the value of the sample point which is at the intersection of the $i$-th interval of the x-Axis and the $j$-th of the y-Axis. More...
 

Detailed Description

template<class Scalar>
class Opm::UniformTabulated2DFunction< Scalar >

Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y grid.

This class can be used when the sampling points are calculated at run time.

Constructor & Destructor Documentation

template<class Scalar >
Opm::UniformTabulated2DFunction< Scalar >::UniformTabulated2DFunction ( )
inline
template<class Scalar >
Opm::UniformTabulated2DFunction< Scalar >::UniformTabulated2DFunction ( Scalar  xMin,
Scalar  xMax,
unsigned  m,
Scalar  yMin,
Scalar  yMax,
unsigned  n 
)
inline

Constructor where the tabulation parameters are already provided.

References Opm::UniformTabulated2DFunction< Scalar >::resize().

Member Function Documentation

template<class Scalar >
template<class Evaluation >
bool Opm::UniformTabulated2DFunction< Scalar >::applies ( const Evaluation &  x,
const Evaluation &  y 
) const
inline
template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::getSamplePoint ( unsigned  i,
unsigned  j 
) const
inline

Get the value of the sample point which is at the intersection of the $i$-th interval of the x-Axis and the $j$-th of the y-Axis.

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

template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::iToX ( unsigned  i) const
inline
template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::jToY ( unsigned  j) const
inline
template<class Scalar >
unsigned Opm::UniformTabulated2DFunction< Scalar >::numX ( ) const
inline
template<class Scalar >
unsigned Opm::UniformTabulated2DFunction< Scalar >::numY ( ) const
inline
template<class Scalar >
void Opm::UniformTabulated2DFunction< Scalar >::resize ( Scalar  xMin,
Scalar  xMax,
unsigned  m,
Scalar  yMin,
Scalar  yMax,
unsigned  n 
)
inline
template<class Scalar >
void Opm::UniformTabulated2DFunction< Scalar >::setSamplePoint ( unsigned  i,
unsigned  j,
Scalar  value 
)
inline

Set the value of the sample point which is at the intersection of the $i$-th interval of the x-Axis and the $j$-th of the y-Axis.

template<class Scalar >
template<class Evaluation >
Evaluation Opm::UniformTabulated2DFunction< Scalar >::xToI ( const Evaluation &  x) 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::UniformTabulated2DFunction< Scalar >::numX(), Opm::UniformTabulated2DFunction< Scalar >::xMax(), and Opm::UniformTabulated2DFunction< Scalar >::xMin().

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

template<class Scalar >
template<class Evaluation >
Evaluation Opm::UniformTabulated2DFunction< Scalar >::yToJ ( const Evaluation &  y) 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::UniformTabulated2DFunction< Scalar >::numY(), Opm::UniformTabulated2DFunction< Scalar >::yMax(), and Opm::UniformTabulated2DFunction< Scalar >::yMin().

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


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