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 minX, Scalar maxX, unsigned m, Scalar minY, Scalar maxY, unsigned n)
 Constructor where the tabulation parameters are already provided. More...
 
 UniformTabulated2DFunction (Scalar minX, Scalar maxX, unsigned m, Scalar minY, Scalar maxY, unsigned n, const std::vector< std::vector< Scalar > > &vals)
 
void resize (Scalar minX, Scalar maxX, unsigned m, Scalar minY, Scalar maxY, 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, bool extrapolate) 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...
 
bool operator== (const UniformTabulated2DFunction< Scalar > &data) const
 

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

◆ UniformTabulated2DFunction() [1/3]

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

◆ UniformTabulated2DFunction() [2/3]

template<class Scalar >
Opm::UniformTabulated2DFunction< Scalar >::UniformTabulated2DFunction ( Scalar  minX,
Scalar  maxX,
unsigned  m,
Scalar  minY,
Scalar  maxY,
unsigned  n 
)
inline

Constructor where the tabulation parameters are already provided.

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

◆ UniformTabulated2DFunction() [3/3]

template<class Scalar >
Opm::UniformTabulated2DFunction< Scalar >::UniformTabulated2DFunction ( Scalar  minX,
Scalar  maxX,
unsigned  m,
Scalar  minY,
Scalar  maxY,
unsigned  n,
const std::vector< std::vector< Scalar > > &  vals 
)
inline

Member Function Documentation

◆ applies()

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

◆ eval()

template<class Scalar >
template<class Evaluation >
Evaluation Opm::UniformTabulated2DFunction< Scalar >::eval ( const Evaluation &  x,
const Evaluation &  y,
bool  extrapolate 
) const
inline

◆ getSamplePoint()

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().

◆ iToX()

template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::iToX ( unsigned  i) const
inline

◆ jToY()

template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::jToY ( unsigned  j) const
inline

◆ numX()

template<class Scalar >
unsigned Opm::UniformTabulated2DFunction< Scalar >::numX ( ) const
inline

◆ numY()

template<class Scalar >
unsigned Opm::UniformTabulated2DFunction< Scalar >::numY ( ) const
inline

◆ operator==()

template<class Scalar >
bool Opm::UniformTabulated2DFunction< Scalar >::operator== ( const UniformTabulated2DFunction< Scalar > &  data) const
inline

◆ resize()

template<class Scalar >
void Opm::UniformTabulated2DFunction< Scalar >::resize ( Scalar  minX,
Scalar  maxX,
unsigned  m,
Scalar  minY,
Scalar  maxY,
unsigned  n 
)
inline

Resize the tabulation to a new range.

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

◆ setSamplePoint()

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.

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

◆ xMax()

template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::xMax ( ) const
inline

◆ xMin()

template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::xMin ( ) const
inline

◆ xToI()

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().

◆ yMax()

template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::yMax ( ) const
inline

◆ yMin()

template<class Scalar >
Scalar Opm::UniformTabulated2DFunction< Scalar >::yMin ( ) const
inline

◆ yToJ()

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: