Make sure we only loop over active grids local cells when calculating visibility

This commit is contained in:
jonjenssen
2024-11-21 14:59:35 +01:00
committed by Magne Sjaastad
parent db20065e1e
commit 036ed8b70e
3 changed files with 8 additions and 6 deletions

View File

@@ -112,14 +112,16 @@ size_t RigActiveCellGrid::totalActiveCellCount() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<size_t> RigActiveCellGrid::activeReservoirCellIndices() const
std::vector<size_t> RigActiveCellGrid::activeLocalCellIndices() const
{
std::vector<size_t> indices;
indices.reserve( m_nativeCells.size() );
const auto maxCellIdx = cellCount();
for ( const auto& [index, cell] : m_nativeCells )
{
indices.emplace_back( index );
// only add cells indexes that belongs to our grid, not subgrids
if ( index < maxCellIdx ) indices.emplace_back( index );
}
return indices;