mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added global cell indices to faults and added optimalizations
This commit is contained in:
@@ -118,7 +118,15 @@ void RigFault::computeFaultFacesFromCellRanges(const RigMainGrid* grid)
|
||||
// Do not need to compute global grid cell index as for a maingrid localIndex == globalIndex
|
||||
//size_t globalCellIndex = grid->globalGridCellIndex(localCellIndex);
|
||||
|
||||
m_faultFaces.push_back(FaultFace(localCellIndex, faceEnum));
|
||||
cvf::StructGridInterface::FaceType oppositeFace = grid->oppositeFace(faceEnum);
|
||||
|
||||
size_t ni, nj, nk;
|
||||
grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
||||
grid->neighborIJKAtCellFace(i, j, k, faceEnum, &ni, &nj, &nk);
|
||||
|
||||
size_t oppositeCellIndex = grid->cellIndexFromIJK(ni, nj, nk);
|
||||
|
||||
m_faultFaces.push_back(FaultFace(localCellIndex, faceEnum, oppositeCellIndex, oppositeFace));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,13 +39,17 @@ public:
|
||||
|
||||
struct FaultFace
|
||||
{
|
||||
FaultFace(size_t globalCellIndex, cvf::StructGridInterface::FaceType face) :
|
||||
m_globalCellIndex(globalCellIndex),
|
||||
m_face(face)
|
||||
{ }
|
||||
FaultFace(size_t nativeGlobalCellIndex, cvf::StructGridInterface::FaceType nativeFace, size_t oppositeGlobalCellIndex, cvf::StructGridInterface::FaceType oppositeFace) :
|
||||
m_nativeGlobalCellIndex(nativeGlobalCellIndex),
|
||||
m_nativeFace(nativeFace),
|
||||
m_oppositeGlobalCellIndex(oppositeGlobalCellIndex),
|
||||
m_oppositeFace(oppositeFace)
|
||||
{ }
|
||||
|
||||
size_t m_globalCellIndex;
|
||||
cvf::StructGridInterface::FaceType m_face;
|
||||
size_t m_nativeGlobalCellIndex;
|
||||
cvf::StructGridInterface::FaceType m_nativeFace;
|
||||
size_t m_oppositeGlobalCellIndex;
|
||||
cvf::StructGridInterface::FaceType m_oppositeFace;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -545,7 +545,8 @@ void RigGridBase::setFaults(const cvf::Collection<RigFault>& faults)
|
||||
{
|
||||
m_faults = faults;
|
||||
|
||||
for (size_t i = 0; i < m_faults.size(); i++)
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < m_faults.size(); i++)
|
||||
{
|
||||
m_faults[i]->computeFaultFacesFromCellRanges(this->mainGrid());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user