#8371 Make sure all NNC faces are created and assigned

Make sure that the first cell in RigConnection is assigned the lowest cell index. Assign the opposite face if the cell indexes are swapped.
In RigCellFaceGeometryTools, test both combinations of (cellA, cellB) and (cellB, cellA)
This commit is contained in:
Magne Sjaastad
2021-12-16 11:52:04 +01:00
parent 19dc7493a8
commit 8ad2ffa471
5 changed files with 58 additions and 25 deletions

View File

@@ -203,3 +203,33 @@ void RigFault::accumulateFaultsPrCell( RigFaultsPrCellAccumulator* faultsPrCellA
faultIdx );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFaultsPrCellAccumulator::RigFaultsPrCellAccumulator( size_t reservoirCellCount )
{
std::array<int, 6> initVals = { NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT };
m_faultIdxForCellFace.resize( reservoirCellCount, initVals );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RigFaultsPrCellAccumulator::faultIdx( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const
{
// Ensure no crash after creating temporary LGRs
if ( reservoirCellIndex < m_faultIdxForCellFace.size() )
{
return m_faultIdxForCellFace[reservoirCellIndex][face];
}
return NO_FAULT;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFaultsPrCellAccumulator::setFaultIdx( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face, int faultIdx )
{
m_faultIdxForCellFace[reservoirCellIndex][face] = faultIdx;
}