From 1bf1d5a7cf47a814ab4e47a98d46770b8b9e993a Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 7 Mar 2013 14:56:52 +0100 Subject: [PATCH] Rebuild geometry after computing new active cell info, and update views p4#: 20821 --- .../ReservoirDataModel/RigActiveCellInfo.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ApplicationCode/ReservoirDataModel/RigActiveCellInfo.cpp b/ApplicationCode/ReservoirDataModel/RigActiveCellInfo.cpp index 07d93fd055..8c4f7c3970 100644 --- a/ApplicationCode/ReservoirDataModel/RigActiveCellInfo.cpp +++ b/ApplicationCode/ReservoirDataModel/RigActiveCellInfo.cpp @@ -45,6 +45,11 @@ void RigActiveCellInfo::setGlobalCellCount(size_t globalCellCount) //-------------------------------------------------------------------------------------------------- bool RigActiveCellInfo::isActiveInMatrixModel(size_t globalCellIndex) const { + if (m_activeInMatrixModel.size() == 0) + { + return false; + } + CVF_TIGHT_ASSERT(globalCellIndex < m_activeInMatrixModel.size()); return m_activeInMatrixModel[globalCellIndex] != cvf::UNDEFINED_SIZE_T; @@ -55,6 +60,11 @@ bool RigActiveCellInfo::isActiveInMatrixModel(size_t globalCellIndex) const //-------------------------------------------------------------------------------------------------- size_t RigActiveCellInfo::activeIndexInMatrixModel(size_t globalCellIndex) const { + if (m_activeInMatrixModel.size() == 0) + { + return cvf::UNDEFINED_SIZE_T; + } + CVF_TIGHT_ASSERT(globalCellIndex < m_activeInMatrixModel.size()); return m_activeInMatrixModel[globalCellIndex]; @@ -75,6 +85,11 @@ void RigActiveCellInfo::setActiveIndexInMatrixModel(size_t globalCellIndex, size //-------------------------------------------------------------------------------------------------- bool RigActiveCellInfo::isActiveInFractureModel(size_t globalCellIndex) const { + if (m_activeInFractureModel.size() == 0) + { + return false; + } + CVF_TIGHT_ASSERT(globalCellIndex < m_activeInFractureModel.size()); return m_activeInFractureModel[globalCellIndex] != cvf::UNDEFINED_SIZE_T; @@ -85,6 +100,11 @@ bool RigActiveCellInfo::isActiveInFractureModel(size_t globalCellIndex) const //-------------------------------------------------------------------------------------------------- size_t RigActiveCellInfo::activeIndexInFractureModel(size_t globalCellIndex) const { + if (m_activeInFractureModel.size() == 0) + { + return cvf::UNDEFINED_SIZE_T; + } + CVF_TIGHT_ASSERT(globalCellIndex < m_activeInFractureModel.size()); return m_activeInFractureModel[globalCellIndex];