Allow different definitions of valid result for StimPlan and Thermal template.

This commit is contained in:
Kristian Bendiksen 2022-09-05 18:28:51 +02:00
parent d046e2692c
commit 550110d8ab
6 changed files with 25 additions and 4 deletions

View File

@ -463,7 +463,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfa
bool includeThisTrianglePair = false;
for ( size_t j = 0; j < 6; j++ )
{
if ( perNodeResultValues[triangleIndices[i + j]] > 1e-7 )
if ( stimPlanFracTemplate->isValidResult( perNodeResultValues[triangleIndices[i + j]] ) )
{
includeThisTrianglePair = true;
}
@ -578,7 +578,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
for ( size_t cIdx = 0; cIdx < stimPlanCells.size(); ++cIdx )
{
if ( prCellResults[cIdx] > 1e-7 )
if ( stimPlanFracTemplate->isValidResult( prCellResults[cIdx] ) )
{
const RigFractureCell& stimPlanCell = stimPlanCells[cIdx];
std::vector<cvf::Vec3d> stimPlanCellPolygon = stimPlanCell.getPolygon();
@ -1048,7 +1048,7 @@ void RivWellFracturePartMgr::createVisibleFracturePolygons( RimMeshFractureTempl
m_visibleFracturePolygons.clear();
for ( size_t cIdx = 0; cIdx < stimPlanCells.size(); ++cIdx )
{
if ( prCellResults[cIdx] > 1e-7 )
if ( stimPlanFracTemplate->isValidResult( prCellResults[cIdx] ) )
{
const RigFractureCell& stimPlanCell = stimPlanCells[cIdx];
std::vector<cvf::Vec3d> stimPlanCellPolygon = stimPlanCell.getPolygon();
@ -1081,7 +1081,7 @@ cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable( R
for ( size_t cIdx = 0; cIdx < stimPlanCells.size(); ++cIdx )
{
if ( prCellResults[cIdx] > 1e-7 )
if ( stimPlanFracTemplate->isValidResult( prCellResults[cIdx] ) )
{
const RigFractureCell& stimPlanCell = stimPlanCells[cIdx];
std::vector<cvf::Vec3d> stimPlanCellPolygon = stimPlanCell.getPolygon();

View File

@ -68,6 +68,8 @@ public:
size_t i,
size_t j ) = 0;
virtual bool isValidResult( double value ) const = 0;
virtual QString getFileSelectionFilter() const = 0;
virtual std::vector<double> widthResultValues() const;

View File

@ -838,3 +838,11 @@ void RimStimPlanFractureTemplate::appendTextIfValidValue( QString&
body += QString( "%1: %2<br>" ).arg( name ).arg( RiaNumberFormat::valueToText( value, numberFormat, precision ) );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimStimPlanFractureTemplate::isValidResult( double value ) const
{
return value > 1e-7;
}

View File

@ -118,6 +118,8 @@ public:
static std::pair<QString, QString> widthParameterNameAndUnit( cvf::ref<RigStimPlanFractureDefinition> def );
bool isValidResult( double value ) const override;
protected:
void initAfterRead() override;

View File

@ -704,3 +704,11 @@ std::pair<cvf::Vec3d, cvf::Vec3d> RimThermalFractureTemplate::computePositionAnd
cvf::Vec3d rotation = cvf::Vec3d::UNDEFINED;
return std::make_pair( centerPosition, rotation );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimThermalFractureTemplate::isValidResult( double value ) const
{
return !std::isinf( value ) && !std::isnan( value );
}

View File

@ -75,6 +75,7 @@ public:
const QString& unit,
MinMaxAccumulator& minMaxAccumulator,
PosNegAccumulator& posNegAccumulator ) const override;
bool isValidResult( double value ) const override;
void setDefaultConductivityResultIfEmpty();
bool setBorderPolygonResultNameToDefault();