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:
@@ -1111,13 +1111,7 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
|
||||
|
||||
bool resultLoadingSucess = true;
|
||||
|
||||
int tempGridCellCount = 0;
|
||||
for (int i = 1; i < m_ownerMainGrid->gridCount(); i++)
|
||||
{
|
||||
auto grid = m_ownerMainGrid->gridByIndex(i);
|
||||
if (grid->isTempGrid()) tempGridCellCount += (int)grid->cellCount();
|
||||
}
|
||||
|
||||
size_t tempGridCellCount = m_ownerMainGrid->totalTemporaryGridCellCount();
|
||||
|
||||
if (type == RiaDefines::DYNAMIC_NATIVE && timeStepCount > 0)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -60,10 +60,14 @@ public:
|
||||
size_t findReservoirCellIndexFromPoint(const cvf::Vec3d& point) const;
|
||||
std::vector<size_t> findAllReservoirCellIndicesMatching2dPoint(const cvf::Vec2d& point2d) const;
|
||||
void addLocalGrid(RigLocalGrid* localGrid);
|
||||
|
||||
size_t gridCountOnFile() const;
|
||||
size_t gridCount() const;
|
||||
RigGridBase* gridByIndex(size_t localGridIndex);
|
||||
const RigGridBase* gridByIndex(size_t localGridIndex) const;
|
||||
RigGridBase* gridById(int localGridId);
|
||||
|
||||
size_t totalTemporaryGridCellCount() const;
|
||||
|
||||
RigNNCData* nncData();
|
||||
void setFaults(const cvf::Collection<RigFault>& faults);
|
||||
|
||||
Reference in New Issue
Block a user