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:
parent
d2972d144a
commit
76a48a8f87
@ -1060,7 +1060,7 @@ bool RifReaderEclipseOutput::dynamicResult(const QString& result, RiaDefines::Po
|
|||||||
size_t indexOnFile = timeStepIndexOnFile(stepIndex);
|
size_t indexOnFile = timeStepIndexOnFile(stepIndex);
|
||||||
|
|
||||||
std::vector<double> fileValues;
|
std::vector<double> fileValues;
|
||||||
if (!m_dynamicResultsAccess->results(result, indexOnFile, m_eclipseCase->mainGrid()->gridCount(), &fileValues))
|
if (!m_dynamicResultsAccess->results(result, indexOnFile, m_eclipseCase->mainGrid()->gridCountOnFile(), &fileValues))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1349,7 +1349,7 @@ class WellResultPointHasSubCellConnectionCalculator
|
|||||||
public:
|
public:
|
||||||
explicit WellResultPointHasSubCellConnectionCalculator(const RigMainGrid* mainGrid, well_state_type* ert_well_state): m_mainGrid(mainGrid)
|
explicit WellResultPointHasSubCellConnectionCalculator(const RigMainGrid* mainGrid, well_state_type* ert_well_state): m_mainGrid(mainGrid)
|
||||||
{
|
{
|
||||||
int lastGridNr = static_cast<int>(m_mainGrid->gridCount()) - 1;
|
int lastGridNr = static_cast<int>(m_mainGrid->gridCountOnFile()) - 1;
|
||||||
|
|
||||||
for ( int gridNr = lastGridNr; gridNr >= 0; --gridNr )
|
for ( int gridNr = lastGridNr; gridNr >= 0; --gridNr )
|
||||||
{
|
{
|
||||||
|
@ -1111,13 +1111,7 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
|
|||||||
|
|
||||||
bool resultLoadingSucess = true;
|
bool resultLoadingSucess = true;
|
||||||
|
|
||||||
int tempGridCellCount = 0;
|
size_t tempGridCellCount = m_ownerMainGrid->totalTemporaryGridCellCount();
|
||||||
for (int i = 1; i < m_ownerMainGrid->gridCount(); i++)
|
|
||||||
{
|
|
||||||
auto grid = m_ownerMainGrid->gridByIndex(i);
|
|
||||||
if (grid->isTempGrid()) tempGridCellCount += (int)grid->cellCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (type == RiaDefines::DYNAMIC_NATIVE && timeStepCount > 0)
|
if (type == RiaDefines::DYNAMIC_NATIVE && timeStepCount > 0)
|
||||||
{
|
{
|
||||||
|
@ -198,6 +198,24 @@ void RigMainGrid::addLocalGrid(RigLocalGrid* localGrid)
|
|||||||
m_gridIdToIndexMapping[localGrid->gridId()] = localGrid->gridIndex();
|
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]);
|
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;
|
size_t findReservoirCellIndexFromPoint(const cvf::Vec3d& point) const;
|
||||||
std::vector<size_t> findAllReservoirCellIndicesMatching2dPoint(const cvf::Vec2d& point2d) const;
|
std::vector<size_t> findAllReservoirCellIndicesMatching2dPoint(const cvf::Vec2d& point2d) const;
|
||||||
void addLocalGrid(RigLocalGrid* localGrid);
|
void addLocalGrid(RigLocalGrid* localGrid);
|
||||||
|
|
||||||
|
size_t gridCountOnFile() const;
|
||||||
size_t gridCount() const;
|
size_t gridCount() const;
|
||||||
RigGridBase* gridByIndex(size_t localGridIndex);
|
RigGridBase* gridByIndex(size_t localGridIndex);
|
||||||
const RigGridBase* gridByIndex(size_t localGridIndex) const;
|
const RigGridBase* gridByIndex(size_t localGridIndex) const;
|
||||||
RigGridBase* gridById(int localGridId);
|
RigGridBase* gridById(int localGridId);
|
||||||
|
|
||||||
|
size_t totalTemporaryGridCellCount() const;
|
||||||
|
|
||||||
RigNNCData* nncData();
|
RigNNCData* nncData();
|
||||||
void setFaults(const cvf::Collection<RigFault>& faults);
|
void setFaults(const cvf::Collection<RigFault>& faults);
|
||||||
|
Loading…
Reference in New Issue
Block a user