3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Member Functions | List of all members
Dumux::Tabulated2DFunction< Scalar > Class Template Reference

Implements tabulation for a two-dimensional function. More...

#include <dumux/common/tabulated2dfunction.hh>

Description

template<class Scalar>
class Dumux::Tabulated2DFunction< Scalar >

Implements tabulation for a two-dimensional function.

This class can be used to tabulate a two dimensional function \(f(x, y)\) over the range \([x_{min}, x_{max}] \times [y_{min}, y_{max}]\). For this, the ranges of the \(x\) and \(y\) axes are divided into \(m\) and \(n\) sub-intervals and the values of \(f(x_i, y_j)\) need to be provided. Here, \(x_i\) and \(y_j\) are the largest positions of the \(i\)-th and \(j\)-th intervall. Between these sampling points this tabulation class uses linear interpolation.

Public Member Functions

 Tabulated2DFunction ()
 Default constructor. More...
 
 Tabulated2DFunction (Scalar xMin, Scalar xMax, int m, Scalar yMin, Scalar yMax, int n)
 Constructor where the tabulation parameters are already provided. More...
 
void resize (Scalar xMin, Scalar xMax, int m, Scalar yMin, Scalar yMax, int n)
 Resize the tabulation to a new range. More...
 
Scalar iToX (int i) const
 Return the position on the x-axis of the i-th interval. More...
 
Scalar jToY (int j) const
 Return the position on the y-axis of the j-th interval. More...
 
Scalar xToI (Scalar x) const
 Return the interval index of a given position on the x-axis. More...
 
Scalar yToJ (Scalar y) const
 Return the interval index of a given position on the y-axis. More...
 
Scalar getSamplePoint (int i, int 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 (int i, int 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...
 
Scalar get (Scalar x, Scalar y) const
 Return an interpolated value. More...
 
Scalar operator() (Scalar x, Scalar y) const
 The () operator. More...
 

Constructor & Destructor Documentation

◆ Tabulated2DFunction() [1/2]

template<class Scalar >
Dumux::Tabulated2DFunction< Scalar >::Tabulated2DFunction ( )
inline

Default constructor.

◆ Tabulated2DFunction() [2/2]

template<class Scalar >
Dumux::Tabulated2DFunction< Scalar >::Tabulated2DFunction ( Scalar  xMin,
Scalar  xMax,
int  m,
Scalar  yMin,
Scalar  yMax,
int  n 
)
inline

Constructor where the tabulation parameters are already provided.

Member Function Documentation

◆ get()

template<class Scalar >
Scalar Dumux::Tabulated2DFunction< Scalar >::get ( Scalar  x,
Scalar  y 
) const
inline

Return an interpolated value.

◆ getSamplePoint()

template<class Scalar >
Scalar Dumux::Tabulated2DFunction< Scalar >::getSamplePoint ( int  i,
int  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.

◆ iToX()

template<class Scalar >
Scalar Dumux::Tabulated2DFunction< Scalar >::iToX ( int  i) const
inline

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

◆ jToY()

template<class Scalar >
Scalar Dumux::Tabulated2DFunction< Scalar >::jToY ( int  j) const
inline

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

◆ operator()()

template<class Scalar >
Scalar Dumux::Tabulated2DFunction< Scalar >::operator() ( Scalar  x,
Scalar  y 
) const
inline

The () operator.

This is just a convenience alias for get(x,y);

◆ resize()

template<class Scalar >
void Dumux::Tabulated2DFunction< Scalar >::resize ( Scalar  xMin,
Scalar  xMax,
int  m,
Scalar  yMin,
Scalar  yMax,
int  n 
)
inline

Resize the tabulation to a new range.

Note
All previously specified sampling points become invalid after calling this method. You have to supply new ones.

◆ setSamplePoint()

template<class Scalar >
void Dumux::Tabulated2DFunction< Scalar >::setSamplePoint ( int  i,
int  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.

◆ xToI()

template<class Scalar >
Scalar Dumux::Tabulated2DFunction< Scalar >::xToI ( Scalar  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 intervall, the decimal places are the position of the x value between the i-th and the (i+1)-th sample point.

◆ yToJ()

template<class Scalar >
Scalar Dumux::Tabulated2DFunction< Scalar >::yToJ ( Scalar  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 intervall, the decimal places are the position of the y value between the j-th and the (j+1)-th sample point.


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