mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 22:50:25 -05:00
Privatize grid cell array
This commit is contained in:
1 parent
69878f54d3
commit
88118ee4e1
49 files changed
+418
-326
No files matched your search
+2
-2
@@ -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();
|
||||
|
||||
+6
-5
@@ -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;
|
||||
|
||||
+4
-3
@@ -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;
|
||||
|
||||
+1
-1
@@ -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 );
|
||||
|
||||
+1
-1
@@ -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 );
|
||||
|
||||
Reference in new issue
Block a user