Privatize grid cell array

This commit is contained in:
jonjenssen authored and jonjenssen committed 2024-10-29 18:17:31 +01:00
1 parent 69878f54d3
commit 88118ee4e1
49 files changed
+418 -326

No files matched your search

@@ -73,13 +73,13 @@ void RigCellVolumeResultCalculator::calculate( const RigEclipseResultAddress& re
cellVolumeResults.resize( cellResultCount, std::numeric_limits<double>::infinity() );
#pragma omp parallel for
for ( int nativeResvCellIndex = 0; nativeResvCellIndex < static_cast<int>( m_resultsData->m_ownerMainGrid->globalCellArray().size() );
for ( int nativeResvCellIndex = 0; nativeResvCellIndex < static_cast<int>( m_resultsData->m_ownerMainGrid->totalCellCount() );
nativeResvCellIndex++ )
{
size_t resultIndex = m_resultsData->activeCellInfo()->cellResultIndex( nativeResvCellIndex );
if ( resultIndex != cvf::UNDEFINED_SIZE_T )
{
const RigCell& cell = m_resultsData->m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
const RigCell& cell = m_resultsData->m_ownerMainGrid->cell( nativeResvCellIndex );
if ( !cell.subGrid() )
{
cellVolumeResults[resultIndex] = cell.volume();
@@ -78,9 +78,8 @@ void RigFaultDistanceResultCalculator::calculate( const RigEclipseResultAddress&
if ( !shouldCompute ) return;
const std::vector<RigCell>& globalCellArray = m_resultsData->m_ownerMainGrid->globalCellArray();
long long numCells = static_cast<long long>( globalCellArray.size() );
const auto mainGrid = m_resultsData->m_ownerMainGrid;
long long numCells = static_cast<long long>( mainGrid->totalCellCount() );
std::vector<cvf::StructGridInterface::FaceType> faceTypes = cvf::StructGridInterface::validFaceTypes();
@@ -90,7 +89,8 @@ void RigFaultDistanceResultCalculator::calculate( const RigEclipseResultAddress&
{
if ( m_resultsData->activeCellInfo()->isActive( cellIdx ) )
{
const RigCell& cell = globalCellArray[cellIdx];
const RigCell& cell = mainGrid->cell( cellIdx );
if ( cell.isInvalid() ) continue;
for ( auto faceType : faceTypes )
{
if ( m_resultsData->m_ownerMainGrid->findFaultFromCellIndexAndCellFace( cellIdx, faceType ) )
@@ -124,7 +124,8 @@ void RigFaultDistanceResultCalculator::calculate( const RigEclipseResultAddress&
#pragma omp parallel for
for ( long long cellIdx = 0; cellIdx < numCells; cellIdx++ )
{
const RigCell& cell = globalCellArray[cellIdx];
const RigCell& cell = mainGrid->cell( cellIdx );
if ( cell.isInvalid() ) continue;
size_t resultIndex = cellIdx;
if ( resultIndex == cvf::UNDEFINED_SIZE_T || !m_resultsData->activeCellInfo()->isActive( cellIdx ) ) continue;
@@ -98,12 +98,13 @@ 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() );
const auto mainGrid = m_resultsData->m_ownerMainGrid;
long long numCells = static_cast<long long>( mainGrid->totalCellCount() );
#pragma omp parallel for
for ( long long cellIdx = 0; cellIdx < numCells; cellIdx++ )
{
const RigCell& cell = globalCellArray[cellIdx];
const RigCell& cell = mainGrid->cell( cellIdx );
size_t resultIndex = cellIdx;
if ( resultIndex == cvf::UNDEFINED_SIZE_T ) continue;
@@ -74,7 +74,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() );
for ( int nativeResvCellIndex = 0; nativeResvCellIndex < static_cast<int>( m_resultsData->m_ownerMainGrid->totalCellCount() );
nativeResvCellIndex++ )
{
size_t resultIndex = m_resultsData->activeCellInfo()->cellResultIndex( nativeResvCellIndex );
@@ -124,7 +124,7 @@ void RigPorvSoilSgasResultCalculator::calculate( const RigEclipseResultAddress&
bool res2ActiveOnly = in2Results.size() == activeCellCount;
#pragma omp parallel for
for ( int nativeResvCellIndex = 0; nativeResvCellIndex < static_cast<int>( m_resultsData->m_ownerMainGrid->globalCellArray().size() );
for ( int nativeResvCellIndex = 0; nativeResvCellIndex < static_cast<int>( m_resultsData->m_ownerMainGrid->totalCellCount() );
nativeResvCellIndex++ )
{
size_t resultIndex = m_resultsData->activeCellInfo()->cellResultIndex( nativeResvCellIndex );