diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp index aad06f3706..7896e13770 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp @@ -347,3 +347,12 @@ void RigGeoMechCaseData::assertResultsLoaded( const RigFemResultAddress& resVarA } } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RigGeoMechCaseData::resultValues(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex) +{ + RigFemScalarResultFrames* scalarResults = findOrLoadScalarResult(partIndex, resVarAddr); + return scalarResults->frameData(frameIndex); +} diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.h index 589f82d3b3..ea43fa0d82 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.h @@ -45,8 +45,7 @@ public: std::map > scalarFieldAndComponentNames(RigFemResultPosEnum resPos); std::vector stepNames(); void assertResultsLoaded(const RigFemResultAddress& resVarAddr); - RigFemScalarResultFrames* findOrLoadScalarResult(int partIndex, - const RigFemResultAddress& resVarAddr); + const std::vector& resultValues(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex); int frameCount(); @@ -57,6 +56,9 @@ public: void meanCellScalarValues(const RigFemResultAddress& resVarAddr, double* meanValue); private: + RigFemScalarResultFrames* findOrLoadScalarResult(int partIndex, + const RigFemResultAddress& resVarAddr); + void minMaxScalarValuesInternal(const RigFemResultAddress& resVarAddr, int frameIndex, double* overallMin, double* overallMax); void posNegClosestToZeroInternal(const RigFemResultAddress& resVarAddr, int frameIndex, diff --git a/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartPartMgr.cpp b/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartPartMgr.cpp index 913b0ae8b7..b844a8d76f 100644 --- a/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartPartMgr.cpp +++ b/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartPartMgr.cpp @@ -236,8 +236,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechRe RigFemResultAddress resVarAddress(resPosType, fieldName.toStdString(), compName.toStdString()); - RigFemScalarResultFrames* scalarResults = caseData->findOrLoadScalarResult(m_gridIdx, resVarAddress); - std::vector& resultValues = scalarResults->frameData(timeStepIndex); + const std::vector& resultValues = caseData->resultValues(resVarAddress, m_gridIdx, timeStepIndex); const std::vector* vxToResultMapping = NULL;