From 45f56b9fab1ce017eb2649f825dbecd2509162cf Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 7 Sep 2016 13:31:49 +0200 Subject: [PATCH] #829 Use HUGE_VAL for k-layers not covered by formation definitions --- .../RigFemPartResultsCollection.cpp | 10 +++++++++- .../ReservoirDataModel/RigCaseData.cpp | 20 +++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index 4b6a7bde69..0c90b2c678 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -667,7 +667,15 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in for(int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx) { size_t elmNodResIdx = femPart->elementNodeResultIdx(elmIdx, elmNodIdx); - dstFrameData[elmNodResIdx] = formNameIdx; + + if (formNameIdx != -1) + { + dstFrameData[elmNodResIdx] = formNameIdx; + } + else + { + dstFrameData[elmNodResIdx] = HUGE_VAL; + } } } diff --git a/ApplicationCode/ReservoirDataModel/RigCaseData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseData.cpp index d7e12650df..b9749dbd51 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseData.cpp @@ -492,8 +492,14 @@ void RigCaseData::setActiveFormationNames(RigFormationNames* activeFormationName if(!m_mainGrid->ijkFromCellIndex(cIdx, &i, &j, &k)) continue; int formNameIdx = activeFormationNames->formationIndexFromKLayerIdx(k); - - fnData[cIdx] = formNameIdx; + if (formNameIdx != -1) + { + fnData[cIdx] = formNameIdx; + } + else + { + fnData[cIdx] = HUGE_VAL; + } } for (size_t cIdx = localCellCount; cIdx < totalGlobCellCount; ++cIdx) @@ -505,8 +511,14 @@ void RigCaseData::setActiveFormationNames(RigFormationNames* activeFormationName if(!m_mainGrid->ijkFromCellIndex(mgrdCellIdx, &i, &j, &k)) continue; int formNameIdx = activeFormationNames->formationIndexFromKLayerIdx(k); - - fnData[cIdx] = formNameIdx; + if (formNameIdx != -1) + { + fnData[cIdx] = formNameIdx; + } + else + { + fnData[cIdx] = HUGE_VAL; + } } }