diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp index 215ca25212..86645fc3bb 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp @@ -321,7 +321,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa RigEclipseResultAddress resAddr( RiaDefines::INPUT_PROPERTY, resultName); caseData->results(RiaDefines::MATRIX_MODEL)->createResultEntry( resAddr, false); - std::vector< std::vector >& newPropertyData = caseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resAddr); + std::vector< std::vector >& newPropertyData = caseData->results(RiaDefines::MATRIX_MODEL)->modifiableCellScalarResultTimesteps(resAddr); newPropertyData.push_back(std::vector()); newPropertyData[0].resize(ecl_kw_get_size(eclipseKeywordData), HUGE_VAL); diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index 9738276d59..993bd45710 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -84,8 +84,8 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip RigEclipseResultAddress resAddr(RiaDefines::INPUT_PROPERTY, resultName);\ cellResults->createResultEntry(resAddr, false); \ cellResults->setTimeStepInfos(resAddr, staticResultTimeStepInfos); \ - cellResults->cellScalarResults(resAddr).resize(1); \ - std::vector& values = cellResults->cellScalarResults(resAddr)[0]; \ + cellResults->modifiableCellScalarResultTimesteps(resAddr).resize(1); \ + std::vector& values = cellResults->modifiableCellScalarResultTimesteps(resAddr)[0]; \ this->inputProperty(resultName, &values); \ } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index d3a13d504f..53762d551e 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp @@ -54,7 +54,7 @@ void RimEclipseStatisticsCaseEvaluator::addNamedResult(RigCaseCellResultsData* d destinationCellResults->createResultEntry(resAddr, true); destinationCellResults->setTimeStepInfos(resAddr, sourceTimeStepInfos); - std::vector< std::vector >& dataValues = destinationCellResults->cellScalarResults(resAddr); + std::vector< std::vector >& dataValues = destinationCellResults->modifiableCellScalarResultTimesteps(resAddr); dataValues.resize(sourceTimeStepInfos.size()); diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 92a52271fc..30aee80274 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -290,7 +290,7 @@ void RimReservoirCellResultsStorage::setCellResults(RigCaseCellResultsData* cell { std::vector* data = nullptr; - data = &(m_cellResults->cellScalarResults(resAddr, tsIdx)); + data = &(m_cellResults->modifiableCellScalarResult(resAddr, tsIdx)); quint64 cellCount = 0; stream >> cellCount; diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index c050cf0aa8..b7afe8986b 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -229,7 +229,7 @@ const std::vector>& RigCaseCellResultsData::cellScalarResult //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector>& RigCaseCellResultsData::cellScalarResults(const RigEclipseResultAddress& resVarAddr) +std::vector>& RigCaseCellResultsData::modifiableCellScalarResultTimesteps(const RigEclipseResultAddress& resVarAddr) { size_t scalarResultIndex = findScalarResultIndexFromAddress(resVarAddr); @@ -241,7 +241,7 @@ std::vector>& RigCaseCellResultsData::cellScalarResults(cons //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector& RigCaseCellResultsData::cellScalarResults(const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex) +std::vector& RigCaseCellResultsData::modifiableCellScalarResult(const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex) { size_t scalarResultIndex = findScalarResultIndexFromAddress(resVarAddr); @@ -612,7 +612,7 @@ void RigCaseCellResultsData::setTimeStepInfos(const RigEclipseResultAddress& res m_resultInfos[findScalarResultIndexFromAddress(resVarAddr)].setTimeStepInfos(timeStepInfos); - std::vector>& dataValues = this->cellScalarResults(resVarAddr); + std::vector>& dataValues = this->modifiableCellScalarResultTimesteps(resVarAddr); dataValues.resize(timeStepInfos.size()); } @@ -1490,7 +1490,7 @@ void RigCaseCellResultsData::computeSOILForTimeStep(size_t timeStepIndex) if (scalarIndexSWAT != cvf::UNDEFINED_SIZE_T) { - std::vector& swatForTimeStep = this->cellScalarResults(SWATAddr, timeStepIndex); + const std::vector& swatForTimeStep = this->cellScalarResults(SWATAddr, timeStepIndex); if (swatForTimeStep.size() > 0) { soilResultValueCount = swatForTimeStep.size(); @@ -1500,7 +1500,7 @@ void RigCaseCellResultsData::computeSOILForTimeStep(size_t timeStepIndex) if (scalarIndexSGAS != cvf::UNDEFINED_SIZE_T) { - std::vector& sgasForTimeStep = this->cellScalarResults(SGASAddr, timeStepIndex); + const std::vector& sgasForTimeStep = this->cellScalarResults(SGASAddr, timeStepIndex); if (sgasForTimeStep.size() > 0) { soilResultValueCount = qMax(soilResultValueCount, sgasForTimeStep.size()); @@ -1523,9 +1523,9 @@ void RigCaseCellResultsData::computeSOILForTimeStep(size_t timeStepIndex) m_cellScalarResults[soilResultScalarIndex][timeStepIndex].resize(soilResultValueCount); - std::vector* swatForTimeStep = nullptr; - std::vector* sgasForTimeStep = nullptr; - std::vector* ssolForTimeStep = nullptr; + const std::vector* swatForTimeStep = nullptr; + const std::vector* sgasForTimeStep = nullptr; + const std::vector* ssolForTimeStep = nullptr; if (scalarIndexSWAT != cvf::UNDEFINED_SIZE_T) { @@ -1554,7 +1554,7 @@ void RigCaseCellResultsData::computeSOILForTimeStep(size_t timeStepIndex) } } - std::vector& soilForTimeStep = this->cellScalarResults(SOILAddr, timeStepIndex); + std::vector& soilForTimeStep = this->modifiableCellScalarResult(SOILAddr, timeStepIndex); #pragma omp parallel for for (int idx = 0; idx < static_cast(soilResultValueCount); idx++) @@ -2696,8 +2696,8 @@ void RigCaseCellResultsData::setActiveFormationNames(RigFormationNames* activeFo false, totalGlobCellCount); - std::vector& fnData = this->cellScalarResults(RigEclipseResultAddress(RiaDefines::FORMATION_NAMES, - RiaDefines::activeFormationNamesResultName()),0); + std::vector& fnData = this->modifiableCellScalarResult(RigEclipseResultAddress(RiaDefines::FORMATION_NAMES, + RiaDefines::activeFormationNamesResultName()), 0); if (m_activeFormationNamesData.isNull()) { @@ -2904,7 +2904,7 @@ void RigCaseCellResultsData::copyResultsMetaDataFromMainCase(RigEclipseCaseData* cellResultsStorage->setTimeStepInfos(RigEclipseResultAddress(resultType, resultName), timeStepInfos); - std::vector< std::vector >& dataValues = cellResultsStorage->cellScalarResults(RigEclipseResultAddress(resultType, resultName)); + std::vector< std::vector >& dataValues = cellResultsStorage->modifiableCellScalarResultTimesteps(RigEclipseResultAddress(resultType, resultName)); dataValues.resize(timeStepInfos.size()); } } diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index 77041f7b25..abad9c1cd8 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -68,9 +68,9 @@ public: // Access the results data const std::vector< std::vector > & cellScalarResults(const RigEclipseResultAddress& resVarAddr) const; - std::vector< std::vector > & cellScalarResults(const RigEclipseResultAddress& resVarAddr); const std::vector& cellScalarResults(const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex) const; - std::vector& cellScalarResults(const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex); + std::vector< std::vector > & modifiableCellScalarResultTimesteps(const RigEclipseResultAddress& resVarAddr); + std::vector& modifiableCellScalarResult(const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex); bool isUsingGlobalActiveIndex(const RigEclipseResultAddress& resVarAddr) const; diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseNativeStatCalc.h b/ApplicationCode/ReservoirDataModel/RigEclipseNativeStatCalc.h index a31ae579dc..cd704e9f7c 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseNativeStatCalc.h +++ b/ApplicationCode/ReservoirDataModel/RigEclipseNativeStatCalc.h @@ -55,7 +55,7 @@ private: return; } - std::vector& values = m_resultsData->cellScalarResults(m_eclipseResultAddress, timeStepIndex); + const std::vector& values = m_resultsData->cellScalarResults(m_eclipseResultAddress, timeStepIndex); if (values.empty()) { diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseNativeVisibleCellsStatCalc.h b/ApplicationCode/ReservoirDataModel/RigEclipseNativeVisibleCellsStatCalc.h index a7aff47b41..9ea9977326 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseNativeVisibleCellsStatCalc.h +++ b/ApplicationCode/ReservoirDataModel/RigEclipseNativeVisibleCellsStatCalc.h @@ -56,7 +56,7 @@ private: template void traverseCells(StatisticsAccumulator& accumulator, size_t timeStepIndex) { - std::vector& values = m_caseData->cellScalarResults(m_resultAddress, timeStepIndex); + const std::vector& values = m_caseData->cellScalarResults(m_resultAddress, timeStepIndex); if (values.empty()) { diff --git a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp index 053619885b..01f4b09866 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp @@ -53,7 +53,7 @@ cvf::ref RigResultModifierFactory::createResultModifier(RigEc return nullptr; } - std::vector< std::vector >& scalarSetResults = eclipseCase->results(porosityModel)->cellScalarResults(resVarAddr); + std::vector< std::vector >& scalarSetResults = eclipseCase->results(porosityModel)->modifiableCellScalarResultTimesteps(resVarAddr); if (timeStepIndex >= scalarSetResults.size()) { diff --git a/ApplicationCode/SocketInterface/RiaNNCCommands.cpp b/ApplicationCode/SocketInterface/RiaNNCCommands.cpp index 62cabeda67..f6b113ba50 100644 --- a/ApplicationCode/SocketInterface/RiaNNCCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaNNCCommands.cpp @@ -434,7 +434,7 @@ private: } std::vector< std::vector >* scalarResultFrames = nullptr; - scalarResultFrames = &(results->cellScalarResults(resAddr)); + scalarResultFrames = &(results->modifiableCellScalarResultTimesteps(resAddr)); size_t timeStepCount = results->maxTimeStepCount(); scalarResultFrames->resize(timeStepCount); diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index 320cf5052a..0317d9e986 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -79,7 +79,7 @@ public: { if (rimCase->results(porosityModelEnum)->ensureKnownResultLoaded(RigEclipseResultAddress(propertyName))) { - scalarResultFrames = &(rimCase->results(porosityModelEnum)->cellScalarResults(RigEclipseResultAddress(propertyName))); + scalarResultFrames = &(rimCase->results(porosityModelEnum)->modifiableCellScalarResultTimesteps(RigEclipseResultAddress(propertyName))); } } @@ -422,7 +422,7 @@ public: rimCase->results(m_porosityModelEnum)->setTimeStepInfos(eclResAddr, timeStepInfos); } - scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellScalarResults(eclResAddr)); + scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->modifiableCellScalarResultTimesteps(eclResAddr)); size_t timeStepCount = rimCase->results(m_porosityModelEnum)->maxTimeStepCount(); scalarResultFrames->resize(timeStepCount); @@ -656,7 +656,7 @@ public: if (m_requestedTimesteps.size() == 1 && m_currentEclResultAddress.isValid()) { std::vector< std::vector >* scalarResultFrames = nullptr; - scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->cellScalarResults(m_currentEclResultAddress)); + scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->modifiableCellScalarResultTimesteps(m_currentEclResultAddress)); size_t lastIndexWithDataPresent = cvf::UNDEFINED_SIZE_T; for (size_t i = 0; i < scalarResultFrames->size(); i++) { @@ -807,7 +807,7 @@ public: } m_currentResultAddress = resAddr; - scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellScalarResults(m_currentResultAddress)); + scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->modifiableCellScalarResultTimesteps(m_currentResultAddress)); size_t timeStepCount = rimCase->results(m_porosityModelEnum)->maxTimeStepCount(); scalarResultFrames->resize(timeStepCount); @@ -1019,7 +1019,7 @@ public: if (m_requestedTimesteps.size() == 1 && m_currentResultAddress.isValid()) { std::vector< std::vector >* scalarResultFrames = nullptr; - scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->cellScalarResults(RigEclipseResultAddress(m_currentResultAddress))); + scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->modifiableCellScalarResultTimesteps(RigEclipseResultAddress(m_currentResultAddress))); size_t lastIndexWithDataPresent = cvf::UNDEFINED_SIZE_T; for (size_t i = 0; i < scalarResultFrames->size(); i++) {