diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index f586dbe7e2..a0d003f235 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -355,9 +355,6 @@ std::map> { fieldCompNames = m_readerInterface->scalarNodeFieldAndComponentNames(); fieldCompNames["POR-Bar"]; - fieldCompNames["POR_GRADIENTS"].push_back( "X" ); - fieldCompNames["POR_GRADIENTS"].push_back( "Y" ); - fieldCompNames["POR_GRADIENTS"].push_back( "Z" ); fieldCompNames[FIELD_NAME_COMPACTION]; } else if ( resPos == RIG_ELEMENT_NODAL ) @@ -381,11 +378,6 @@ std::map> fieldCompNames["SE"].push_back( "S3inc" ); fieldCompNames["SE"].push_back( "S3azi" ); - for ( auto& s : stressGradientComponentNames ) - { - fieldCompNames["SE_GRADIENTS"].push_back( s ); - } - fieldCompNames["ST"].push_back( "STM" ); fieldCompNames["ST"].push_back( "Q" ); @@ -401,11 +393,6 @@ std::map> fieldCompNames["ST"].push_back( "S3inc" ); fieldCompNames["ST"].push_back( "S3azi" ); - for ( auto& s : stressGradientComponentNames ) - { - fieldCompNames["ST_GRADIENTS"].push_back( s ); - } - fieldCompNames["Gamma"].push_back( "Gamma1" ); fieldCompNames["Gamma"].push_back( "Gamma2" ); fieldCompNames["Gamma"].push_back( "Gamma3" ); @@ -536,6 +523,23 @@ std::map> fieldCompNames[parameter.name().toStdString()]; } } + else if ( resPos == RIG_DIFFERENTIALS ) + { + fieldCompNames["POR-Bar"]; + fieldCompNames["POR-Bar"].push_back( "X" ); + fieldCompNames["POR-Bar"].push_back( "Y" ); + fieldCompNames["POR-Bar"].push_back( "Z" ); + + for ( auto& s : stressGradientComponentNames ) + { + fieldCompNames["SE"].push_back( s ); + } + + for ( auto& s : stressGradientComponentNames ) + { + fieldCompNames["ST"].push_back( s ); + } + } } return fieldCompNames; @@ -991,23 +995,22 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateMeanStressSTM( i RigFemScalarResultFrames* RigFemPartResultsCollection::calculateStressGradients( int partIndex, const RigFemResultAddress& resVarAddr ) { - CVF_ASSERT( resVarAddr.fieldName == "ST_GRADIENTS" || resVarAddr.fieldName == "SE_GRADIENTS" ); + CVF_ASSERT( resVarAddr.fieldName == "ST" || resVarAddr.fieldName == "SE" ); caf::ProgressInfo frameCountProgress( this->frameCount() * 2, "" ); frameCountProgress.setProgressDescription( "Calculating gradient: " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) ); frameCountProgress.setNextProgressIncrement( this->frameCount() ); - QString origFieldName = QString::fromStdString( resVarAddr.fieldName ); - // Strip away "_GRADIENTS" to underlying field data - QString underlyingFieldName = origFieldName.left( origFieldName.lastIndexOf( QChar( '_' ) ) ); - QString origComponentName = QString::fromStdString( resVarAddr.componentName ); - QString componentName = origComponentName.left( origComponentName.lastIndexOf( QChar( '-' ) ) ); + QString origFieldName = QString::fromStdString( resVarAddr.fieldName ); + QString origComponentName = QString::fromStdString( resVarAddr.componentName ); + // Split out the direction of the component name: SE-X => SE + QString componentName = origComponentName.left( origComponentName.lastIndexOf( QChar( '-' ) ) ); RigFemScalarResultFrames* inputResultFrames = this->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, - underlyingFieldName.toStdString(), + resVarAddr.fieldName, componentName.toStdString() ) ); RigFemScalarResultFrames* dataFramesX = m_femPartResults[partIndex]->createScalarResult( @@ -1085,7 +1088,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateStressGradients( RigFemScalarResultFrames* RigFemPartResultsCollection::calculateNodalGradients( int partIndex, const RigFemResultAddress& resVarAddr ) { - CVF_ASSERT( resVarAddr.fieldName == "POR_GRADIENTS" ); + CVF_ASSERT( resVarAddr.fieldName == "POR-Bar" ); CVF_ASSERT( resVarAddr.componentName == "X" || resVarAddr.componentName == "Y" || resVarAddr.componentName == "Z" ); caf::ProgressInfo frameCountProgress( this->frameCount() * 5, "" ); @@ -2381,7 +2384,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult( i return calculateMeanStressSTM( partIndex, resVarAddr ); } - if ( resVarAddr.fieldName == "ST_GRADIENTS" || resVarAddr.fieldName == "SE_GRADIENTS" ) + if ( resVarAddr.fieldName == "ST" || resVarAddr.fieldName == "SE" ) { const std::vector allowedComponentNames = getStressGradientComponentNames(); @@ -2407,17 +2410,20 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult( i if ( resVarAddr.fieldName == "POR-Bar" ) { if ( resVarAddr.resultPosType == RIG_NODAL ) - return calculateBarConvertedResult( partIndex, resVarAddr, "POR" ); + { + if ( resVarAddr.componentName == "X" || resVarAddr.componentName == "Y" || resVarAddr.componentName == "Z" ) + { + return calculateNodalGradients( partIndex, resVarAddr ); + } + else + { + return calculateBarConvertedResult( partIndex, resVarAddr, "POR" ); + } + } else return calculateEnIpPorBarResult( partIndex, resVarAddr ); } - if ( resVarAddr.fieldName == "POR_GRADIENTS" && - ( resVarAddr.componentName == "X" || resVarAddr.componentName == "Y" || resVarAddr.componentName == "Z" ) ) - { - return calculateNodalGradients( partIndex, resVarAddr ); - } - if ( ( resVarAddr.fieldName == "NE" ) && ( resVarAddr.componentName == "E11" || resVarAddr.componentName == "E22" || resVarAddr.componentName == "E33" || resVarAddr.componentName == "E12" || resVarAddr.componentName == "E13" || resVarAddr.componentName == "E23" ) ) diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultAddress.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultAddress.h index 4a90d90e4f..984a5a9afc 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultAddress.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultAddress.h @@ -83,7 +83,8 @@ public: { bool isTypeValid = resultPosType == RIG_NODAL || resultPosType == RIG_ELEMENT_NODAL || resultPosType == RIG_INTEGRATION_POINT || resultPosType == RIG_ELEMENT_NODAL_FACE || - resultPosType == RIG_FORMATION_NAMES || resultPosType == RIG_ELEMENT; + resultPosType == RIG_FORMATION_NAMES || resultPosType == RIG_ELEMENT || + resultPosType == RIG_DIFFERENTIALS; bool isFieldValid = fieldName != ""; return isTypeValid && isFieldValid; diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultPosEnum.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultPosEnum.h index 8e749c9230..257b58c6a6 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultPosEnum.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemResultPosEnum.h @@ -27,5 +27,6 @@ enum RigFemResultPosEnum RIG_ELEMENT_NODAL_FACE, RIG_FORMATION_NAMES, RIG_ELEMENT, - RIG_WELLPATH_DERIVED + RIG_WELLPATH_DERIVED, + RIG_DIFFERENTIALS }; diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index 0cc92b3fdd..7a7631d030 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -834,6 +834,10 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const HistogramData& histData, R case RIG_ELEMENT: resultPos = "Element"; break; + + case RIG_DIFFERENTIALS: + resultPos = "Differentials"; + break; default: break; } diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp index a0ebdb12bf..d5777a78e9 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp @@ -56,6 +56,7 @@ void caf::AppEnum::setUp() addItem( RIG_FORMATION_NAMES, "FORMATION_NAMES", "Formation Names" ); addItem( RIG_ELEMENT, "ELEMENT", "Element" ); addItem( RIG_WELLPATH_DERIVED, "WELLPATH_DERIVED", "Well Path Derived" ); + addItem( RIG_DIFFERENTIALS, "DIFFERENTIALS", "Differentials" ); setDefault( RIG_NODAL ); } } // namespace caf @@ -192,7 +193,8 @@ QList RIG_INTEGRATION_POINT, RIG_ELEMENT_NODAL_FACE, RIG_FORMATION_NAMES, - RIG_ELEMENT}; + RIG_ELEMENT, + RIG_DIFFERENTIALS}; if ( m_addWellPathDerivedResults ) { optionItems.push_back( RIG_WELLPATH_DERIVED ); @@ -509,13 +511,31 @@ void RimGeoMechResultDefinition::setAddWellPathDerivedResults( bool addWellPathD //-------------------------------------------------------------------------------------------------- RigFemResultAddress RimGeoMechResultDefinition::resultAddress() const { - return RigFemResultAddress( resultPositionType(), - resultFieldName().toStdString(), - resultComponentName().toStdString(), - m_timeLapseBaseTimestep(), - resultFieldName().toStdString() == RigFemPartResultsCollection::FIELD_NAME_COMPACTION - ? m_compactionRefLayer() - : RigFemResultAddress::noCompactionValue() ); + // Convert differentials to their underlying position type + if ( resultPositionType() == RIG_DIFFERENTIALS ) + { + RigFemResultPosEnum resultPositionType = RIG_ELEMENT_NODAL; + if ( resultFieldName().toStdString() == "POR-Bar" ) + { + resultPositionType = RIG_NODAL; + } + + return RigFemResultAddress( resultPositionType, + resultFieldName().toStdString(), + resultComponentName().toStdString(), + m_timeLapseBaseTimestep(), + RigFemResultAddress::noCompactionValue() ); + } + else + { + return RigFemResultAddress( resultPositionType(), + resultFieldName().toStdString(), + resultComponentName().toStdString(), + m_timeLapseBaseTimestep(), + resultFieldName().toStdString() == RigFemPartResultsCollection::FIELD_NAME_COMPACTION + ? m_compactionRefLayer() + : RigFemResultAddress::noCompactionValue() ); + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuFemResultTextBuilder.cpp b/ApplicationCode/UserInterface/RiuFemResultTextBuilder.cpp index 2775914345..13cfeb6490 100644 --- a/ApplicationCode/UserInterface/RiuFemResultTextBuilder.cpp +++ b/ApplicationCode/UserInterface/RiuFemResultTextBuilder.cpp @@ -289,7 +289,9 @@ void RiuFemResultTextBuilder::appendTextFromResultColors( RigGeoMechCaseData* { float scalarValue = std::numeric_limits::infinity(); int nodeIdx = elmentConn[lNodeIdx]; - if ( resultDefinition->resultPositionType() == RIG_NODAL ) + if ( resultDefinition->resultPositionType() == RIG_NODAL || + ( resultDefinition->resultPositionType() == RIG_DIFFERENTIALS && + resultDefinition->resultFieldName() == "POR-Bar" ) ) { scalarValue = scalarResults[nodeIdx]; }