Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange > Class Template Reference

#include <ECLPiecewiseLinearInterpolant.hpp>

Inheritance diagram for Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >:
Inheritance graph

Public Member Functions

 Linear (Extrapolation &&extrap)
 
template<class ElmIterator , class ValueTransform >
 Linear (Extrapolation &&extrap, ElmIterator xBegin, ElmIterator xEnd, std::vector< ElmIterator > &colIt, const ValueTransform &xTransform, const std::vector< ValueTransform > &colTransform)
 
LocalInterpPoint classifyPoint (const double x) const
 
double evaluate (const std::size_t col, const LocalInterpPoint &pt) const
 
const std::vector< double > & independentVariable () const
 Retrieve abscissas of interpolant's independent variate. More...
 
std::vector< double > resultVariable (const std::size_t col) const
 

Detailed Description

template<class Extrapolation, bool IsAscendingRange = true>
class Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >

Piecewise linear interpolation in set of result columns.

Template Parameters
ExtrapolationPolicy class for determining how to extrapolate results outside the range covered by the independent variate. Must support member functions left and right that extrapolate a tabulated function to the left and right of the input range, respectively. Typically a policy class from namespace ExtrapolationPolicy.
IsAscendingRangeFlag for whether or not the input range is sorted ascendingly or descendingly. Class Linear assumes that the input range is sorted, so if
IsAscendingRange = false
, this implies that the input range is treated as being sorted descendingly (i.e., as if by
std::sort(begin, end,
std::greater<>{})
not_this_one begin(...)
.

Constructor & Destructor Documentation

◆ Linear() [1/2]

template<class Extrapolation , bool IsAscendingRange = true>
Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >::Linear ( Extrapolation &&  extrap)
inlineexplicit

Constructor.

Essentially a hack. This creates an invalid interpolant and exists only to support creating an object backed by an empty range that will be subsequently discarded and not actually used. This, in turn, is useful in the construction of live oil/wet gas property interpolants that have padded tables.

Parameters
[in]extrapInstance of the configured extrapolation policy class.

◆ Linear() [2/2]

template<class Extrapolation , bool IsAscendingRange>
template<class ElmIterator , class ValueTransform >
Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >::Linear ( Extrapolation &&  extrap,
ElmIterator  xBegin,
ElmIterator  xEnd,
std::vector< ElmIterator > &  colIt,
const ValueTransform &  xTransform,
const std::vector< ValueTransform > &  colTransform 
)

Constructor.

Template Parameters
ElmIteratorIterator over the elements of an input range or a result column. Typically
std::vector<double>::const_iterator
.
ValueTransformRepresentation of a value transformation that, often, effects unit conversion of input tables. Assumed to implement a function call operator that supports the syntax
w = ValueTransform(v)
Parameters
[in]extrapInstance of the configured extrapolation policy class.
[in]xBeginStart of range of independent variate.
[in]xEndOne past the end of the range of indpendent variate.
[in,out]colItSequence of ranges of dependent variates. On input, points to beginning of ranges. On output, each range pointer is advanced across
std::distance(xBegin,
xEnd)
entries. This assumes that the underlying ranges are formatted according to ECL result set conventions (TAB vector from the INIT file).
[in]xTransformValue transformation for the independent variate. Called for each "valid" element of the input range.
[in]colTransformSequence of value transformations for the dependent variates. In particular,
colTransform[i]()
is invoked on the i-th dependent variate if and only if the corresponding element of the input range is "valid".

Member Function Documentation

◆ classifyPoint()

template<class Extrapolation , bool IsAscendingRange = true>
LocalInterpPoint Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >::classifyPoint ( const double  x) const
inline

Classify an input point according to the range of the interpolant's configured independent variate.

Classification is performed according to the configured policy for treating the sort order of the input range.

Parameters
[in]xInput point.
Returns
Classification of the input point x.

References exprtk::details::x().

◆ evaluate()

template<class Extrapolation , bool IsAscendingRange = true>
double Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >::evaluate ( const std::size_t  col,
const LocalInterpPoint &  pt 
) const
inline

Evaluate interpolant of particular dependent variable at particular input point.

Parameters
[in]colColumn ID of particular dependent variable.
[in]ptInput point. Result of previous call to member function
LocalInterpPoint classifyPoint(const double x) const
Definition: ECLPiecewiseLinearInterpolant.hpp:123
.
Returns
Value of dependent variable col at interpolation point pt.

◆ independentVariable()

template<class Extrapolation , bool IsAscendingRange = true>
const std::vector< double > & Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >::independentVariable ( ) const
inline

Retrieve abscissas of interpolant's independent variate.

Referenced by Opm::ECLPVT::extractRawPVTCurve().

◆ resultVariable()

template<class Extrapolation , bool IsAscendingRange = true>
std::vector< double > Opm::Interp1D::PiecewisePolynomial::Linear< Extrapolation, IsAscendingRange >::resultVariable ( const std::size_t  col) const
inline

Retrieve ordinates of one of the interpolant's dependent variates.

Parameters
[in]colColumn ID of particular dependent variable.
Returns
Ordinates corresponding to particular dependent variate, with the i-th element matching the i-th element of the independent variate.

Referenced by Opm::ECLPVT::extractRawPVTCurve().


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