#5469 Move POR and ST/SE differentials to a new category "Differentials".

This commit is contained in:
Kristian Bendiksen 2020-02-11 08:41:26 +01:00
parent c0124f3bf4
commit 6562dbdb5d
6 changed files with 74 additions and 40 deletions

View File

@ -355,9 +355,6 @@ std::map<std::string, std::vector<std::string>>
{
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<std::string, std::vector<std::string>>
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<std::string, std::vector<std::string>>
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<std::string, std::vector<std::string>>
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<std::string> 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" ) )

View File

@ -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;

View File

@ -27,5 +27,6 @@ enum RigFemResultPosEnum
RIG_ELEMENT_NODAL_FACE,
RIG_FORMATION_NAMES,
RIG_ELEMENT,
RIG_WELLPATH_DERIVED
RIG_WELLPATH_DERIVED,
RIG_DIFFERENTIALS
};

View File

@ -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;
}

View File

@ -56,6 +56,7 @@ void caf::AppEnum<RigFemResultPosEnum>::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<caf::PdmOptionItemInfo>
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() );
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -289,7 +289,9 @@ void RiuFemResultTextBuilder::appendTextFromResultColors( RigGeoMechCaseData*
{
float scalarValue = std::numeric_limits<float>::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];
}