#3581 Temp LGR. No recreation of faults after creating temporary LGRs

This commit is contained in:
Bjørn Erik Jensen committed 2018-10-30 11:41:35 +01:00
1 parent ad3a3f46ee
commit d2249e4d17
4 files changed
+9 -6

No files matched your search

@@ -142,7 +142,7 @@ void RicCreateTemporaryLgrFeature::onActionTriggered(bool isChecked)
} }
} }
mainGrid->calculateFaults(activeCellInfo, true); mainGrid->calculateFaults(activeCellInfo);
} }
RiuSelectionManager::instance()->deleteAllItems(RiuSelectionManager::RUI_APPLICATION_GLOBAL); RiuSelectionManager::instance()->deleteAllItems(RiuSelectionManager::RUI_APPLICATION_GLOBAL);
@@ -49,9 +49,14 @@ public:
} }
inline int faultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const inline int faultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const
{
// Ensure no crash after creating temporary LGRs
if (reservoirCellIndex < m_faultIdxForCellFace.size())
{ {
return m_faultIdxForCellFace[reservoirCellIndex][face]; return m_faultIdxForCellFace[reservoirCellIndex][face];
} }
return NO_FAULT;
}
inline void setFaultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face, int faultIdx) inline void setFaultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face, int faultIdx)
{ {
@@ -421,9 +421,9 @@ bool RigMainGrid::hasFaultWithName(const QString& name) const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo, bool forceCalculation) void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
{ {
if (!forceCalculation && hasFaultWithName(RiaDefines::undefinedGridFaultName()) && if (hasFaultWithName(RiaDefines::undefinedGridFaultName()) &&
hasFaultWithName(RiaDefines::undefinedGridFaultWithInactiveName())) hasFaultWithName(RiaDefines::undefinedGridFaultWithInactiveName()))
{ {
// RiaLogging::debug(QString("Calculate faults already run for grid.")); // RiaLogging::debug(QString("Calculate faults already run for grid."));
@@ -431,8 +431,6 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo, bool
return; return;
} }
m_faults.clear();
m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(m_cells.size()); m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(m_cells.size());
// Spread fault idx'es on the cells from the faults // Spread fault idx'es on the cells from the faults
@@ -72,7 +72,7 @@ public:
RigNNCData* nncData(); RigNNCData* nncData();
void setFaults(const cvf::Collection<RigFault>& faults); void setFaults(const cvf::Collection<RigFault>& faults);
const cvf::Collection<RigFault>& faults(); const cvf::Collection<RigFault>& faults();
void calculateFaults(const RigActiveCellInfo* activeCellInfo, bool forceCalculation = false); void calculateFaults(const RigActiveCellInfo* activeCellInfo);
void distributeNNCsToFaults(); void distributeNNCsToFaults();