mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7763 Improve extrapolation for when points are too close.
This commit is contained in:
committed by
Magne Sjaastad
parent
4de91e885b
commit
1ebe4ec2a1
@@ -162,7 +162,11 @@ int RiaInterpolationTools::extrapolateRange( int start,
|
||||
std::vector<double> ys = { y[firstPoint], y[lastPoint] };
|
||||
for ( int index = start; index < end; index++ )
|
||||
{
|
||||
y[index] = extrapolate( xs, ys, x[index] );
|
||||
// Avoid excessive extrapolation when points are very close
|
||||
if ( almostEqual( xs[0], xs[1] ) || almostEqual( ys[0], ys[1] ) )
|
||||
y[index] = ys[0];
|
||||
else
|
||||
y[index] = extrapolate( xs, ys, x[index] );
|
||||
}
|
||||
|
||||
return end;
|
||||
|
||||
Reference in New Issue
Block a user