mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#993 Fixed use of wrong index for unnamed inactive fault
This commit is contained in:
parent
e89b73d64c
commit
4ed6076750
@ -220,7 +220,6 @@ void RigMainGrid::setFaults(const cvf::Collection<RigFault>& faults)
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
|
||||
{
|
||||
{
|
||||
m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(m_cells.size());
|
||||
|
||||
@ -234,10 +233,14 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
|
||||
// Separate the grid faults that has an inactive cell as member
|
||||
|
||||
RigFault* unNamedFault = new RigFault;
|
||||
unNamedFault->setName(RimDefines::undefinedGridFaultName());
|
||||
int unNamedFaultIdx = static_cast<int>(m_faults.size());
|
||||
m_faults.push_back(unNamedFault);
|
||||
|
||||
RigFault* unNamedFaultWithInactive = new RigFault;
|
||||
unNamedFaultWithInactive->setName(RimDefines::undefinedGridFaultWithInactiveName());
|
||||
int unNamedFaultWithInactiveIdx = static_cast<int>(m_faults.size());
|
||||
m_faults.push_back(unNamedFaultWithInactive);
|
||||
|
||||
const std::vector<cvf::Vec3d>& vxs = m_mainGrid->nodes();
|
||||
|
||||
@ -315,7 +318,6 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
|
||||
// Add as fault face only if the grid index is less than the neighbors
|
||||
|
||||
if (static_cast<size_t>(gcIdx) < neighborReservoirCellIdx)
|
||||
{
|
||||
{
|
||||
RigFault::FaultFace ff(gcIdx, cvf::StructGridInterface::FaceType(faceIdx), neighborReservoirCellIdx);
|
||||
if(isCellActive && isNeighborCellActive)
|
||||
@ -327,8 +329,6 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
|
||||
unNamedFaultWithInactive->faultFaces().push_back(ff);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
CVF_FAIL_MSG("Found fault with global neighbor index less than the native index. "); // Should never occur. because we flag the opposite face in the faultsPrCellAcc
|
||||
@ -337,20 +337,14 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if (unNamedFault->faultFaces().size())
|
||||
{
|
||||
unNamedFault->setName(RimDefines::undefinedGridFaultName());
|
||||
m_faults.push_back(unNamedFault);
|
||||
distributeNNCsToFaults();
|
||||
}
|
||||
|
||||
if(unNamedFaultWithInactive->faultFaces().size())
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::distributeNNCsToFaults()
|
||||
{
|
||||
unNamedFaultWithInactive->setName(RimDefines::undefinedGridFaultWithInactiveName());
|
||||
m_faults.push_back(unNamedFaultWithInactive);
|
||||
}
|
||||
}
|
||||
// Distribute nnc's to the faults
|
||||
|
||||
const std::vector<RigConnection>& nncs = this->nncData()->connections();
|
||||
for (size_t nncIdx = 0; nncIdx < nncs.size(); ++nncIdx)
|
||||
{
|
||||
|
@ -61,6 +61,9 @@ public:
|
||||
void setFaults(const cvf::Collection<RigFault>& faults);
|
||||
const cvf::Collection<RigFault>& faults() { return m_faults; }
|
||||
void calculateFaults(const RigActiveCellInfo* activeCellInfo);
|
||||
|
||||
void distributeNNCsToFaults();
|
||||
|
||||
const RigFault* findFaultFromCellIndexAndCellFace(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const;
|
||||
bool isFaceNormalsOutwards() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user