NNC: Distribute the NNC on the correct faults

Making the NNC search map obsolete
This commit is contained in:
Jacob Støren
2013-12-14 09:30:27 +01:00
parent 1e65a9db11
commit e75bd8adfb
3 changed files with 24 additions and 8 deletions

View File

@@ -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);
}
}
}