Additional refactoring for POR-Bar result handling

* Always use element-nodal for POR calculations
* Add RigFemAddressDefines
Add special handling for "POR-Bar" result, always use element_nodal

* 9362 Show unit text "sg" when normalized by hydrostatic pressure
This commit is contained in:
Magne Sjaastad
2023-08-23 13:29:54 +02:00
committed by GitHub
parent 4b12f82583
commit bb293539d5
25 changed files with 203 additions and 88 deletions

View File

@@ -20,6 +20,7 @@
#include "RivFemElmVisibilityCalculator.h"
#include "RigCaseToCaseCellMapper.h"
#include "RigFemAddressDefines.h"
#include "RigFemPart.h"
#include "RigFemPartGrid.h"
#include "RigFemPartResultsCollection.h"
@@ -118,11 +119,7 @@ void RivFemElmVisibilityCalculator::computePropertyVisibility( cvf::UByteArray*
RigGeoMechCaseData* caseData = propFilterColl->reservoirView()->geoMechCase()->geoMechData();
RigFemResultAddress resVarAddress = propertyFilter->resultDefinition->resultAddress();
// Do a "Hack" to use elm nodal and not nodal POR results
if ( resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar" )
resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
RigFemResultAddress resVarAddress = RigFemAddressDefines::getResultLookupAddress( propertyFilter->resultDefinition->resultAddress() );
const std::vector<float>& resVals =
caseData->femPartResults()->resultValues( resVarAddress, part->elementPartId(), timeStepIndex, frameIndex );

View File

@@ -17,16 +17,13 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include <cstdlib>
#include "RivFemPartPartMgr.h"
#include "RivGeoMechPartMgr.h"
#include "RiaPreferences.h"
#include "RifGeoMechReaderInterface.h"
#include "RigFemAddressDefines.h"
#include "RigFemPart.h"
#include "RigFemPartResultsCollection.h"
#include "RigFemScalarResultFrames.h"
@@ -38,6 +35,7 @@
#include "RimRegularLegendConfig.h"
#include "RivFemPickSourceInfo.h"
#include "RivGeoMechPartMgr.h"
#include "RivMeshLinesSourceInfo.h"
#include "RivPartPriority.h"
#include "RivResultToTextureMapper.h"
@@ -61,6 +59,8 @@
#include "cvfTransform.h"
#include "cvfUniform.h"
#include <cstdlib>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -286,13 +286,7 @@ void RivFemPartPartMgr::updateCellResultColor( int timeStepIndex, int frameIndex
if ( !caseData ) return;
RigFemResultAddress resVarAddress = cellResultColors->resultAddress();
// Do a "Hack" to show elm nodal and not nodal POR results
if ( resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar" )
{
resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
}
RigFemResultAddress resVarAddress = RigFemAddressDefines::getResultLookupAddress( cellResultColors->resultAddress() );
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues( resVarAddress, m_partIdx, timeStepIndex, frameIndex );