Install crude handling of data point outside vertical span

The initial implementation of RK4IVP<>::operator() failed to take
into account the possibility that we might need to evaluate the
function outside the vertical span for which it was initially
defined.  This situation occurs, for instance, in the not uncommon
cases of the GOC being above or the WOC being below the model.

This commit installs a crude Hermitian extrapolation procedure to
handle these cases.  Refinements are likely.
This commit is contained in:
Bård Skaflestad
2014-01-21 17:49:02 +01:00
committed by Andreas Lauser
parent 4779b43e88
commit 30ba1b0f86

View File

@@ -73,9 +73,13 @@ namespace Opm
// Dense output (O(h**3)) according to Shampine
// (Hermite interpolation)
const double h = stepsize();
const int i = (x - span_[0]) / h;
int i = (x - span_[0]) / h;
const double t = (x - (span_[0] + i*h)) / h;
// Crude handling of evaluation point outside "span_";
if (i < 0) { i = 0; }
if (N_ <= i) { i = N_ - 1; }
const double y0 = y_[i], y1 = y_[i + 1];
const double f0 = f_[i], f1 = f_[i + 1];