mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
NNC: Distribute the NNC on the correct faults
Making the NNC search map obsolete
This commit is contained in:
@@ -310,4 +310,22 @@ void RigMainGrid::calculateFaults()
|
||||
unNamedFault->setName("Unnamed grid faults");
|
||||
m_faults.push_back(unNamedFault);
|
||||
}
|
||||
|
||||
// Distribute nnc's to the faults
|
||||
|
||||
const std::vector<RigConnection>& nncs = m_nncData->connections();
|
||||
for (size_t nncIdx = 0; nncIdx < nncs.size(); ++nncIdx)
|
||||
{
|
||||
// Find the fault for each side of the nnc
|
||||
const RigConnection& conn = nncs[nncIdx];
|
||||
int fIdx1 = faultsPrCellAcc->faultIdx(conn.m_c1GlobIdx, conn.m_c1Face);
|
||||
int fIdx2 = faultsPrCellAcc->faultIdx(conn.m_c2GlobIdx, StructGridInterface::oppositeFace(conn.m_c1Face));
|
||||
|
||||
// Add the connection to both, if they are different.
|
||||
m_faults[fIdx1]->connectionIndices().push_back(nncIdx);
|
||||
if (fIdx2 != fIdx1)
|
||||
{
|
||||
m_faults[fIdx2]->connectionIndices().push_back(nncIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user