mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-18 21:43:27 -06:00
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:
parent
76844c9c59
commit
f71ba5a9f7
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user