mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Export Completion: Fix missing segments and connections for LGR grids
* Compute characteristic cell size based on active cells * Compute cell face normal based on a suitable active cells Using all cells as basis for face normal is fragile. Some models have highly distorted/twisted cells, but all active cells should be geometrically more stable.
This commit is contained in:
@@ -979,6 +979,27 @@ bool RimEclipseCase::openReserviorCase()
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( eclipseCaseData() && eclipseCaseData()->mainGrid() &&
|
||||
!eclipseCaseData()->mainGrid()->hasValidCharacteristicCellSizes() )
|
||||
{
|
||||
RigMainGrid* mainGrid = eclipseCaseData()->mainGrid();
|
||||
|
||||
auto activeCellInfo = eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
if ( activeCellInfo )
|
||||
{
|
||||
std::vector<size_t> reservoirCellIndices;
|
||||
for ( size_t i = 0; i < mainGrid->cellCount(); i++ )
|
||||
{
|
||||
if ( activeCellInfo->isActive( i ) )
|
||||
{
|
||||
reservoirCellIndices.push_back( i );
|
||||
}
|
||||
}
|
||||
mainGrid->computeCharacteristicCellSize( reservoirCellIndices );
|
||||
mainGrid->computeFaceNormalsDirection( reservoirCellIndices );
|
||||
}
|
||||
}
|
||||
|
||||
bool createPlaceholderEntries = true;
|
||||
if ( dynamic_cast<RimEclipseStatisticsCase*>( this ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user