#2146 Num Flooded PV: Move getResultIndexableStaticResult

This commit is contained in:
Rebecca Cox
2017-11-16 10:22:55 +01:00
parent 797115d5c1
commit 4b2af286e3
3 changed files with 39 additions and 39 deletions

View File

@@ -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;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------