StimPlanModel: Fix bug in pressure interpolation.

This commit is contained in:
Kristian Bendiksen 2023-09-18 22:27:46 +02:00
parent cc59eba6e0
commit 1e2f8fadef

View File

@ -298,9 +298,10 @@ std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
}
else
{
if ( !sourceValues.empty() )
// The last point is added without interpolation. But MD can be smaller than the source range which
// leads to startIndex equal to endIndex: leave these cases as inf.
if ( !sourceValues.empty() && md >= sourceMds[0] )
{
// The last point is added without interpolation
value = sourceValues.back();
}
}