mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix for executing a script on result cases with no view
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "RimResultCase.h"
|
||||
#include "RimResultSlot.h"
|
||||
#include "RimStatisticsCase.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
@@ -203,6 +204,42 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
computeUnionOfActiveCells();
|
||||
}
|
||||
|
||||
// Propagate result meta data to all cases
|
||||
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS;
|
||||
|
||||
std::vector<QDateTime> timeStepDates = mainEclipseCase->results(poroModel)->timeStepDates(0);
|
||||
const std::vector<RigCaseCellResultsData::ResultInfo> resultInfos = mainEclipseCase->results(poroModel)->infoForEachResultIndex();
|
||||
|
||||
for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++)
|
||||
{
|
||||
RimResultCase* rimReservoir = dynamic_cast<RimResultCase*>(caseCollection()->reservoirs[i]);
|
||||
if (!rimReservoir) continue; // Input reservoir
|
||||
|
||||
RimReservoirCellResultsStorage* cellResultsStorage = rimReservoir->results(poroModel);
|
||||
|
||||
for (size_t resIdx = 0; resIdx < resultInfos.size(); resIdx++)
|
||||
{
|
||||
RimDefines::ResultCatType resultType = resultInfos[resIdx].m_resultType;
|
||||
QString resultName = resultInfos[resIdx].m_resultName;
|
||||
bool needsToBeStored = resultInfos[resIdx].m_needsToBeStored;
|
||||
|
||||
size_t scalarResultIndex = cellResultsStorage->cellResults()->findScalarResultIndex(resultType, resultName);
|
||||
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
size_t scalarResultIndex = cellResultsStorage->cellResults()->addEmptyScalarResult(resultType, resultName, needsToBeStored);
|
||||
cellResultsStorage->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates);
|
||||
|
||||
std::vector< std::vector<double> >& dataValues = cellResultsStorage->cellResults()->cellScalarResults(scalarResultIndex);
|
||||
dataValues.resize(timeStepDates.size());
|
||||
}
|
||||
}
|
||||
|
||||
cellResultsStorage->cellResults()->createPlaceholderResultEntries();
|
||||
}
|
||||
}
|
||||
|
||||
// "Load" the statistical cases
|
||||
|
||||
for (size_t i = 0; i < statisticsCaseCollection()->reservoirs.size(); i++)
|
||||
|
||||
Reference in New Issue
Block a user