Classes |
Public Types |
Public Member Functions |
Protected Member Functions |
Protected Attributes |
List of all members
Opm::Spline< Scalar > Class Template Reference Class implementing cubic splines. More...
Detailed Descriptiontemplate<class Scalar>
|
enum Opm::Spline::SplineType |
The type of the spline to be created.
To specfiy the acutal curve, use one of the set() methods.
Enumerator | |
---|---|
Full | |
Natural | |
Periodic | |
Monotonic |
|
inline |
Default constructor for a spline.
To specfiy the acutal curve, use one of the set() methods.
|
inline |
Convenience constructor for a full spline with just two sampling points.
x0 | The value of the first sampling point |
x1 | The value of the second sampling point |
y0 | The value of the first sampling point |
y1 | The value of the second sampling point |
m0 | The slope of the spline at |
m1 | The slope of the spline at |
References Opm::Spline< Scalar >::set().
|
inline |
Convenience constructor for a natural or a periodic spline.
nSamples | The number of sampling points (must be > 2) |
x | An array containing the values of the spline's sampling points |
y | An array containing the values of the spline's sampling points |
periodic | Indicates whether a natural or a periodic spline should be created |
References Opm::Spline< Scalar >::setXYArrays().
|
inline |
Convenience constructor for a natural or a periodic spline.
nSamples | The number of sampling points (must be > 2) |
points | An array of tuples of the spline's sampling points |
periodic | Indicates whether a natural or a periodic spline should be created |
References Opm::Spline< Scalar >::setArrayOfPoints().
|
inline |
Convenience constructor for a natural or a periodic spline.
x | An array containing the values of the spline's sampling points (must have a size() method) |
y | An array containing the values of the spline's sampling points (must have a size() method) |
periodic | Indicates whether a natural or a periodic spline should be created |
References Opm::Spline< Scalar >::setXYContainers().
|
inline |
Convenience constructor for a natural or a periodic spline.
points | An array of tuples of the spline's sampling points (must have a size() method) |
periodic | Indicates whether a natural or a periodic spline should be created |
References Opm::Spline< Scalar >::setContainerOfPoints().
|
inline |
Convenience constructor for a full spline.
nSamples | The number of sampling points (must be >= 2) |
x | An array containing the values of the spline's sampling points |
y | An array containing the values of the spline's sampling points |
m0 | The slope of the spline at |
m1 | The slope of the spline at |
sortInputs | Indicates whether the sample points should be sorted (this is not necessary if they are already sorted in ascending or descending order) |
References Opm::Spline< Scalar >::setXYArrays().
|
inline |
Convenience constructor for a full spline.
nSamples | The number of sampling points (must be >= 2) |
points | An array containing the and values of the spline's sampling points |
m0 | The slope of the spline at |
m1 | The slope of the spline at |
sortInputs | Indicates whether the sample points should be sorted (this is not necessary if they are already sorted in ascending or descending order) |
References Opm::Spline< Scalar >::setArrayOfPoints().
|
inline |
Convenience constructor for a full spline.
x | An array containing the values of the spline's sampling points (must have a size() method) |
y | An array containing the values of the spline's sampling points (must have a size() method) |
m0 | The slope of the spline at |
m1 | The slope of the spline at |
sortInputs | Indicates whether the sample points should be sorted (this is not necessary if they are already sorted in ascending or descending order) |
References Opm::Spline< Scalar >::setXYContainers().
|
inline |
Convenience constructor for a full spline.
points | An array of tuples of the spline's sampling points (must have a size() method) |
m0 | The slope of the spline at |
m1 | The slope of the spline at |
sortInputs | Indicates whether the sample points should be sorted (this is not necessary if they are already sorted in ascending or descending order) |
References Opm::Spline< Scalar >::setContainerOfPoints().
|
inlineprotected |
References Opm::Spline< Scalar >::evalDerivative3_().
Referenced by Opm::Spline< Scalar >::intersectSegment_(), and Opm::Spline< Scalar >::monotonic_().
|
inline |
Return true iff the given x is in range [x1, xn].
References Opm::Spline< Scalar >::numSamples(), and Opm::Spline< Scalar >::x_().
Referenced by Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::evalDerivative(), Opm::Spline< Scalar >::evalSecondDerivative(), Opm::Spline< Scalar >::evalThirdDerivative(), Opm::Spline< Scalar >::intersectInterval(), and Opm::Spline< Scalar >::printCSV().
|
inlineprotected |
|
inlineprotected |
Set the sampling points.
Here we assume that the elements of the source vector have an [] operator where v[0] is the x value and v[1] is the y value if the sampling point.
|
inlineprotected |
Set the sampling point vectors.
This takes care that the order of the x-values is ascending, although the input must be ordered already!
References Opm::Spline< Scalar >::numSamples().
|
inlineprotected |
References Opm::Spline< Scalar >::evalDerivative2_().
Referenced by Opm::Spline< Scalar >::intersectSegment_(), and Opm::Spline< Scalar >::monotonic_().
|
inlineprotected |
References Opm::Spline< Scalar >::evalDerivative_().
Referenced by Opm::Spline< Scalar >::intersectSegment_(), and Opm::Spline< Scalar >::monotonic_().
|
inlineprotected |
References Opm::Spline< Scalar >::eval_().
Referenced by Opm::Spline< Scalar >::intersectSegment_().
|
inline |
Evaluate the spline at a given position.
x | The value on the abscissa where the spline ought to be evaluated |
extrapolate | If this parameter is set to true, the spline will be extended beyond its range by straight lines, if false calling extrapolate for will cause a failed assertation. |
References Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::eval_(), Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::segmentIdx_(), Opm::Spline< Scalar >::xMax(), Opm::Spline< Scalar >::xMin(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::printCSV(), Opm::Somerton< FluidSystem, ScalarT, ParamsT >::regularizedSqrt_(), Opm::WetGasPvt< Scalar >::setSaturatedGasFormationVolumeFactor(), Opm::WetGasPvt< Scalar >::setSaturatedGasViscosity(), Opm::LiveOilPvt< Scalar >::setSaturatedOilFormationVolumeFactor(), and Opm::LiveOilPvt< Scalar >::setSaturatedOilViscosity().
|
inline |
Evaluate the spline for a given function evaluation.
x | The value on the abscissa where the spline ought to be evaluated |
extrapolate | If this parameter is set to true, the spline will be extended beyond its range by straight lines, if false calling extrapolate for will cause a failed assertation. |
References Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::eval_(), Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::segmentIdx_(), Opm::Spline< Scalar >::xMax(), Opm::Spline< Scalar >::xMin(), and Opm::Spline< Scalar >::y_().
|
inlineprotected |
References Opm::Spline< Scalar >::h00_(), Opm::Spline< Scalar >::h01_(), Opm::Spline< Scalar >::h10_(), Opm::Spline< Scalar >::h11_(), Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::slope_(), Opm::Spline< Scalar >::x_(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::d_(), and Opm::Spline< Scalar >::eval().
|
inlineprotected |
References Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::h00_(), Opm::Spline< Scalar >::h01_(), Opm::Spline< Scalar >::h10_(), Opm::Spline< Scalar >::h11_(), Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::slope_(), Opm::Spline< Scalar >::x_(), and Opm::Spline< Scalar >::y_().
|
inline |
Evaluate the spline's derivative at a given position.
x | The value on the abscissa where the spline's derivative ought to be evaluated |
extrapolate | If this parameter is set to true, the spline will be extended beyond its range by straight lines, if false calling extrapolate for will cause a failed assertation. |
References Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::segmentIdx_(), Opm::Spline< Scalar >::xMax(), and Opm::Spline< Scalar >::xMin().
Referenced by Opm::Spline< Scalar >::printCSV().
|
inlineprotected |
References Opm::Spline< Scalar >::h00_prime2_(), Opm::Spline< Scalar >::h01_prime2_(), Opm::Spline< Scalar >::h10_prime2_(), Opm::Spline< Scalar >::h11_prime2_(), Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::slope_(), Opm::Spline< Scalar >::x_(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::b_(), and Opm::Spline< Scalar >::evalSecondDerivative().
|
inlineprotected |
References Opm::Spline< Scalar >::h00_prime3_(), Opm::Spline< Scalar >::h01_prime3_(), Opm::Spline< Scalar >::h10_prime3_(), Opm::Spline< Scalar >::h11_prime3_(), Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::slope_(), Opm::Spline< Scalar >::x_(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::a_(), and Opm::Spline< Scalar >::evalThirdDerivative().
|
inlineprotected |
References Opm::Spline< Scalar >::h00_prime_(), Opm::Spline< Scalar >::h01_prime_(), Opm::Spline< Scalar >::h10_prime_(), Opm::Spline< Scalar >::h11_prime_(), Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::slope_(), Opm::Spline< Scalar >::x_(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::c_(), Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::eval_(), Opm::Spline< Scalar >::evalDerivative(), and Opm::Spline< Scalar >::monotonic().
|
inline |
Evaluate the spline's second derivative at a given position.
x | The value on the abscissa where the spline's derivative ought to be evaluated |
extrapolate | If this parameter is set to true, the spline will be extended beyond its range by straight lines, if false calling extrapolate for will cause a failed assertation. |
References Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::evalDerivative2_(), and Opm::Spline< Scalar >::segmentIdx_().
|
inline |
Evaluate the spline's third derivative at a given position.
x | The value on the abscissa where the spline's derivative ought to be evaluated |
extrapolate | If this parameter is set to true, the spline will be extended beyond its range by straight lines, if false calling extrapolate for will cause a failed assertation. |
References Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::evalDerivative3_(), and Opm::Spline< Scalar >::segmentIdx_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::eval_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative2_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative3_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::eval_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative2_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative3_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::eval_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative2_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative3_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::eval_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative2_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative3_().
|
inlineprotected |
Referenced by Opm::Spline< Scalar >::evalDerivative_().
|
inlineprotected |
Returns x[i] - x[i - 1].
References Opm::Spline< Scalar >::x_().
Referenced by Opm::Spline< Scalar >::eval_(), Opm::Spline< Scalar >::evalDerivative2_(), Opm::Spline< Scalar >::evalDerivative3_(), Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::makeFullSystem_(), Opm::Spline< Scalar >::makeNaturalSystem_(), Opm::Spline< Scalar >::makePeriodicSystem_(), and Opm::Spline< Scalar >::setSlopesFromMoments_().
|
inline |
Find the intersections of the spline with a cubic polynomial in the whole interval, throws Opm::MathError exception if there is more or less than one solution.
References Opm::Spline< Scalar >::intersectInterval(), Opm::Spline< Scalar >::xMax(), and Opm::Spline< Scalar >::xMin().
|
inline |
Find the intersections of the spline with a cubic polynomial in a sub-interval of the spline, throws Opm::MathError exception if there is more or less than one solution.
References Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::intersectSegment_(), and Opm::Spline< Scalar >::segmentIdx_().
Referenced by Opm::Spline< Scalar >::intersect().
|
inlineprotected |
Find all the intersections of a segment of the spline with a cubic polynomial within a specified interval.
References Opm::Spline< Scalar >::a_(), Opm::Spline< Scalar >::b_(), Opm::Spline< Scalar >::c_(), Opm::Spline< Scalar >::d_(), Opm::invertCubicPolynomial(), Opm::LocalAd::max(), Opm::LocalAd::min(), and Opm::Spline< Scalar >::x_().
Referenced by Opm::Spline< Scalar >::intersectInterval().
|
inlineprotected |
Create a natural spline from the already set sampling points.
This creates a temporary matrix and right hand side vector.
References Opm::Spline< Scalar >::makeFullSystem_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::setSlopesFromMoments_(), Opm::Spline< Scalar >::slopeVec_, and Opm::TridiagonalMatrix< Scalar >::solve().
Referenced by Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setXYArrays(), and Opm::Spline< Scalar >::setXYContainers().
|
inlineprotected |
Make the linear system of equations Mx = d which results in the moments of the full spline.
References Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::makeNaturalSystem_(), Opm::Spline< Scalar >::numSamples(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::makeFullSpline_(), and Opm::Spline< Scalar >::set().
|
inlineprotected |
Create a monotonic spline from the already set sampling points.
This code is inspired by opm-core's "MonotCubicInterpolator" class and also uses the approach by Fritsch and Carlson, see
http://en.wikipedia.org/wiki/Monotone_cubic_interpolation
References Opm::LocalAd::abs(), Opm::Spline< Scalar >::numSamples(), Opm::LocalAd::sqrt(), Opm::Spline< Scalar >::x_(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setXYArrays(), and Opm::Spline< Scalar >::setXYContainers().
|
inlineprotected |
Create a natural spline from the already set sampling points.
This creates a temporary matrix and right hand side vector.
References Opm::Spline< Scalar >::makeNaturalSystem_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::setSlopesFromMoments_(), Opm::Spline< Scalar >::slopeVec_, and Opm::TridiagonalMatrix< Scalar >::solve().
Referenced by Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setXYArrays(), and Opm::Spline< Scalar >::setXYContainers().
|
inlineprotected |
Make the linear system of equations Mx = d which results in the moments of the natural spline.
References Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::numSamples(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::makeFullSystem_(), and Opm::Spline< Scalar >::makeNaturalSpline_().
|
inlineprotected |
Create a periodic spline from the already set sampling points.
This creates a temporary matrix and right hand side vector.
References Opm::Spline< Scalar >::makePeriodicSystem_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::setSlopesFromMoments_(), Opm::Spline< Scalar >::slopeVec_, and Opm::TridiagonalMatrix< Scalar >::solve().
Referenced by Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setXYArrays(), and Opm::Spline< Scalar >::setXYContainers().
|
inlineprotected |
Make the linear system of equations Mx = d which results in the moments of the periodic spline.
References Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::numSamples(), Opm::TridiagonalMatrix< Scalar >::rows(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::makePeriodicSpline_().
|
inline |
Returns 1 if the spline is monotonically increasing, -1 if the spline is mononously decreasing and 0 if the spline is not monotonous in the interval (x0, x1).
In the corner case that the spline is constant within the given interval, this method returns 3.
References Opm::LocalAd::abs(), Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::monotonic_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::segmentIdx_(), Opm::Spline< Scalar >::x_(), Opm::Spline< Scalar >::xMax(), and Opm::Spline< Scalar >::xMin().
|
inline |
Same as monotonic(x0, x1), but with the entire range of the spline as interval.
References Opm::Spline< Scalar >::xMax(), and Opm::Spline< Scalar >::xMin().
Referenced by Opm::Spline< Scalar >::printCSV().
|
inlineprotected |
References Opm::Spline< Scalar >::a_(), Opm::LocalAd::abs(), Opm::Spline< Scalar >::b_(), Opm::Spline< Scalar >::c_(), and Opm::LocalAd::sqrt().
Referenced by Opm::Spline< Scalar >::monotonic().
|
inline |
Returns the number of sampling points.
References Opm::Spline< Scalar >::xPos_.
Referenced by Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::assignSamplingPoints_(), Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::evalDerivative(), Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::makeFullSystem_(), Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makeNaturalSystem_(), Opm::Spline< Scalar >::makePeriodicSpline_(), Opm::Spline< Scalar >::makePeriodicSystem_(), Opm::Spline< Scalar >::monotonic(), Opm::Spline< Scalar >::printCSV(), Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::segmentIdx_(), Opm::Spline< Scalar >::set(), Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setSlopesFromMoments_(), Opm::Spline< Scalar >::setXYArrays(), Opm::Spline< Scalar >::setXYContainers(), Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xMax(), and Opm::Spline< Scalar >::yLast().
|
inline |
Prints k tuples of the format (x, y, dx/dy, isMonotonic) to stdout.
If the spline does not apply for parts of [x0, x1] it is extrapolated using a straight line. The result can be inspected using the following commands:
--------— snip --------— ./yourProgramm > spline.csv gnuplot
gnuplot> plot "spline.csv" using 1:2 w l ti "Curve", \ "spline.csv" using 1:3 w l ti "Derivative", \ "spline.csv" using 1:4 w p ti "Monotonic" --------— snap --------—
References Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::evalDerivative(), Opm::LocalAd::max(), Opm::LocalAd::min(), Opm::Spline< Scalar >::monotonic(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::x_(), and Opm::Spline< Scalar >::y_().
|
inlineprotected |
Reverse order of the elements in the arrays which contain the sampling points.
References Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setXYArrays(), and Opm::Spline< Scalar >::setXYContainers().
|
inlineprotected |
References Opm::Spline< Scalar >::numSamples(), and Opm::Spline< Scalar >::x_().
Referenced by Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::evalDerivative(), Opm::Spline< Scalar >::evalSecondDerivative(), Opm::Spline< Scalar >::evalThirdDerivative(), Opm::Spline< Scalar >::intersectInterval(), and Opm::Spline< Scalar >::monotonic().
|
inline |
Set the sampling points and the boundary slopes of the spline with two sampling points.
x0 | The value of the first sampling point |
x1 | The value of the second sampling point |
y0 | The value of the first sampling point |
y1 | The value of the second sampling point |
m0 | The slope of the spline at |
m1 | The slope of the spline at |
References Opm::Spline< Scalar >::makeFullSystem_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::setSlopesFromMoments_(), Opm::Spline< Scalar >::slopeVec_, Opm::TridiagonalMatrix< Scalar >::solve(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::Spline().
|
inline |
Set the sampling points and the boundary slopes of a full spline using a C-style array.
This method uses a single array of sampling points, which are seen as an array-like object which provides access to the X and Y coordinates. In this context 'array-like' means that an access to the members is provided via the [] operator. (e.g. C arrays, std::vector, std::array, etc.) The array containing the sampling points must be of size 'nSamples' at least. Also, the number of sampling points must be larger than 1.
References Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::Spline().
|
inline |
Set the sampling points of a natural spline using a C-style array.
This method uses a single array of sampling points, which are seen as an array-like object which provides access to the X and Y coordinates. In this context 'array-like' means that an access to the members is provided via the [] operator. (e.g. C arrays, std::vector, std::array, etc.) The array containing the sampling points must be of size 'nSamples' at least. Also, the number of sampling points must be larger than 1.
References Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makePeriodicSpline_(), Opm::Spline< Scalar >::Monotonic, Opm::Spline< Scalar >::Natural, Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::Periodic, Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::slopeVec_, Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
|
inline |
Set the sampling points and the boundary slopes of a full spline using a STL-compatible container of array-like objects.
This method uses a single STL-compatible container of sampling points, which are assumed to be array-like objects storing the X and Y coordinates. "STL-compatible" means that the container provides access to iterators using the begin(), end() methods and also provides a size() method. Also, the number of entries in the X and the Y containers must be equal and larger than 1.
References Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::Spline().
|
inline |
Set the sampling points of a natural spline using a STL-compatible container of array-like objects.
This method uses a single STL-compatible container of sampling points, which are assumed to be array-like objects storing the X and Y coordinates. "STL-compatible" means that the container provides access to iterators using the begin(), end() methods and also provides a size() method. Also, the number of entries in the X and the Y containers must be equal and larger than 1.
References Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makePeriodicSpline_(), Opm::Spline< Scalar >::Monotonic, Opm::Spline< Scalar >::Natural, Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::Periodic, Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::slopeVec_, Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
|
inline |
Set the sampling points and the boundary slopes of a full spline using a STL-compatible container of tuple-like objects.
This method uses a single STL-compatible container of sampling points, which are assumed to be tuple-like objects storing the X and Y coordinates. "tuple-like" means that the objects provide access to the x values via std::get<0>(obj) and to the y value via std::get<1>(obj) (e.g. std::tuple or std::pair). "STL-compatible" means that the container provides access to iterators using the begin(), end() methods and also provides a size() method. Also, the number of entries in the X and the Y containers must be equal and larger than 1.
References Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::WetGasPvt< Scalar >::setSaturatedGasFormationVolumeFactor(), Opm::WetGasPvt< Scalar >::setSaturatedGasViscosity(), Opm::LiveOilPvt< Scalar >::setSaturatedOilFormationVolumeFactor(), and Opm::LiveOilPvt< Scalar >::setSaturatedOilViscosity().
|
inline |
Set the sampling points of a natural spline using a STL-compatible container of tuple-like objects.
This method uses a single STL-compatible container of sampling points, which are assumed to be tuple-like objects storing the X and Y coordinates. "tuple-like" means that the objects provide access to the x values via std::get<0>(obj) and to the y value via std::get<1>(obj) (e.g. std::tuple or std::pair). "STL-compatible" means that the container provides access to iterators using the begin(), end() methods and also provides a size() method. Also, the number of entries in the X and the Y containers must be equal and larger than 1.
References Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makePeriodicSpline_(), Opm::Spline< Scalar >::Monotonic, Opm::Spline< Scalar >::Natural, Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::Periodic, Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::slopeVec_, Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
|
inlineprotected |
Resizes the internal vectors to store the sample points.
References Opm::Spline< Scalar >::slopeVec_, Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setXYArrays(), and Opm::Spline< Scalar >::setXYContainers().
|
inlineprotected |
Convert the moments at the sample points to slopes.
This requires to use cubic Hermite interpolation, but it is required because for monotonic splines the second derivative is not continuous.
References Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::numSamples(), and Opm::Spline< Scalar >::y_().
Referenced by Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makePeriodicSpline_(), and Opm::Spline< Scalar >::set().
|
inline |
Set the sampling points and the boundary slopes of a full spline using C-style arrays.
This method uses separate array-like objects for the values of the X and Y coordinates. In this context 'array-like' means that an access to the members is provided via the [] operator. (e.g. C arrays, std::vector, std::array, etc.) Each array must be of size 'nSamples' at least. Also, the number of sampling points must be larger than 1.
References Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::Spline().
|
inline |
Set the sampling points natural spline using C-style arrays.
This method uses separate array-like objects for the values of the X and Y coordinates. In this context 'array-like' means that an access to the members is provided via the [] operator. (e.g. C arrays, std::vector, std::array, etc.) Each array must be of size 'nSamples' at least. Also, the number of sampling points must be larger than 1.
References Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makePeriodicSpline_(), Opm::Spline< Scalar >::Monotonic, Opm::Spline< Scalar >::Natural, Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::Periodic, Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::slopeVec_, Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
|
inline |
Set the sampling points and the boundary slopes of a full spline using STL-compatible containers.
This method uses separate STL-compatible containers for the values of the sampling points' X and Y coordinates. "STL-compatible" means that the container provides access to iterators using the begin(), end() methods and also provides a size() method. Also, the number of entries in the X and the Y containers must be equal and larger than 1.
References Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::SplineTwoPhaseMaterialParams< TraitsT >::setKrnSamples(), Opm::SplineTwoPhaseMaterialParams< TraitsT >::setKrwSamples(), Opm::SplineTwoPhaseMaterialParams< TraitsT >::setPcnwSamples(), and Opm::Spline< Scalar >::Spline().
|
inline |
Set the sampling points of a natural spline using STL-compatible containers.
This method uses separate STL-compatible containers for the values of the sampling points' X and Y coordinates. "STL-compatible" means that the container provides access to iterators using the begin(), end() methods and also provides a size() method. Also, the number of entries in the X and the Y containers must be equal and larger than 1.
References Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makePeriodicSpline_(), Opm::Spline< Scalar >::Monotonic, Opm::Spline< Scalar >::Natural, Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::Periodic, Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::slopeVec_, Opm::Spline< Scalar >::sortInput_(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
|
inlineprotected |
Returns the slope (i.e. first derivative) of the spline at the i-th sampling point.
References Opm::Spline< Scalar >::slopeVec_.
Referenced by Opm::Spline< Scalar >::eval_(), Opm::Spline< Scalar >::evalDerivative2_(), Opm::Spline< Scalar >::evalDerivative3_(), and Opm::Spline< Scalar >::evalDerivative_().
|
inlineprotected |
Sort the sample points in ascending order of their x value.
References Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::xPos_, and Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setXYArrays(), and Opm::Spline< Scalar >::setXYContainers().
|
inlineprotected |
Returns the y coordinate of the i-th sampling point.
References Opm::Spline< Scalar >::xPos_.
Referenced by Opm::Spline< Scalar >::applies(), Opm::Spline< Scalar >::eval_(), Opm::Spline< Scalar >::evalDerivative2_(), Opm::Spline< Scalar >::evalDerivative3_(), Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::h_(), Opm::Spline< Scalar >::intersectSegment_(), Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::monotonic(), Opm::Spline< Scalar >::printCSV(), Opm::Spline< Scalar >::segmentIdx_(), Opm::Spline< Scalar >::xMax(), and Opm::Spline< Scalar >::xMin().
|
inline |
Return the x value of the rightmost sampling point.
References Opm::Spline< Scalar >::numSamples(), and Opm::Spline< Scalar >::x_().
Referenced by Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::evalDerivative(), Opm::Spline< Scalar >::intersect(), and Opm::Spline< Scalar >::monotonic().
|
inline |
Return the x value of the leftmost sampling point.
References Opm::Spline< Scalar >::x_().
Referenced by Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::evalDerivative(), Opm::Spline< Scalar >::intersect(), and Opm::Spline< Scalar >::monotonic().
|
inlineprotected |
Returns the y coordinate of the i-th sampling point.
References Opm::Spline< Scalar >::yPos_.
Referenced by Opm::Spline< Scalar >::eval(), Opm::Spline< Scalar >::eval_(), Opm::Spline< Scalar >::evalDerivative2_(), Opm::Spline< Scalar >::evalDerivative3_(), Opm::Spline< Scalar >::evalDerivative_(), Opm::Spline< Scalar >::makeFullSystem_(), Opm::Spline< Scalar >::makeMonotonicSpline_(), Opm::Spline< Scalar >::makeNaturalSystem_(), Opm::Spline< Scalar >::makePeriodicSystem_(), Opm::Spline< Scalar >::printCSV(), Opm::Spline< Scalar >::setSlopesFromMoments_(), Opm::Spline< Scalar >::yFirst(), and Opm::Spline< Scalar >::yLast().
|
inline |
Return the y value of the leftmost sampling point.
References Opm::Spline< Scalar >::y_().
|
inline |
Return the y value of the rightmost sampling point.
References Opm::Spline< Scalar >::numSamples(), and Opm::Spline< Scalar >::y_().
|
protected |
Referenced by Opm::Spline< Scalar >::makeFullSpline_(), Opm::Spline< Scalar >::makeNaturalSpline_(), Opm::Spline< Scalar >::makePeriodicSpline_(), Opm::Spline< Scalar >::set(), Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::setXYArrays(), Opm::Spline< Scalar >::setXYContainers(), and Opm::Spline< Scalar >::slope_().
|
protected |
Referenced by Opm::Spline< Scalar >::numSamples(), Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::set(), Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::setXYArrays(), Opm::Spline< Scalar >::setXYContainers(), Opm::Spline< Scalar >::sortInput_(), and Opm::Spline< Scalar >::x_().
|
protected |
Referenced by Opm::Spline< Scalar >::reverseSamplingPoints_(), Opm::Spline< Scalar >::set(), Opm::Spline< Scalar >::setArrayOfPoints(), Opm::Spline< Scalar >::setContainerOfPoints(), Opm::Spline< Scalar >::setContainerOfTuples(), Opm::Spline< Scalar >::setNumSamples_(), Opm::Spline< Scalar >::setXYArrays(), Opm::Spline< Scalar >::setXYContainers(), Opm::Spline< Scalar >::sortInput_(), and Opm::Spline< Scalar >::y_().