Go to the documentation of this file.
20#ifndef OPM_ECLTABLEINTERPOLATION1D_HEADER_INCLUDED
21#define OPM_ECLTABLEINTERPOLATION1D_HEADER_INCLUDED
33namespace Opm { namespace Interp1D {
37 enum class PointCategory {
50 namespace PiecewisePolynomial {
55 namespace ExtrapolationPolicy {
85 template < class TabulatedFunction, class Index>
86 double left( const std::vector<double>& ,
89 TabulatedFunction&& f) const
120 template < class TabulatedFunction, class Index>
121 double right( const std::vector<double>& xi,
124 TabulatedFunction&& f) const
126 return f(xi.size() - 1, col);
162 template < class TabulatedFunction, class Index>
163 double left( const std::vector<double>& xi,
166 TabulatedFunction&& f) const
169 const auto f0 = f(0, col);
170 const auto f1 = f(1, col);
171 const auto dfdx = (f1 - f0) / (xi[1] - xi[0]);
174 const auto dx = x - xi.front();
176 return f0 + (dfdx * dx);
203 template < class TabulatedFunction, class Index>
204 double right( const std::vector<double>& xi,
207 TabulatedFunction&& f) const
209 const auto nRows = xi.size();
212 const auto f0 = f(nRows - 2, col);
213 const auto f1 = f(nRows - 1, col);
215 (f1 - f0) / (xi[nRows - 1] - xi[nRows - 2]);
218 const auto dx = x - xi.back();
220 return f1 + (dfdx * dx);
226 class LinearlyWithDerivatives
236 explicit LinearlyWithDerivatives( const std::size_t nResCol)
264 template < class TabulatedFunction, class Index>
265 double left( const std::vector<double>& xi,
268 TabulatedFunction&& f) const
271 const auto dfdx = f(0, this->nResCol_ + col);
272 const auto dx = x - xi.front();
274 return f(0, col) + (dfdx * dx);
304 template < class TabulatedFunction, class Index>
305 double right( const std::vector<double>& xi,
308 TabulatedFunction&& f) const
310 const auto nRows = xi.size();
313 const auto dfdx = f(nRows - 1, this->nResCol_ + col);
314 const auto dx = x - xi.back();
316 return f(nRows - 1, col) + (dfdx * dx);
322 std::size_t nResCol_;
328 struct LocalInterpPoint {
345 std::vector<double>::size_type interval;
372 static LocalInterpPoint
373 identify( const std::vector<double>& xi,
375 std::true_type is_ascending = std::true_type{});
394 static LocalInterpPoint
395 identify( const std::vector<double>& xi,
397 std::false_type is_ascending);
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t t(t+t)") define_sfop3(16
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)
|