#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

@@ -45,10 +45,14 @@ RigConnection::RigConnection( unsigned c1GlobIdx,
if ( c1GlobIdx >= c2GlobIdx )
{
// Ensure the smallest cell index is the first index
// TODO : The face type is related to cell 1, so face should be changed to opposite face
// This causes visual artifacts for some models, so this change will require more investigation
m_c1GlobIdx = c2GlobIdx;
m_c2GlobIdx = c1GlobIdx;
if ( c1Face != cvf::StructGridInterface::FaceType::NO_FACE )
{
// The face type is related to cell 1, so use opposite face
m_c1Face = cvf::StructGridInterface::oppositeFace( c1Face );
}
}
}
@@ -69,10 +73,14 @@ RigConnection::RigConnection( size_t c1GlobIdx,
if ( c1GlobIdx >= c2GlobIdx )
{
// Ensure the smallest cell index is the first index
// TODO : The face type is related to cell 1, so face should be changed to opposite face
// This causes visual artifacts for some models, so this change will require more investigation
m_c1GlobIdx = static_cast<unsigned>( c2GlobIdx );
m_c2GlobIdx = static_cast<unsigned>( c1GlobIdx );
if ( c1Face != cvf::StructGridInterface::FaceType::NO_FACE )
{
// The face type is related to cell 1, so use opposite face
m_c1Face = cvf::StructGridInterface::oppositeFace( c1Face );
}
}
}