mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2146 Num Flooded PV: Move getResultIndexableStaticResult
This commit is contained in:
@@ -682,6 +682,42 @@ bool RigCaseCellResultsData::updateResultName(RiaDefines::ResultCatType resultTy
|
||||
return anyNameUpdated;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>* RigCaseCellResultsData::getResultIndexableStaticResult(RigActiveCellInfo* actCellInfo, RigCaseCellResultsData* gridCellResults, QString porvResultName, std::vector<double> &activeCellsResultsTempContainer)
|
||||
{
|
||||
size_t resultCellCount = actCellInfo->reservoirCellResultCount();
|
||||
size_t reservoirCellCount = actCellInfo->reservoirCellCount();
|
||||
|
||||
size_t scalarResultIndexPorv = gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, porvResultName);
|
||||
|
||||
if (scalarResultIndexPorv == cvf::UNDEFINED_SIZE_T) return nullptr;
|
||||
|
||||
const std::vector<double>* porvResults = &(gridCellResults->cellScalarResults(scalarResultIndexPorv, 0));
|
||||
|
||||
if (!gridCellResults->isUsingGlobalActiveIndex(scalarResultIndexPorv))
|
||||
{
|
||||
// PORV is given for all cells
|
||||
|
||||
activeCellsResultsTempContainer.resize(resultCellCount, HUGE_VAL);
|
||||
|
||||
for (size_t globalCellIndex = 0; globalCellIndex < reservoirCellCount; globalCellIndex++)
|
||||
{
|
||||
size_t resultIdx = actCellInfo->cellResultIndex(globalCellIndex);
|
||||
if (resultIdx != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
activeCellsResultsTempContainer[resultIdx] = porvResults->at(globalCellIndex);
|
||||
}
|
||||
}
|
||||
return &activeCellsResultsTempContainer;
|
||||
}
|
||||
else
|
||||
{
|
||||
return porvResults;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user