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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ void RigNNCData::processConnections(const RigMainGrid& mainGrid)
|
||||
m_connections[cnIdx].m_polygon.push_back(intersections[polygon[pIdx] - mainGrid.nodes().size()]);
|
||||
}
|
||||
|
||||
// Add to search map
|
||||
// Add to search map, possibly not needed
|
||||
m_cellIdxToFaceToConnectionIdxMap[m_connections[cnIdx].m_c1GlobIdx][fIdx].push_back(cnIdx);
|
||||
m_cellIdxToFaceToConnectionIdxMap[m_connections[cnIdx].m_c2GlobIdx][cvf::StructGridInterface::oppositeFace((cvf::StructGridInterface::FaceType)(fIdx))].push_back(cnIdx);
|
||||
|
||||
@@ -152,7 +152,7 @@ void RigNNCData::processConnections(const RigMainGrid& mainGrid)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// TODO: Possibly not needed !
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<size_t>& RigNNCData::findConnectionIndices( size_t globalCellIndex, cvf::StructGridInterface::FaceType face) const
|
||||
{
|
||||
|
||||
@@ -48,10 +48,6 @@ public:
|
||||
|
||||
std::vector<cvf::Vec3d> m_polygon;
|
||||
|
||||
/* enum NNCType
|
||||
{
|
||||
|
||||
};*/
|
||||
};
|
||||
|
||||
|
||||
@@ -61,14 +57,16 @@ class RigNNCData : public cvf::Object
|
||||
public:
|
||||
RigNNCData();
|
||||
|
||||
const std::vector<size_t>& findConnectionIndices(size_t globalCellIndex, cvf::StructGridInterface::FaceType face) const;
|
||||
void processConnections(const RigMainGrid& mainGrid);
|
||||
|
||||
std::vector<RigConnection>& connections() { return m_connections; }
|
||||
const std::vector<RigConnection>& connections() const { return m_connections; };
|
||||
|
||||
private:
|
||||
private: // This section is possibly not needed
|
||||
const std::vector<size_t>& findConnectionIndices(size_t globalCellIndex, cvf::StructGridInterface::FaceType face) const;
|
||||
typedef std::map<size_t, caf::FixedArray<std::vector<size_t>, 7 > > ConnectionSearchMap;
|
||||
ConnectionSearchMap m_cellIdxToFaceToConnectionIdxMap;
|
||||
|
||||
private:
|
||||
std::vector<RigConnection> m_connections;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user