mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7116 Add extrapolation for missing elastic properties.
Also improve error message.
This commit is contained in:
committed by
Magne Sjaastad
parent
c174bf947c
commit
6481813eeb
@@ -148,7 +148,8 @@ const std::vector<double>& RigElasticProperties::getVector( RiaDefines::CurvePro
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale ) const
|
||||
std::pair<double, bool>
|
||||
RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale ) const
|
||||
{
|
||||
const std::vector<double>& unscaledValues = getVector( property );
|
||||
std::vector<double> scaledValues;
|
||||
@@ -157,5 +158,8 @@ double RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty prop
|
||||
scaledValues.push_back( unscaled * scale );
|
||||
}
|
||||
|
||||
return RiaInterpolationTools::linear( m_porosity, scaledValues, porosity );
|
||||
bool isExtrapolated = porosity > porosityMax() || porosity < porosityMin();
|
||||
double value =
|
||||
RiaInterpolationTools::linear( m_porosity, scaledValues, porosity, RiaInterpolationTools::ExtrapolationMode::CLOSEST );
|
||||
return std::make_pair( value, isExtrapolated );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user