mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3531 Temporary LGR : Add helper methods for grid and cell count
This commit is contained in:
@@ -198,6 +198,24 @@ void RigMainGrid::addLocalGrid(RigLocalGrid* localGrid)
|
||||
m_gridIdToIndexMapping[localGrid->gridId()] = localGrid->gridIndex();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigMainGrid::gridCountOnFile() const
|
||||
{
|
||||
size_t gridCount = 1;
|
||||
|
||||
for (const auto& grid : m_localGrids)
|
||||
{
|
||||
if (!grid->isTempGrid())
|
||||
{
|
||||
gridCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return gridCount;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -331,6 +349,24 @@ RigGridBase* RigMainGrid::gridById(int localGridId)
|
||||
return this->gridByIndex(m_gridIdToIndexMapping[localGridId]);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigMainGrid::totalTemporaryGridCellCount() const
|
||||
{
|
||||
size_t cellCount = 0;
|
||||
|
||||
for (const auto& grid : m_localGrids)
|
||||
{
|
||||
if (grid->isTempGrid())
|
||||
{
|
||||
cellCount += grid->cellCount();
|
||||
}
|
||||
}
|
||||
|
||||
return cellCount;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user