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

This commit is contained in:
Bjørn Erik Jensen 2018-10-30 11:41:35 +01:00
parent ad3a3f46ee
commit d2249e4d17
4 changed files with 10 additions and 7 deletions

View File

@ -142,7 +142,7 @@ void RicCreateTemporaryLgrFeature::onActionTriggered(bool isChecked)
}
}
mainGrid->calculateFaults(activeCellInfo, true);
mainGrid->calculateFaults(activeCellInfo);
}
RiuSelectionManager::instance()->deleteAllItems(RiuSelectionManager::RUI_APPLICATION_GLOBAL);

View File

@ -50,7 +50,12 @@ public:
inline int faultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const
{
return m_faultIdxForCellFace[reservoirCellIndex][face];
// Ensure no crash after creating temporary LGRs
if (reservoirCellIndex < m_faultIdxForCellFace.size())
{
return m_faultIdxForCellFace[reservoirCellIndex][face];
}
return NO_FAULT;
}
inline void setFaultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face, int faultIdx)

View File

@ -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()))
{
// RiaLogging::debug(QString("Calculate faults already run for grid."));
@ -431,8 +431,6 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo, bool
return;
}
m_faults.clear();
m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(m_cells.size());
// Spread fault idx'es on the cells from the faults

View File

@ -72,7 +72,7 @@ public:
RigNNCData* nncData();
void setFaults(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();