#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

@@ -304,8 +304,18 @@ void RigCellFaceGeometryTools::extractConnectionsForFace( const RigFault::FaultF
}
}
std::pair<unsigned, unsigned> candidate( static_cast<unsigned>( sourceReservoirCellIndex ),
static_cast<unsigned>( candidateCellIndex ) );
// Test if this pair of cells already has a connection. Check both combinations of cell index ordering to avoid
// duplicate NNC geometry for the same pair of cells
auto candidate = std::make_pair( static_cast<unsigned>( sourceReservoirCellIndex ),
static_cast<unsigned>( candidateCellIndex ) );
if ( nativeCellPairs.count( candidate ) > 0 )
{
continue;
}
std::swap( candidate.first, candidate.second );
if ( nativeCellPairs.count( candidate ) > 0 )
{