Work in progress

This commit is contained in:
Jon Jenssen 2024-09-11 18:18:07 +02:00 committed by jonjenssen
parent 2d5cedb5d9
commit 99fa28f284
34 changed files with 174 additions and 152 deletions

View File

@ -694,7 +694,7 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const
for ( auto intersectionIndex : indices )
{
auto intersection = filteredIntersections[intersectionIndex];
// if ( intersection.globCellIndex >= mainGrid->globalCellArray().size() ) continue;
if ( intersection.globCellIndex >= mainGrid->globalCellCount() ) continue;
size_t localGridCellIndex = 0u;
const RigGridBase* localGrid =

View File

@ -238,7 +238,7 @@ void RifReaderOpmCommonActive::transferActiveGeometry( Opm::EclIO::EGrid& opmMa
auto riReservoirIndex = activeGrid->cellIndexFromIJK( opmIJK[0], opmIJK[1], opmIJK[2] );
RigCell& cell = activeGrid->cell( riReservoirIndex );
auto actualIndex = activeGrid->globalToActualCellIndex( riReservoirIndex );
auto nativeIndex = activeGrid->globalCellIndexToNative( riReservoirIndex );
cell.setGridLocalCellIndex( riReservoirIndex );
cell.setParentCellIndex( cvf::UNDEFINED_SIZE_T );
@ -249,7 +249,7 @@ void RifReaderOpmCommonActive::transferActiveGeometry( Opm::EclIO::EGrid& opmMa
opmMainGrid.getCellCorners( opmCellIndex, opmX, opmY, opmZ );
// Each cell has 8 nodes, use active cell index and multiply to find first node index for cell
auto riNodeStartIndex = actualIndex * 8;
auto riNodeStartIndex = nativeIndex * 8;
for ( size_t opmNodeIndex = 0; opmNodeIndex < 8; opmNodeIndex++ )
{

View File

@ -93,10 +93,10 @@ bool RimFractureContainment::isEclipseCellOpenForFlow( const RigMainGrid* m
{
CVF_ASSERT( mainGrid );
// if ( globalCellIndex >= mainGrid->globalCellArray().size() ) return false;
if ( globalCellIndex >= mainGrid->globalCellCount() ) return false;
auto cell = mainGrid->cell( globalCellIndex );
auto mainGridCellIndex = cell.mainGridCellIndex();
auto& cell = mainGrid->cell( globalCellIndex );
auto mainGridCellIndex = cell.mainGridCellIndex();
size_t i, j, k;
mainGrid->ijkFromCellIndex( mainGridCellIndex, &i, &j, &k );

View File

@ -78,10 +78,9 @@ void RigFaultDistanceResultCalculator::calculate( const RigEclipseResultAddress&
if ( !shouldCompute ) return;
const std::vector<RigCell>& globalCellArray = m_resultsData->m_ownerMainGrid->globalCellArray();
const auto grid = m_resultsData->m_ownerMainGrid;
const auto grid = m_resultsData->m_ownerMainGrid;
long long numCells = static_cast<long long>( m_resultsData->m_ownerMainGrid->cellCount() );
long long numCells = static_cast<long long>( grid->cellCount() );
std::vector<cvf::StructGridInterface::FaceType> faceTypes = cvf::StructGridInterface::validFaceTypes();
@ -91,7 +90,7 @@ void RigFaultDistanceResultCalculator::calculate( const RigEclipseResultAddress&
{
if ( m_resultsData->activeCellInfo()->isActive( cellIdx ) )
{
const RigCell& cell = globalCellArray[cellIdx];
const RigCell& cell = grid->cell( cellIdx );
for ( auto faceType : faceTypes )
{
if ( m_resultsData->m_ownerMainGrid->findFaultFromCellIndexAndCellFace( cellIdx, faceType ) )
@ -119,13 +118,13 @@ void RigFaultDistanceResultCalculator::calculate( const RigEclipseResultAddress&
searchTree->buildTreeFromBoundingBoxes( faceBBs, &faceIndicesForBoundingBoxes );
}
const auto nodes = m_resultsData->m_ownerMainGrid->nodes();
const auto mainGridBB = m_resultsData->m_ownerMainGrid->boundingBox();
const auto& nodes = m_resultsData->m_ownerMainGrid->nodes();
const auto mainGridBB = m_resultsData->m_ownerMainGrid->boundingBox();
#pragma omp parallel for
for ( long long cellIdx = 0; cellIdx < numCells; cellIdx++ )
{
const RigCell& cell = globalCellArray[cellIdx];
const RigCell& cell = grid->nativeCell( cellIdx );
size_t resultIndex = cellIdx;
if ( resultIndex == cvf::UNDEFINED_SIZE_T || !m_resultsData->activeCellInfo()->isActive( cellIdx ) ) continue;

View File

@ -98,14 +98,14 @@ void RigIndexIjkResultCalculator::calculate( const RigEclipseResultAddress& resV
if ( !( computeIndexI || computeIndexJ || computeIndexK ) ) return;
const std::vector<RigCell>& globalCellArray = m_resultsData->m_ownerMainGrid->globalCellArray();
long long numCells = static_cast<long long>( globalCellArray.size() );
auto mainGrid = m_resultsData->m_ownerMainGrid;
long long numCells = mainGrid->cellCount();
#pragma omp parallel for
for ( long long cellIdx = 0; cellIdx < numCells; cellIdx++ )
for ( long long nativeCellIdx = 0; nativeCellIdx < numCells; nativeCellIdx++ )
{
const RigCell& cell = globalCellArray[cellIdx];
const RigCell& cell = mainGrid->nativeCell( nativeCellIdx );
size_t resultIndex = cellIdx;
size_t resultIndex = nativeCellIdx;
if ( resultIndex == cvf::UNDEFINED_SIZE_T ) continue;
bool isTemporaryGrid = cell.hostGrid()->isTempGrid();

View File

@ -66,6 +66,8 @@ void RigOilVolumeResultCalculator::calculate( const RigEclipseResultAddress& res
false );
m_resultsData->m_cellScalarResults[oilVolIdx].resize( m_resultsData->maxTimeStepCount() );
auto mainGrid = m_resultsData->m_ownerMainGrid;
size_t cellResultCount = m_resultsData->m_activeCellInfo->reservoirActiveCellCount();
for ( size_t timeStepIdx = 0; timeStepIdx < m_resultsData->maxTimeStepCount(); timeStepIdx++ )
{
@ -74,8 +76,7 @@ void RigOilVolumeResultCalculator::calculate( const RigEclipseResultAddress& res
oilVolumeResults.resize( cellResultCount, 0u );
#pragma omp parallel for
for ( int nativeResvCellIndex = 0; nativeResvCellIndex < static_cast<int>( m_resultsData->m_ownerMainGrid->globalCellArray().size() );
nativeResvCellIndex++ )
for ( int nativeResvCellIndex = 0; nativeResvCellIndex < (int)mainGrid->cellCount(); nativeResvCellIndex++ )
{
size_t resultIndex = m_resultsData->activeCellInfo()->cellResultIndex( nativeResvCellIndex );
if ( resultIndex != cvf::UNDEFINED_SIZE_T )

View File

@ -21,6 +21,8 @@
#include "RigActiveCellInfo.h"
#include "RigEclipseCaseData.h"
#include "cvfAssert.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -155,6 +157,8 @@ void RigActiveCellGrid::transferActiveInformation( int gridI
//--------------------------------------------------------------------------------------------------
RigCell& RigActiveCellGrid::cell( size_t gridLocalCellIndex )
{
CVF_ASSERT( gridLocalCellIndex < m_globalToActiveMap.size() );
const auto index = m_globalToActiveMap[gridLocalCellIndex];
return m_cells[index];
}
@ -164,6 +168,8 @@ RigCell& RigActiveCellGrid::cell( size_t gridLocalCellIndex )
//--------------------------------------------------------------------------------------------------
const RigCell& RigActiveCellGrid::cell( size_t gridLocalCellIndex ) const
{
CVF_ASSERT( gridLocalCellIndex < m_globalToActiveMap.size() );
const auto index = m_globalToActiveMap[gridLocalCellIndex];
return m_cells[index];
}
@ -171,17 +177,41 @@ const RigCell& RigActiveCellGrid::cell( size_t gridLocalCellIndex ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigActiveCellGrid::globalToActualCellIndex( size_t globalCellIndex ) const
RigCell& RigActiveCellGrid::nativeCell( size_t nativeCellIndex )
{
CVF_ASSERT( nativeCellIndex < m_cells.size() );
return m_cells[nativeCellIndex];
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigCell& RigActiveCellGrid::nativeCell( size_t nativeCellIndex ) const
{
CVF_ASSERT( nativeCellIndex < m_cells.size() );
return m_cells[nativeCellIndex];
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigActiveCellGrid::globalCellIndexToNative( size_t globalCellIndex ) const
{
CVF_ASSERT( globalCellIndex < m_globalToActiveMap.size() );
return m_globalToActiveMap[globalCellIndex];
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigActiveCellGrid::actualToGlobalCellIndex( size_t actualCellIndex ) const
size_t RigActiveCellGrid::nativeCellIndexToGlobal( size_t nativeCellIndex ) const
{
return m_activeToGlobalMap[actualCellIndex];
CVF_ASSERT( nativeCellIndex < m_globalToActiveMap.size() );
return m_activeToGlobalMap[nativeCellIndex];
}
//--------------------------------------------------------------------------------------------------

View File

@ -44,8 +44,11 @@ public:
RigCell& cell( size_t gridLocalCellIndex ) override;
const RigCell& cell( size_t gridLocalCellIndex ) const override;
size_t globalToActualCellIndex( size_t globalCellIndex ) const override;
size_t actualToGlobalCellIndex( size_t actualCellIndex ) const override;
RigCell& nativeCell( size_t nativeCellIndex ) override;
const RigCell& nativeCell( size_t nativeCellIndex ) const override;
size_t globalCellIndexToNative( size_t globalCellIndex ) const override;
size_t nativeCellIndexToGlobal( size_t nativeCellIndex ) const override;
size_t cellCount() const override;

View File

@ -512,8 +512,9 @@ bool RigCaseCellResultsData::isUsingGlobalActiveIndex( const RigEclipseResultAdd
if ( m_cellScalarResults[scalarResultIndex].empty() ) return true;
// TODO - handle that some timesteps (in this case step 0) might be missing data!
size_t firstTimeStepResultValueCount = m_cellScalarResults[scalarResultIndex][0].size();
return firstTimeStepResultValueCount != m_ownerMainGrid->globalCellArray().size();
return firstTimeStepResultValueCount != m_ownerMainGrid->cellCount();
}
//--------------------------------------------------------------------------------------------------
@ -1865,11 +1866,11 @@ void RigCaseCellResultsData::computeDepthRelatedResults()
}
#pragma omp parallel for
for ( long cellIdx = 0; cellIdx < static_cast<long>( m_ownerMainGrid->globalCellArray().size() ); cellIdx++ )
for ( int nativeCellIdx = 0; nativeCellIdx < (int)m_ownerMainGrid->cellCount(); nativeCellIdx++ )
{
const RigCell& cell = m_ownerMainGrid->globalCellArray()[cellIdx];
const RigCell& cell = m_ownerMainGrid->nativeCell( nativeCellIdx );
size_t resultIndex = activeCellInfo()->cellResultIndex( cellIdx );
size_t resultIndex = activeCellInfo()->cellResultIndex( nativeCellIdx );
if ( resultIndex == cvf::UNDEFINED_SIZE_T ) continue;
bool isTemporaryGrid = cell.hostGrid()->isTempGrid();
@ -2130,14 +2131,14 @@ void RigCaseCellResultsData::computeRiTransComponent( const QString& riTransComp
const std::vector<cvf::Vec3d>& nodes = m_ownerMainGrid->nodes();
bool isFaceNormalsOutwards = m_ownerMainGrid->isFaceNormalsOutwards();
for ( size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->globalCellArray().size(); nativeResvCellIndex++ )
for ( size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->cellCount(); nativeResvCellIndex++ )
{
// Do nothing if we are only dealing with active cells, and this cell is not active:
size_t tranResIdx = ( *riTranIdxFunc )( activeCellInfo, nativeResvCellIndex );
if ( tranResIdx == cvf::UNDEFINED_SIZE_T ) continue;
const RigCell& nativeCell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
const RigCell& nativeCell = m_ownerMainGrid->nativeCell( nativeResvCellIndex );
RigGridBase* grid = nativeCell.hostGrid();
size_t gridLocalNativeCellIndex = nativeCell.gridLocalCellIndex();
@ -2149,7 +2150,7 @@ void RigCaseCellResultsData::computeRiTransComponent( const QString& riTransComp
if ( grid->cellIJKNeighbor( i, j, k, faceId, &gridLocalNeighborCellIdx ) )
{
size_t neighborResvCellIdx = grid->reservoirCellIndex( gridLocalNeighborCellIdx );
const RigCell& neighborCell = m_ownerMainGrid->globalCellArray()[neighborResvCellIdx];
const RigCell& neighborCell = m_ownerMainGrid->cell( neighborResvCellIdx );
// Do nothing if neighbor cell has no results
size_t neighborCellPermResIdx = ( *permIdxFunc )( activeCellInfo, neighborResvCellIdx );
@ -2283,8 +2284,8 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
const RigConnectionContainer& nncConnections = m_ownerMainGrid->nncData()->allConnections();
for ( size_t connIdx = 0; connIdx < nncConnections.size(); connIdx++ )
{
size_t nativeResvCellIndex = nncConnections[connIdx].c1GlobIdx();
size_t neighborResvCellIdx = nncConnections[connIdx].c2GlobIdx();
size_t nativeResvCellIndex = m_ownerMainGrid->globalCellIndexToNative( nncConnections[connIdx].c1GlobIdx() );
size_t neighborResvCellIdx = m_ownerMainGrid->globalCellIndexToNative( nncConnections[connIdx].c2GlobIdx() );
cvf::StructGridInterface::FaceType faceId = static_cast<cvf::StructGridInterface::FaceType>( nncConnections[connIdx].face() );
ResultIndexFunction permIdxFunc = nullptr;
@ -2321,8 +2322,8 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
size_t neighborCellPermResIdx = ( *permIdxFunc )( activeCellInfo, neighborResvCellIdx );
if ( neighborCellPermResIdx == cvf::UNDEFINED_SIZE_T ) continue;
const RigCell& nativeCell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
const RigCell& neighborCell = m_ownerMainGrid->globalCellArray()[neighborResvCellIdx];
const RigCell& nativeCell = m_ownerMainGrid->nativeCell( nativeResvCellIndex );
const RigCell& neighborCell = m_ownerMainGrid->nativeCell( neighborResvCellIdx );
// Connection geometry
@ -2565,14 +2566,14 @@ void RigCaseCellResultsData::computeRiTRANSbyAreaComponent( const QString& riTra
const RigActiveCellInfo* activeCellInfo = this->activeCellInfo();
const std::vector<cvf::Vec3d>& nodes = m_ownerMainGrid->nodes();
for ( size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->globalCellArray().size(); nativeResvCellIndex++ )
for ( size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->cellCount(); nativeResvCellIndex++ )
{
// Do nothing if we are only dealing with active cells, and this cell is not active:
size_t nativeCellResValIdx = ( *resValIdxFunc )( activeCellInfo, nativeResvCellIndex );
if ( nativeCellResValIdx == cvf::UNDEFINED_SIZE_T ) continue;
const RigCell& nativeCell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
const RigCell& nativeCell = m_ownerMainGrid->nativeCell( nativeResvCellIndex );
RigGridBase* grid = nativeCell.hostGrid();
size_t gridLocalNativeCellIndex = nativeCell.gridLocalCellIndex();
@ -2584,7 +2585,7 @@ void RigCaseCellResultsData::computeRiTRANSbyAreaComponent( const QString& riTra
if ( grid->cellIJKNeighbor( i, j, k, faceId, &gridLocalNeighborCellIdx ) )
{
size_t neighborResvCellIdx = grid->reservoirCellIndex( gridLocalNeighborCellIdx );
const RigCell& neighborCell = m_ownerMainGrid->globalCellArray()[neighborResvCellIdx];
const RigCell& neighborCell = m_ownerMainGrid->cell( neighborResvCellIdx );
// Connection geometry
@ -2660,7 +2661,7 @@ void RigCaseCellResultsData::computeCompletionTypeForTimeStep( size_t timeStep )
std::vector<double>& completionTypeResult = m_cellScalarResults[completionTypeResultIndex][timeStep];
size_t resultValues = m_ownerMainGrid->globalCellArray().size();
size_t resultValues = m_ownerMainGrid->cellCount();
if ( completionTypeResult.size() == resultValues )
{
@ -2783,7 +2784,7 @@ void RigCaseCellResultsData::setActiveFormationNames( RigFormationNames* activeF
return;
}
size_t totalGlobCellCount = m_ownerMainGrid->globalCellArray().size();
size_t totalGlobCellCount = m_ownerMainGrid->cellCount();
addStaticScalarResult( RiaDefines::ResultCatType::FORMATION_NAMES, RiaResultNames::activeFormationNamesResultName(), false, totalGlobCellCount );
std::vector<double>* fnData = modifiableCellScalarResult( RigEclipseResultAddress( RiaDefines::ResultCatType::FORMATION_NAMES,
@ -2819,7 +2820,7 @@ void RigCaseCellResultsData::setActiveFormationNames( RigFormationNames* activeF
for ( size_t cIdx = localCellCount; cIdx < totalGlobCellCount; ++cIdx )
{
size_t mgrdCellIdx = m_ownerMainGrid->globalCellArray()[cIdx].mainGridCellIndex();
size_t mgrdCellIdx = m_ownerMainGrid->nativeCell( cIdx ).mainGridCellIndex();
size_t i( cvf::UNDEFINED_SIZE_T ), j( cvf::UNDEFINED_SIZE_T ), k( cvf::UNDEFINED_SIZE_T );

View File

@ -33,7 +33,7 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper( RigMainGrid* masterEclGrid, Ri
, m_masterFemPart( nullptr )
, m_dependentFemPart( nullptr )
{
m_masterCellOrIntervalIndex.resize( dependentEclGrid->globalCellArray().size(), cvf::UNDEFINED_INT );
m_masterCellOrIntervalIndex.resize( dependentEclGrid->cellCount(), cvf::UNDEFINED_INT );
}
//--------------------------------------------------------------------------------------------------
@ -45,7 +45,7 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper( RigFemPart* masterFemPart, Rig
, m_masterFemPart( masterFemPart )
, m_dependentFemPart( nullptr )
{
m_masterCellOrIntervalIndex.resize( dependentEclGrid->globalCellArray().size(), cvf::UNDEFINED_INT );
m_masterCellOrIntervalIndex.resize( dependentEclGrid->cellCount(), cvf::UNDEFINED_INT );
calculateEclToGeomCellMapping( dependentEclGrid, masterFemPart, false );
}

View File

@ -51,7 +51,7 @@ public:
if ( offsetK > 0 && m_baseK == m_mainGrid->cellCountK() - 1 ) return nullptr;
size_t gridLocalCellIndex = m_mainGrid->cellIndexFromIJK( m_baseI + offsetI, m_baseJ + offsetJ, m_baseK + offsetK );
const RigCell& cell = m_mainGrid->globalCellArray()[gridLocalCellIndex];
const RigCell& cell = m_mainGrid->cell( gridLocalCellIndex );
return &( cell.cornerIndices() );
}

View File

@ -373,7 +373,7 @@ RigCaseToCaseRangeFilterMapper::CellMatchType RigCaseToCaseRangeFilterMapper::fi
size_t cellIdx = masterEclGrid->cellIndexFromIJK( ei, ej, ek );
bool isCollapsedCell = masterEclGrid->globalCellArray()[cellIdx].isCollapsedCell();
bool isCollapsedCell = masterEclGrid->cell( cellIdx ).isCollapsedCell();
cvf::Vec3d geoMechConvertedEclCell[8];
RigCaseToCaseCellMapperTools::estimatedFemCellFromEclCell( masterEclGrid, cellIdx, geoMechConvertedEclCell );
@ -512,7 +512,7 @@ RigCaseToCaseRangeFilterMapper::CellMatchType RigCaseToCaseRangeFilterMapper::fi
if ( globCellIdxToBestMatch != cvf::UNDEFINED_SIZE_T )
{
masterEclGrid->ijkFromCellIndex( globCellIdxToBestMatch, ei, ej, ek );
isCollapsedCell = masterEclGrid->globalCellArray()[globCellIdxToBestMatch].isCollapsedCell();
isCollapsedCell = masterEclGrid->cell( globCellIdxToBestMatch ).isCollapsedCell();
}
else
{

View File

@ -229,7 +229,7 @@ void RigCellFaceGeometryTools::extractConnectionsForFace( const RigFault::FaultF
cvf::BoundingBox bb;
std::array<size_t, 4> sourceFaceIndices;
mainGrid->globalCellArray()[sourceReservoirCellIndex].faceIndices( sourceCellFace, &sourceFaceIndices );
mainGrid->cell( sourceReservoirCellIndex ).faceIndices( sourceCellFace, &sourceFaceIndices );
bb.add( mainGridNodes[sourceFaceIndices[0]] );
bb.add( mainGridNodes[sourceFaceIndices[1]] );
@ -267,10 +267,10 @@ void RigCellFaceGeometryTools::extractConnectionsForFace( const RigFault::FaultF
continue;
}
if ( candidateCellIndex >= mainGrid->cellCount() )
{
continue;
}
// if ( candidateCellIndex >= mainGrid->cellCount() )
//{
// continue;
// }
if ( candidateCellIndex == neighborCellIndex )
{
@ -333,7 +333,7 @@ void RigCellFaceGeometryTools::extractConnectionsForFace( const RigFault::FaultF
std::vector<cvf::Vec3d> intersections;
std::array<size_t, 4> candidateFaceIndices;
mainGrid->globalCellArray()[candidateCellIndex].faceIndices( candidateFace, &candidateFaceIndices );
mainGrid->cell( candidateCellIndex ).faceIndices( candidateFace, &candidateFaceIndices );
bool foundOverlap = cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads( &polygon,
&intersections,

View File

@ -77,7 +77,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
cvf::Vec3d hexCorners[8];
for ( const auto& globalCellIndex : closeCellIndices )
{
const RigCell& cell = m_caseData->mainGrid()->globalCellArray()[globalCellIndex];
const RigCell& cell = m_caseData->mainGrid()->cell( globalCellIndex );
if ( cell.isInvalid() || cell.subGrid() != nullptr ) continue;
@ -123,7 +123,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
cvf::Vec3d hexCorners[8];
for ( const auto& globalCellIndex : closeCellIndices )
{
const RigCell& cell = m_caseData->mainGrid()->globalCellArray()[globalCellIndex];
const RigCell& cell = m_caseData->mainGrid()->cell( globalCellIndex );
if ( cell.isInvalid() ) continue;

View File

@ -84,9 +84,9 @@ RigCell& RigGridBase::cell( size_t gridLocalCellIndex )
{
CVF_ASSERT( m_mainGrid );
CVF_ASSERT( m_indexToStartOfCells + gridLocalCellIndex < m_mainGrid->globalCellArray().size() );
CVF_ASSERT( m_indexToStartOfCells + gridLocalCellIndex < m_mainGrid->globalCellCount() );
return m_mainGrid->globalCellArray()[m_indexToStartOfCells + gridLocalCellIndex];
return m_mainGrid->reservoirCells()[m_indexToStartOfCells + gridLocalCellIndex];
}
//--------------------------------------------------------------------------------------------------
@ -96,23 +96,9 @@ const RigCell& RigGridBase::cell( size_t gridLocalCellIndex ) const
{
CVF_ASSERT( m_mainGrid );
return m_mainGrid->globalCellArray()[m_indexToStartOfCells + gridLocalCellIndex];
}
CVF_ASSERT( m_indexToStartOfCells + gridLocalCellIndex < m_mainGrid->globalCellCount() );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigGridBase::globalToActualCellIndex( size_t globalCellIndex ) const
{
return globalCellIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigGridBase::actualToGlobalCellIndex( size_t actualCellIndex ) const
{
return actualCellIndex;
return m_mainGrid->reservoirCells()[m_indexToStartOfCells + gridLocalCellIndex];
}
//--------------------------------------------------------------------------------------------------
@ -563,6 +549,14 @@ size_t RigGridBase::cellCountK() const
///
//--------------------------------------------------------------------------------------------------
size_t RigGridBase::cellCount() const
{
return globalCellCount();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigGridBase::globalCellCount() const
{
return cellCountI() * cellCountJ() * cellCountK();
}
@ -612,8 +606,9 @@ bool RigGridCellFaceVisibilityFilter::isFaceVisible( size_t
return false;
}
auto nativeCellIndex = m_grid->globalCellIndexToNative( neighborCellIndex );
// If the neighbour cell is invisible, we need to draw the face
if ( ( cellVisibility != nullptr ) && !( *cellVisibility )[neighborCellIndex] )
if ( ( cellVisibility != nullptr ) && !( *cellVisibility )[nativeCellIndex] )
{
return true;
}

View File

@ -52,12 +52,23 @@ public:
size_t cellCountJ() const override;
size_t cellCountK() const override;
virtual size_t cellCount() const;
virtual RigCell& cell( size_t actualCellIndex );
virtual const RigCell& cell( size_t actualCellIndex ) const;
virtual size_t cellCount() const; // number of cells in the cell array, could be different from countI x countJ x countK
virtual size_t globalToActualCellIndex( size_t globalCellIndex ) const;
virtual size_t actualToGlobalCellIndex( size_t actualCellIndex ) const;
virtual size_t globalCellCount() const; // number of cells in the global grid (countI x countJ x countK)
// Cell index naming:
// - global cell index is the cell index in the IJK global grid
// - native cell index is the cell index in the cell array, which is the same index if all cells are present,
// but could be different if i.e. only active cells are loaded
virtual RigCell& cell( size_t globalCellIndex );
virtual const RigCell& cell( size_t globalCellIndex ) const;
virtual RigCell& nativeCell( size_t nativeCellIndex ) { return cell( nativeCellIndex ); };
virtual const RigCell& nativeCell( size_t nativeCellIndex ) const { return cell( nativeCellIndex ); };
virtual size_t globalCellIndexToNative( size_t globalCellIndex ) const { return globalCellIndex; };
virtual size_t nativeCellIndexToGlobal( size_t nativeIndex ) const { return nativeIndex; };
void characteristicCellSizes( double* iSize, double* jSize, double* kSize ) const override;

View File

@ -87,22 +87,6 @@ const std::vector<RigCell>& RigMainGrid::reservoirCells() const
return m_cells;
}
////--------------------------------------------------------------------------------------------------
/////
////--------------------------------------------------------------------------------------------------
// std::vector<RigCell>& RigMainGrid::globalCellArray()
//{
// return m_cells;
// }
//
////--------------------------------------------------------------------------------------------------
/////
////--------------------------------------------------------------------------------------------------
// const std::vector<RigCell>& RigMainGrid::globalCellArray() const
//{
// return m_cells;
// }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -535,7 +519,7 @@ void RigMainGrid::calculateFaults( const RigActiveCellInfo* activeCellInfo )
std::vector<RigFault::FaultFace>& unNamedFaultFacesInactive = unNamedFaultWithInactive->faultFaces();
for ( size_t i = 0; i < cellCount(); i++ )
{
const auto globIndex = actualToGlobalCellIndex( i );
const auto globIndex = nativeCellIndexToGlobal( i );
addUnNamedFaultFaces( (int)globIndex,
activeCellInfo,
vxs,
@ -608,7 +592,7 @@ void RigMainGrid::addUnNamedFaultFaces( int gcIdx,
continue;
}
auto activeNeighborCellIndex = hostGrid->globalToActualCellIndex( neighborGridCellIdx );
auto activeNeighborCellIndex = hostGrid->globalCellIndexToNative( neighborGridCellIdx );
bool isNeighborCellActive = activeCellInfo->isActive( activeNeighborCellIndex );
double tolerance = 1e-6;

View File

@ -48,8 +48,6 @@ public:
std::vector<RigCell>& reservoirCells();
const std::vector<RigCell>& reservoirCells() const;
// std::vector<RigCell>& globalCellArray();
// const std::vector<RigCell>& globalCellArray() const;
virtual RigGridBase* gridAndGridLocalIdxFromGlobalCellIdx( size_t globalCellIdx, size_t* gridLocalCellIdx );
virtual const RigGridBase* gridAndGridLocalIdxFromGlobalCellIdx( size_t globalCellIdx, size_t* gridLocalCellIdx ) const;

View File

@ -68,8 +68,8 @@ void RigNNCData::buildPolygonsForEclipseConnections()
#pragma omp parallel for
for ( int cnIdx = 0; cnIdx < static_cast<int>( eclipseConnectionCount() ); ++cnIdx )
{
const RigCell& c1 = m_mainGrid->globalCellArray()[m_connections[cnIdx].c1GlobIdx()];
const RigCell& c2 = m_mainGrid->globalCellArray()[m_connections[cnIdx].c2GlobIdx()];
const RigCell& c1 = m_mainGrid->cell( m_connections[cnIdx].c1GlobIdx() );
const RigCell& c2 = m_mainGrid->cell( m_connections[cnIdx].c2GlobIdx() );
std::vector<size_t> connectionPolygon;
std::vector<cvf::Vec3d> connectionIntersections;

View File

@ -197,7 +197,6 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate( RigMainGrid*
std::vector<const std::vector<double>*> flowrateNNCatAllTimeSteps,
std::vector<std::vector<double>> summedTracersAtAllTimesteps )
{
// size_t totalNumberOfCells = mainGrid->globalCellArray().size();
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
size_t resultCellCount = actCellInfo->reservoirActiveCellCount();
@ -330,15 +329,15 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNeighbourCellFlow( RigMa
{
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
for ( size_t globalCellIndex = 0; globalCellIndex < mainGrid->globalCellArray().size(); globalCellIndex++ )
for ( size_t nativeCellIndex = 0; nativeCellIndex < mainGrid->cellCount(); nativeCellIndex++ )
{
if ( !actCellInfo->isActive( globalCellIndex ) ) continue;
if ( !actCellInfo->isActive( nativeCellIndex ) ) continue;
const RigCell& cell = mainGrid->globalCellArray()[globalCellIndex];
const RigCell& cell = mainGrid->nativeCell( nativeCellIndex );
RigGridBase* hostGrid = cell.hostGrid();
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
size_t cellResultIndex = actCellInfo->cellResultIndex( globalCellIndex );
size_t cellResultIndex = actCellInfo->cellResultIndex( nativeCellIndex );
size_t i, j, k;
hostGrid->ijkFromCellIndex( gridLocalCellIndex, &i, &j, &k );

View File

@ -75,7 +75,7 @@ void RigReservoirBuilder::createGridsAndCells( RigEclipseCaseData* eclipseCase )
size_t mainGridCellCount = mainGridNodeCount / 8;
// Must create cells in main grid here, as this information is used when creating LGRs
appendCells( 0, mainGridCellCount, eclipseCase->mainGrid(), eclipseCase->mainGrid()->globalCellArray() );
appendCells( 0, mainGridCellCount, eclipseCase->mainGrid(), eclipseCase->mainGrid()->reservoirCells() );
size_t totalCellCount = mainGridCellCount;
@ -125,7 +125,7 @@ void RigReservoirBuilder::createGridsAndCells( RigEclipseCaseData* eclipseCase )
size_t cellIdx;
for ( cellIdx = 0; cellIdx < mainGridIndicesWithSubGrid.size(); cellIdx++ )
{
RigCell& cell = eclipseCase->mainGrid()->globalCellArray()[mainGridIndicesWithSubGrid[cellIdx]];
RigCell& cell = eclipseCase->mainGrid()->cell( mainGridIndicesWithSubGrid[cellIdx] );
std::array<size_t, 8>& indices = cell.cornerIndices();
int nodeIdx;
@ -141,7 +141,7 @@ void RigReservoirBuilder::createGridsAndCells( RigEclipseCaseData* eclipseCase )
appendNodes( bb.min(), bb.max(), lgrCellDimensions, mainGridNodes );
size_t subGridCellCount = ( mainGridNodes.size() / 8 ) - totalCellCount;
appendCells( totalCellCount * 8, subGridCellCount, localGrid, eclipseCase->mainGrid()->globalCellArray() );
appendCells( totalCellCount * 8, subGridCellCount, localGrid, eclipseCase->mainGrid()->reservoirCells() );
totalCellCount += subGridCellCount;
}
@ -149,14 +149,14 @@ void RigReservoirBuilder::createGridsAndCells( RigEclipseCaseData* eclipseCase )
// Set all cells active
RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
activeCellInfo->setReservoirCellCount( eclipseCase->mainGrid()->globalCellArray().size() );
for ( size_t i = 0; i < eclipseCase->mainGrid()->globalCellArray().size(); i++ )
activeCellInfo->setReservoirCellCount( eclipseCase->mainGrid()->cellCount() );
for ( size_t i = 0; i < eclipseCase->mainGrid()->cellCount(); i++ )
{
activeCellInfo->setCellResultIndex( i, i );
}
activeCellInfo->setGridCount( 1 );
activeCellInfo->setGridActiveCellCounts( 0, eclipseCase->mainGrid()->globalCellArray().size() );
activeCellInfo->setGridActiveCellCounts( 0, eclipseCase->mainGrid()->cellCount() );
activeCellInfo->computeDerivedData();
bool useOptimizedVersion = false; // workaround, optimized version causes assert in debug builds

View File

@ -114,7 +114,7 @@ bool RigReservoirBuilderMock::inputProperty( RigEclipseCaseData* eclipseCase, co
/* generate secret number: */
int iSecret = rand() % 20 + 1;
for ( k = 0; k < eclipseCase->mainGrid()->globalCellArray().size(); k++ )
for ( k = 0; k < eclipseCase->mainGrid()->cellCount(); k++ )
{
values->push_back( k * iSecret );
}
@ -127,12 +127,12 @@ bool RigReservoirBuilderMock::inputProperty( RigEclipseCaseData* eclipseCase, co
//--------------------------------------------------------------------------------------------------
bool RigReservoirBuilderMock::staticResult( RigEclipseCaseData* eclipseCase, const QString& result, std::vector<double>* values )
{
values->resize( eclipseCase->mainGrid()->globalCellArray().size() );
values->resize( eclipseCase->mainGrid()->cellCount() );
#pragma omp parallel for
for ( long long k = 0; k < static_cast<long long>( eclipseCase->mainGrid()->globalCellArray().size() ); k++ )
for ( long long k = 0; k < static_cast<long long>( eclipseCase->mainGrid()->cellCount() ); k++ )
{
values->at( k ) = ( k * 2 ) % eclipseCase->mainGrid()->globalCellArray().size();
values->at( k ) = ( k * 2 ) % eclipseCase->mainGrid()->cellCount();
}
return false;
@ -155,12 +155,12 @@ bool RigReservoirBuilderMock::dynamicResult( RigEclipseCaseData* eclipseCase, co
double scaleValue = 1.0 + resultIndex * 0.1;
double offsetValue = 100 * resultIndex;
values->resize( eclipseCase->mainGrid()->globalCellArray().size() );
values->resize( eclipseCase->mainGrid()->cellCount() );
#pragma omp parallel for
for ( long long k = 0; k < static_cast<long long>( eclipseCase->mainGrid()->globalCellArray().size() ); k++ )
for ( long long k = 0; k < static_cast<long long>( eclipseCase->mainGrid()->cellCount() ); k++ )
{
double val = offsetValue + scaleValue * ( ( stepIndex * 1000 + k ) % eclipseCase->mainGrid()->globalCellArray().size() );
double val = offsetValue + scaleValue * ( ( stepIndex * 1000 + k ) % eclipseCase->mainGrid()->cellCount() );
values->at( k ) = val;
}

View File

@ -62,7 +62,7 @@ cvf::Vec3d RigStimPlanModelTools::calculateTSTDirection( RigEclipseCaseData* ecl
int numContributingCells = 0;
for ( size_t globalCellIndex : closeCells )
{
const RigCell& cell = mainGrid->globalCellArray()[globalCellIndex];
const RigCell& cell = mainGrid->cell( globalCellIndex );
if ( !cell.isInvalid() )
{
@ -128,7 +128,7 @@ std::tuple<const RigFault*, double, cvf::Vec3d, double> RigStimPlanModelTools::f
shortestDistance = distance;
barrierPosition = intersection.startPoint;
const RigCell& cell = mainGrid->globalCellArray()[intersection.globCellIndex];
const RigCell& cell = mainGrid->cell( intersection.globCellIndex );
cvf::Vec3d faceNormal = cell.faceNormalWithAreaLength( intersection.intersectedCellFaceIn );
barrierDip = RigStimPlanModelTools::calculateFormationDip( faceNormal );
}

View File

@ -189,7 +189,7 @@ public:
hostCellK.reserve( numMatrixModelActiveCells );
globalCoarseningBoxIdx.reserve( numMatrixModelActiveCells );
const std::vector<RigCell>& reservoirCells = reservoirCase->eclipseCaseData()->mainGrid()->globalCellArray();
auto mainGrid = reservoirCase->eclipseCaseData()->mainGrid();
std::vector<size_t> globalCoarseningBoxIndexStart;
{
@ -206,13 +206,13 @@ public:
}
}
for ( size_t cIdx = 0; cIdx < reservoirCells.size(); ++cIdx )
for ( size_t ncIdx = 0; ncIdx < mainGrid->cellCount(); ++ncIdx )
{
if ( actCellInfo->isActive( cIdx ) )
if ( actCellInfo->isActive( ncIdx ) )
{
RigGridBase* grid = reservoirCells[cIdx].hostGrid();
RigGridBase* grid = mainGrid->nativeCell( ncIdx ).hostGrid();
CVF_ASSERT( grid != nullptr );
size_t cellIndex = reservoirCells[cIdx].gridLocalCellIndex();
size_t cellIndex = mainGrid->nativeCell( ncIdx ).gridLocalCellIndex();
size_t i, j, k;
grid->ijkFromCellIndex( cellIndex, &i, &j, &k );
@ -229,7 +229,7 @@ public:
}
else
{
size_t parentCellIdx = reservoirCells[cIdx].parentCellIndex();
size_t parentCellIdx = mainGrid->nativeCell( ncIdx ).parentCellIndex();
parentGrid = ( static_cast<RigLocalGrid*>( grid ) )->parentGrid();
CVF_ASSERT( parentGrid != nullptr );
parentGrid->ijkFromCellIndex( parentCellIdx, &pi, &pj, &pk );
@ -245,7 +245,7 @@ public:
hostCellJ.push_back( static_cast<qint32>( pj + 1 ) ); // NB: 1-based index in Octave
hostCellK.push_back( static_cast<qint32>( pk + 1 ) ); // NB: 1-based index in Octave
size_t coarseningIdx = reservoirCells[cIdx].coarseningBoxIndex();
size_t coarseningIdx = mainGrid->nativeCell( ncIdx ).coarseningBoxIndex();
if ( coarseningIdx != cvf::UNDEFINED_SIZE_T )
{
size_t globalCoarseningIdx = globalCoarseningBoxIndexStart[grid->gridIndex()] + coarseningIdx;

View File

@ -203,11 +203,11 @@ public:
{
quint64 valueIndex = 0;
for ( size_t reservoirCellIndex = 0; reservoirCellIndex < mainGrid->globalCellArray().size(); reservoirCellIndex++ )
for ( size_t nativeCellIndex = 0; nativeCellIndex < mainGrid->cellCount(); nativeCellIndex++ )
{
if ( !actCellInfo->isActive( reservoirCellIndex ) ) continue;
if ( !actCellInfo->isActive( nativeCellIndex ) ) continue;
cvf::Vec3d center = mainGrid->globalCellArray()[reservoirCellIndex].center();
cvf::Vec3d center = mainGrid->nativeCell( nativeCellIndex ).center();
convertVec3dToPositiveDepth( &center );
@ -377,11 +377,11 @@ public:
quint64 valueIndex = 0;
for ( size_t reservoirCellIndex = 0; reservoirCellIndex < mainGrid->globalCellArray().size(); reservoirCellIndex++ )
for ( size_t nativeCellIndex = 0; nativeCellIndex < mainGrid->cellCount(); nativeCellIndex++ )
{
if ( !actCellInfo->isActive( reservoirCellIndex ) ) continue;
if ( !actCellInfo->isActive( nativeCellIndex ) ) continue;
mainGrid->cellCornerVertices( reservoirCellIndex, cornerVerts );
mainGrid->cellCornerVertices( nativeCellIndex, cornerVerts );
doubleValues[valueIndex++] = getCellCornerWithPositiveDepth( cornerVerts, cornerIndexMapping, coordIdx );
}

View File

@ -73,8 +73,8 @@ public:
{
RigConnection connection = mainGrid->nncData()->allConnections()[i];
const RigCell& cell1 = mainGrid->globalCellArray()[connection.c1GlobIdx()];
const RigCell& cell2 = mainGrid->globalCellArray()[connection.c2GlobIdx()];
const RigCell& cell1 = mainGrid->cell( connection.c1GlobIdx() );
const RigCell& cell2 = mainGrid->cell( connection.c2GlobIdx() );
sendCellInfo( socketStream, cell1 );
sendCellInfo( socketStream, cell2 );

View File

@ -933,7 +933,7 @@ public:
// The size of this array must match the test in RigCaseCellResultsData::isUsingGlobalActiveIndex(),
// as it is used to determine if we have data for active cells or all cells
// See RigCaseCellResultsData::isUsingGlobalActiveIndex()
size_t totalNumberOfCellsIncludingLgrCells = grid->mainGrid()->globalCellArray().size();
size_t totalNumberOfCellsIncludingLgrCells = grid->mainGrid()->cellCount();
m_scalarResultsToAdd->at( tsId ).resize( totalNumberOfCellsIncludingLgrCells, HUGE_VAL );
}

View File

@ -45,10 +45,10 @@ TEST( RigEclipseWellLogExtractor, ShortWellPathInsideOneCell )
reservoir->mainGrid()->computeCachedData();
}
auto cells = reservoir->mainGrid()->globalCellArray();
auto cells = reservoir->mainGrid()->reservoirCells();
EXPECT_FALSE( cells.empty() );
auto firstCell = reservoir->mainGrid()->globalCellArray()[0];
auto firstCell = reservoir->mainGrid()->cell( 0 );
auto center = firstCell.center();
cvf::ref<RigWellPath> wellPathGeometry = new RigWellPath;

View File

@ -96,7 +96,7 @@ RiuResultTextBuilder::RiuResultTextBuilder( RimGridView* settings
RigEclipseCaseData* caseData = eclipseCase->eclipseCaseData();
RigMainGrid* mainGrid = caseData->mainGrid();
const RigCell& cell = caseData->mainGrid()->globalCellArray()[reservoirCellIndex];
const RigCell& cell = caseData->mainGrid()->cell( reservoirCellIndex );
for ( size_t i = 0; i < mainGrid->gridCount(); i++ )
{
@ -922,8 +922,8 @@ QString RiuResultTextBuilder::nncDetails()
// First cell of NNC
{
CVF_ASSERT( conn.c1GlobIdx() < grid->globalCellArray().size() );
const RigCell& cell = grid->globalCellArray()[conn.c1GlobIdx()];
CVF_ASSERT( conn.c1GlobIdx() < grid->globalCellCount() );
const RigCell& cell = grid->cell( conn.c1GlobIdx() );
RigGridBase* hostGrid = cell.hostGrid();
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
@ -944,8 +944,8 @@ QString RiuResultTextBuilder::nncDetails()
// Second cell of NNC
{
CVF_ASSERT( conn.c2GlobIdx() < grid->globalCellArray().size() );
const RigCell& cell = grid->globalCellArray()[conn.c2GlobIdx()];
CVF_ASSERT( conn.c2GlobIdx() < grid->globalCellCount() );
const RigCell& cell = grid->cell( conn.c2GlobIdx() );
RigGridBase* hostGrid = cell.hostGrid();
size_t gridLocalCellIndex = cell.gridLocalCellIndex();

View File

@ -1066,7 +1066,7 @@ void RiuViewerCommands::findCellAndGridIndex( Rim3dView* m
if ( eclipseCase )
{
const RigCell& cell = eclipseCase->mainGrid()->globalCellArray()[globalCellIndex];
const RigCell& cell = eclipseCase->mainGrid()->cell( globalCellIndex );
*cellIndex = cell.gridLocalCellIndex();
*gridIndex = cell.hostGrid()->gridIndex();
}

View File

@ -390,6 +390,7 @@ void StructGridGeometryGenerator::computeArrays()
for ( i = 0; i < m_grid->cellCountI(); i++ )
{
size_t cellIndex = m_grid->cellIndexFromIJK( i, j, k );
if ( m_cellVisibility.notNull() && !( *m_cellVisibility )[cellIndex] )
{
continue;

View File

@ -94,7 +94,7 @@ grpc::Status RiaActiveCellInfoStateHandler::init( const rips::CellInfoRequest* r
//--------------------------------------------------------------------------------------------------
grpc::Status RiaActiveCellInfoStateHandler::assignNextActiveCellInfoData( rips::CellInfo* cellInfo )
{
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->globalCellArray();
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->reservoirCells();
while ( m_currentCellIdx < reservoirCells.size() )
{
@ -182,7 +182,7 @@ RigActiveCellInfo* RiaActiveCellInfoStateHandler::activeCellInfo() const
//--------------------------------------------------------------------------------------------------
const std::vector<RigCell>& RiaActiveCellInfoStateHandler::reservoirCells() const
{
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->globalCellArray();
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->reservoirCells();
return reservoirCells;
}
@ -223,7 +223,7 @@ grpc::Status RiaActiveCellInfoStateHandler::assignReply( rips::CellInfoArray* re
//--------------------------------------------------------------------------------------------------
grpc::Status RiaActiveCellInfoStateHandler::assignNextActiveCellCenter( rips::Vec3d* cellCenter )
{
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->globalCellArray();
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->reservoirCells();
while ( m_currentCellIdx < reservoirCells.size() )
{
@ -288,7 +288,7 @@ grpc::Status RiaActiveCellInfoStateHandler::assignCellCentersReply( rips::CellCe
//--------------------------------------------------------------------------------------------------
Status RiaActiveCellInfoStateHandler::assignNextActiveCellCorners( rips::CellCorners* cellCorners )
{
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->globalCellArray();
const std::vector<RigCell>& reservoirCells = m_eclipseCase->eclipseCaseData()->mainGrid()->reservoirCells();
while ( m_currentCellIdx < reservoirCells.size() )
{

View File

@ -100,8 +100,8 @@ grpc::Status RiaNNCConnectionsStateHandler::assignReply( rips::NNCConnections* r
for ( ; indexInPackage < packageSize && m_currentIdx < connectionCount; ++indexInPackage )
{
const RigConnection& connection = connections[m_currentIdx];
const RigCell& cell1 = mainGrid->globalCellArray()[connection.c1GlobIdx()];
const RigCell& cell2 = mainGrid->globalCellArray()[connection.c2GlobIdx()];
const RigCell& cell1 = mainGrid->cell( connection.c1GlobIdx() );
const RigCell& cell2 = mainGrid->cell( connection.c2GlobIdx() );
NNCConnection* nncConnection = reply->add_connections();
nncConnection->set_allocated_cell1( createConnectionVec3i( cell1 ) );

View File

@ -373,7 +373,7 @@ protected:
auto resultValues = caseData->results( porosityModel )->modifiableCellScalarResult( resVarAddr, timeStepIndex );
if ( resultValues && resultValues->empty() && m_cellCount > 0 )
{
auto totalCellCount = caseData->mainGrid()->globalCellArray().size();
auto totalCellCount = caseData->mainGrid()->cellCount();
resultValues->resize( totalCellCount );
}