Privatize grid cell array

This commit is contained in:
jonjenssen
2024-10-23 20:43:08 +02:00
committed by jonjenssen
parent 69878f54d3
commit 88118ee4e1
49 changed files with 418 additions and 326 deletions

View File

@@ -93,9 +93,11 @@ bool RimFractureContainment::isEclipseCellOpenForFlow( const RigMainGrid* m
{
CVF_ASSERT( mainGrid );
if ( globalCellIndex >= mainGrid->globalCellArray().size() ) return false;
if ( globalCellIndex >= mainGrid->totalCellCount() ) return false;
auto& cell = mainGrid->cell( globalCellIndex );
if ( cell.isInvalid() ) return false;
auto cell = mainGrid->globalCellArray()[globalCellIndex];
auto mainGridCellIndex = cell.mainGridCellIndex();
size_t i, j, k;

View File

@@ -332,8 +332,7 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimEclipseView* eclipseView )
}
else if ( eclipseView->mainGrid() )
{
QString totCellCount =
localeWithSpaceAsGroupSeparator.toString( static_cast<int>( eclipseView->mainGrid()->globalCellArray().size() ) );
QString totCellCount = localeWithSpaceAsGroupSeparator.toString( static_cast<int>( eclipseView->mainGrid()->totalCellCount() ) );
size_t mxActCellCount =
eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->reservoirActiveCellCount();

View File

@@ -389,7 +389,7 @@ std::vector<size_t> RimEclipseContourMapProjection::findIntersectingCells( const
//--------------------------------------------------------------------------------------------------
size_t RimEclipseContourMapProjection::kLayer( size_t globalCellIdx ) const
{
const RigCell& cell = m_mainGrid->globalCellArray()[globalCellIdx];
const RigCell& cell = m_mainGrid->cell( globalCellIdx );
size_t mainGridCellIdx = cell.mainGridCellIndex();
size_t i, j, k;
m_mainGrid->ijkFromCellIndex( mainGridCellIdx, &i, &j, &k );
@@ -411,7 +411,7 @@ double RimEclipseContourMapProjection::calculateOverlapVolume( size_t globalCell
{
std::array<cvf::Vec3d, 8> hexCorners;
const RigCell& cell = m_mainGrid->globalCellArray()[globalCellIdx];
const RigCell& cell = m_mainGrid->cell( globalCellIdx );
size_t localCellIdx = cell.gridLocalCellIndex();
RigGridBase* localGrid = cell.hostGrid();
@@ -437,7 +437,7 @@ double RimEclipseContourMapProjection::calculateRayLengthInCell( size_t
{
std::array<cvf::Vec3d, 8> hexCorners;
RigCell cell = m_mainGrid->globalCellArray()[globalCellIdx];
RigCell cell = m_mainGrid->cell( globalCellIdx );
size_t localCellIdx = cell.gridLocalCellIndex();
RigGridBase* localGrid = cell.hostGrid();

View File

@@ -401,7 +401,7 @@ RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator( const std:
{
if ( !sourceCases.empty() )
{
m_reservoirCellCount = sourceCases[0]->eclipseCaseData()->mainGrid()->globalCellArray().size();
m_reservoirCellCount = sourceCases[0]->eclipseCaseData()->mainGrid()->totalCellCount();
}
CVF_ASSERT( m_destinationCase );

View File

@@ -2345,7 +2345,7 @@ void RimEclipseView::setOverridePropertyFilterCollection( RimEclipsePropertyFilt
//--------------------------------------------------------------------------------------------------
void RimEclipseView::calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep )
{
size_t cellCount = mainGrid()->globalCellArray().size();
size_t cellCount = mainGrid()->totalCellCount();
totalVisibility->resize( cellCount );
totalVisibility->setAll( false );
@@ -2376,7 +2376,7 @@ void RimEclipseView::calculateCellVisibility( cvf::UByteArray* visibility, std::
{
if ( !mainGrid() ) return;
size_t cellCount = mainGrid()->globalCellArray().size();
size_t cellCount = mainGrid()->totalCellCount();
visibility->resize( cellCount );
visibility->setAll( false );

View File

@@ -267,8 +267,8 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells()
return;
}
m_unionOfMatrixActiveCells->setReservoirCellCount( m_mainGrid->globalCellArray().size() );
m_unionOfFractureActiveCells->setReservoirCellCount( m_mainGrid->globalCellArray().size() );
m_unionOfMatrixActiveCells->setReservoirCellCount( m_mainGrid->totalCellCount() );
m_unionOfFractureActiveCells->setReservoirCellCount( m_mainGrid->totalCellCount() );
m_unionOfMatrixActiveCells->setGridCount( m_mainGrid->gridCount() );
m_unionOfFractureActiveCells->setGridCount( m_mainGrid->gridCount() );