diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index 199ff5a85a..5b9275efdb 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -27,6 +27,7 @@ #include "RicExportFractureCompletionsImpl.h" #include "RigActiveCellInfo.h" +#include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" #include "RigMainGrid.h" #include "RigResultAccessorFactory.h" @@ -44,7 +45,6 @@ #include "RimPerforationCollection.h" #include "RimPerforationInterval.h" #include "RimProject.h" -#include "RimReservoirCellResultsStorage.h" #include "RimEclipseWell.h" #include "RimEclipseWellCollection.h" #include "RimWellPath.h" @@ -940,11 +940,11 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); double xLengthFraction = abs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex)); @@ -979,18 +979,18 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ"); double dx = dxAccessObject->cellScalarGlobIdx(cellIndex); @@ -1028,18 +1028,18 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclips { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ"); double dx = dxAccessObject->cellScalarGlobIdx(cellIndex); diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index 5e9f78d14a..f334abd818 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -243,11 +243,11 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView) { if (m_statisticsTimeRange == ALL_TIMESTEPS) { - eclipseView->currentGridCellResults()->cellResults()->minMaxCellScalarValues(scalarIndex, min, max); - eclipseView->currentGridCellResults()->cellResults()->p10p90CellScalarValues(scalarIndex, p10, p90); - eclipseView->currentGridCellResults()->cellResults()->meanCellScalarValues(scalarIndex, mean); - eclipseView->currentGridCellResults()->cellResults()->sumCellScalarValues(scalarIndex, sum); - histogram = &(eclipseView->currentGridCellResults()->cellResults()->cellScalarValuesHistogram(scalarIndex)); + eclipseView->currentGridCellResults()->minMaxCellScalarValues(scalarIndex, min, max); + eclipseView->currentGridCellResults()->p10p90CellScalarValues(scalarIndex, p10, p90); + eclipseView->currentGridCellResults()->meanCellScalarValues(scalarIndex, mean); + eclipseView->currentGridCellResults()->sumCellScalarValues(scalarIndex, sum); + histogram = &(eclipseView->currentGridCellResults()->cellScalarValuesHistogram(scalarIndex)); } else if (m_statisticsTimeRange == CURRENT_TIMESTEP ) { @@ -257,11 +257,11 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView) currentTimeStep = 0; } - eclipseView->currentGridCellResults()->cellResults()->minMaxCellScalarValues(scalarIndex, currentTimeStep, min, max); - eclipseView->currentGridCellResults()->cellResults()->p10p90CellScalarValues(scalarIndex, currentTimeStep, p10, p90); - eclipseView->currentGridCellResults()->cellResults()->meanCellScalarValues(scalarIndex, currentTimeStep, mean); - eclipseView->currentGridCellResults()->cellResults()->sumCellScalarValues(scalarIndex, currentTimeStep, sum); - histogram = &(eclipseView->currentGridCellResults()->cellResults()->cellScalarValuesHistogram(scalarIndex, currentTimeStep)); + eclipseView->currentGridCellResults()->minMaxCellScalarValues(scalarIndex, currentTimeStep, min, max); + eclipseView->currentGridCellResults()->p10p90CellScalarValues(scalarIndex, currentTimeStep, p10, p90); + eclipseView->currentGridCellResults()->meanCellScalarValues(scalarIndex, currentTimeStep, mean); + eclipseView->currentGridCellResults()->sumCellScalarValues(scalarIndex, currentTimeStep, sum); + histogram = &(eclipseView->currentGridCellResults()->cellScalarValuesHistogram(scalarIndex, currentTimeStep)); } else { @@ -636,7 +636,7 @@ void Rim3dOverlayInfoConfig::updateVisCellStatsIfNeeded() else { size_t scalarIndex = eclipseView->cellResult()->scalarResultIndex(); - calc = new RigEclipseNativeVisibleCellsStatCalc(eclipseView->currentGridCellResults()->cellResults(), + calc = new RigEclipseNativeVisibleCellsStatCalc(eclipseView->currentGridCellResults(), scalarIndex, eclipseView->currentTotalCellVisibility().p()); } diff --git a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp index 2d70b51d35..99c1849744 100644 --- a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp +++ b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp @@ -186,7 +186,7 @@ QList RimCellEdgeColors::calculateValueOptions(const caf if (m_reservoirView && m_reservoirView->currentGridCellResults()) { QStringList varList; - varList = m_reservoirView->currentGridCellResults()->cellResults()->resultNames(RiaDefines::STATIC_NATIVE); + varList = m_reservoirView->currentGridCellResults()->resultNames(RiaDefines::STATIC_NATIVE); //TODO: Must also handle input properties //varList += m_reservoirView->gridCellResults()->resultNames(RiaDefines::INPUT_PROPERTY); @@ -295,7 +295,7 @@ QStringList RimCellEdgeColors::findResultVariableNames() if (m_reservoirView && m_reservoirView->currentGridCellResults() && !m_resultVariable().isEmpty()) { QStringList varList; - varList = m_reservoirView->currentGridCellResults()->cellResults()->resultNames(RiaDefines::STATIC_NATIVE); + varList = m_reservoirView->currentGridCellResults()->resultNames(RiaDefines::STATIC_NATIVE); //TODO: Must handle Input properties int i; @@ -458,7 +458,7 @@ void RimCellEdgeColors::minMaxCellEdgeValues(double& min, double& max) { double cMin, cMax; - m_reservoirView->currentGridCellResults()->cellResults()->minMaxCellScalarValues(resultIndices[idx], cMin, cMax); + m_reservoirView->currentGridCellResults()->minMaxCellScalarValues(resultIndices[idx], cMin, cMax); globalMin = CVF_MIN(globalMin, cMin); globalMax = CVF_MAX(globalMax, cMax); @@ -489,7 +489,7 @@ void RimCellEdgeColors::posNegClosestToZero(double& pos, double& neg) { double localPos, localNeg; - m_reservoirView->currentGridCellResults()->cellResults()->posNegClosestToZero(resultIndices[idx], localPos, localNeg); + m_reservoirView->currentGridCellResults()->posNegClosestToZero(resultIndices[idx], localPos, localNeg); if (localPos > 0 && localPos < pos) pos = localPos; if (localNeg < 0 && localNeg > neg) neg = localNeg; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index 2bb783fa87..217588ddfc 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -258,7 +258,7 @@ RimEclipseView* RimEclipseCase::createCopyAndAddView(const RimEclipseView* sourc //-------------------------------------------------------------------------------------------------- void RimEclipseCase::recalculateCompletionTypeAndRedrawAllViews() { - m_matrixModelResults->cellResults()->clearScalarResult(RiaDefines::DYNAMIC_NATIVE, RiaDefines::completionTypeResultName()); + results(RiaDefines::MATRIX_MODEL)->clearScalarResult(RiaDefines::DYNAMIC_NATIVE, RiaDefines::completionTypeResultName()); for (RimView* view : views()) { @@ -576,28 +576,28 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->resultsStorage(RiaDefines::MATRIX_MODEL); - if (results && results->cellResults()) + RigCaseCellResultsData* results = this->results(RiaDefines::MATRIX_MODEL); + if (results ) { - results->cellResults()->createPlaceholderResultEntries(); + results->createPlaceholderResultEntries(); // After the placeholder result for combined transmissibility is created, // make sure the nnc transmissibilities can be addressed by this scalarResultIndex as well - size_t combinedTransResIdx = results->cellResults()->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedTransmissibilityResultName()); + size_t combinedTransResIdx = results->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedTransmissibilityResultName()); if (combinedTransResIdx != cvf::UNDEFINED_SIZE_T) { eclipseCaseData()->mainGrid()->nncData()->setScalarResultIndex(RigNNCData::propertyNameCombTrans(), combinedTransResIdx); } - size_t combinedWatFluxResIdx = results->cellResults()->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::combinedWaterFluxResultName()); + size_t combinedWatFluxResIdx = results->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::combinedWaterFluxResultName()); if (combinedWatFluxResIdx != cvf::UNDEFINED_SIZE_T) { eclipseCaseData()->mainGrid()->nncData()->setScalarResultIndex(RigNNCData::propertyNameFluxWat(), combinedWatFluxResIdx); } - size_t combinedOilFluxResIdx = results->cellResults()->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::combinedOilFluxResultName()); + size_t combinedOilFluxResIdx = results->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::combinedOilFluxResultName()); if (combinedOilFluxResIdx != cvf::UNDEFINED_SIZE_T) { eclipseCaseData()->mainGrid()->nncData()->setScalarResultIndex(RigNNCData::propertyNameFluxOil(), combinedOilFluxResIdx); } - size_t combinedGasFluxResIdx = results->cellResults()->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::combinedGasFluxResultName()); + size_t combinedGasFluxResIdx = results->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::combinedGasFluxResultName()); if (combinedGasFluxResIdx != cvf::UNDEFINED_SIZE_T) { eclipseCaseData()->mainGrid()->nncData()->setScalarResultIndex(RigNNCData::propertyNameFluxGas(), combinedGasFluxResIdx); @@ -607,10 +607,10 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->resultsStorage(RiaDefines::FRACTURE_MODEL); - if (results && results->cellResults()) + RigCaseCellResultsData* results = this->results(RiaDefines::FRACTURE_MODEL); + if (results) { - results->cellResults()->createPlaceholderResultEntries(); + results->createPlaceholderResultEntries(); } } @@ -639,7 +639,7 @@ QStringList RimEclipseCase::timeStepStrings() const { QStringList stringList; - int timeStepCount = static_cast(resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount()); + int timeStepCount = static_cast(results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount()); for (int i = 0; i < timeStepCount; i++) { stringList += this->timeStepName(i); @@ -741,5 +741,5 @@ double RimEclipseCase::characteristicCellSize() const //-------------------------------------------------------------------------------------------------- std::vector RimEclipseCase::timeStepDates() const { - return resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepDates(); + return results(RiaDefines::MATRIX_MODEL)->timeStepDates(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp index 58be81bf66..3df321cf78 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp @@ -88,8 +88,8 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames) if (fileNames.contains(RiaDefines::mockModelBasicInputCase())) { cvf::ref readerInterface = this->createMockModel(fileNames[0]); - resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); - resultsStorage(RiaDefines::FRACTURE_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->computeDerivedData(); eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->computeDerivedData(); @@ -204,8 +204,8 @@ bool RimEclipseInputCase::openEclipseGridFile() CVF_ASSERT(this->eclipseCaseData()); CVF_ASSERT(readerInterface.notNull()); - resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); - resultsStorage(RiaDefines::FRACTURE_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis); @@ -217,11 +217,8 @@ bool RimEclipseInputCase::openEclipseGridFile() RiaApplication* app = RiaApplication::instance(); if (app->preferences()->autocomputeDepthRelatedProperties) { - RimReservoirCellResultsStorage* matrixResults = resultsStorage(RiaDefines::MATRIX_MODEL); - RimReservoirCellResultsStorage* fractureResults = resultsStorage(RiaDefines::FRACTURE_MODEL); - - matrixResults->cellResults()->computeDepthRelatedResults(); - fractureResults->cellResults()->computeDepthRelatedResults(); + results(RiaDefines::MATRIX_MODEL)->computeDepthRelatedResults(); + results(RiaDefines::FRACTURE_MODEL)->computeDepthRelatedResults(); } return true; diff --git a/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilter.cpp b/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilter.cpp index 8f65151a10..5bd56f8997 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilter.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilter.cpp @@ -372,10 +372,10 @@ void RimEclipsePropertyFilter::computeResultValueRange() size_t scalarIndex = resultDefinition->scalarResultIndex(); if ( scalarIndex != cvf::UNDEFINED_SIZE_T ) { - RimReservoirCellResultsStorage* results = resultDefinition->currentGridCellResults(); + RigCaseCellResultsData* results = resultDefinition->currentGridCellResults(); if ( results ) { - results->cellResults()->minMaxCellScalarValues(scalarIndex, min, max); + results->minMaxCellScalarValues(scalarIndex, min, max); if ( resultDefinition->hasCategoryResult() ) { @@ -398,7 +398,7 @@ void RimEclipsePropertyFilter::computeResultValueRange() } else { - setCategoryValues(results->cellResults()->uniqueCellScalarValues(scalarIndex)); + setCategoryValues(results->uniqueCellScalarValues(scalarIndex)); } } } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index 8a96e2247d..c6a4a89b92 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -179,8 +179,8 @@ bool RimEclipseResultCase::importGridAndResultMetaData(bool showTimeStepFilter) readerInterface = readerEclipseOutput; } - resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); - resultsStorage(RiaDefines::FRACTURE_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); progInfo.incrementProgress(); @@ -262,8 +262,8 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl readerInterface = readerEclipseOutput; } - resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); - resultsStorage(RiaDefines::FRACTURE_MODEL)->cellResults()->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); CVF_ASSERT(this->eclipseCaseData()); CVF_ASSERT(readerInterface.notNull()); @@ -280,9 +280,9 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl //-------------------------------------------------------------------------------------------------- void RimEclipseResultCase::loadAndUpdateSourSimData() { - if (!resultsStorage(RiaDefines::MATRIX_MODEL)) return; + if (!results(RiaDefines::MATRIX_MODEL)) return; - resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->setHdf5Filename(m_sourSimFileName); + results(RiaDefines::MATRIX_MODEL)->setHdf5Filename(m_sourSimFileName); if (!hasSourSimFile()) { diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index f055297795..9960970652 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -159,11 +159,11 @@ void RimEclipseResultDefinition::setEclipseCase(RimEclipseCase* eclipseCase) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimReservoirCellResultsStorage* RimEclipseResultDefinition::currentGridCellResults() const +RigCaseCellResultsData* RimEclipseResultDefinition::currentGridCellResults() const { if (!m_eclipseCase ) return nullptr; - return m_eclipseCase->resultsStorage(m_porosityModel()); + return m_eclipseCase->results(m_porosityModel()); } //-------------------------------------------------------------------------------------------------- @@ -553,10 +553,10 @@ QList RimEclipseResultDefinition::calculateValueOptions( { if (fieldNeedingOptions == &m_selectedSouringTracersUiField) { - RimReservoirCellResultsStorage* cellResultsStorage = currentGridCellResults(); - if (cellResultsStorage && cellResultsStorage->cellResults()) + RigCaseCellResultsData* cellResultsStorage = currentGridCellResults(); + if (cellResultsStorage) { - QStringList dynamicResultNames = cellResultsStorage->cellResults()->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList dynamicResultNames = cellResultsStorage->resultNames(RiaDefines::DYNAMIC_NATIVE); for (const QString& resultName : dynamicResultNames) { @@ -694,13 +694,11 @@ QStringList RimEclipseResultDefinition::getResultNamesForCurrentUiResultType() { if ( m_resultTypeUiField() != RiaDefines::FLOW_DIAGNOSTICS ) { - RimReservoirCellResultsStorage* cellResultsStorage = currentGridCellResults(); + RigCaseCellResultsData* cellResultsStorage = currentGridCellResults(); if ( !cellResultsStorage ) return QStringList(); - if ( !cellResultsStorage->cellResults() ) return QStringList(); - - return cellResultsStorage->cellResults()->resultNames(m_resultTypeUiField()); + return cellResultsStorage->resultNames(m_resultTypeUiField()); } else { @@ -722,10 +720,10 @@ size_t RimEclipseResultDefinition::scalarResultIndex() const if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS || m_resultType() == RiaDefines::INJECTION_FLOODING) return cvf::UNDEFINED_SIZE_T; - const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults(); - if (gridCellResults && gridCellResults->cellResults()) + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + if (gridCellResults ) { - gridScalarResultIndex = gridCellResults->cellResults()->findScalarResultIndex(m_resultType(), m_resultVariable()); + gridScalarResultIndex = gridCellResults->findScalarResultIndex(m_resultType(), m_resultVariable()); } return gridScalarResultIndex; @@ -889,7 +887,7 @@ void RimEclipseResultDefinition::loadResult() { if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->resultType() == RiaDefines::INJECTION_FLOODING) return; // Will load automatically on access - RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults(); + RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); if (gridCellResults) { gridCellResults->findOrLoadScalarResult(m_resultType(), m_resultVariable); @@ -905,10 +903,10 @@ bool RimEclipseResultDefinition::hasStaticResult() const { if (this->resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->resultType() == RiaDefines::INJECTION_FLOODING) return false; - const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults(); + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); size_t gridScalarResultIndex = this->scalarResultIndex(); - if (hasResult() && gridCellResults->cellResults()->timeStepCount(gridScalarResultIndex) == 1 ) + if (hasResult() && gridCellResults->timeStepCount(gridScalarResultIndex) == 1 ) { return true; } @@ -927,9 +925,9 @@ bool RimEclipseResultDefinition::hasResult() const { if (m_flowSolution() && !m_resultVariable().isEmpty()) return true; } - else if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults()) + else if (this->currentGridCellResults() ) { - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults()->cellResults(); + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); size_t gridScalarResultIndex = gridCellResults->findScalarResultIndex(m_resultType(), m_resultVariable()); return gridScalarResultIndex != cvf::UNDEFINED_SIZE_T; } @@ -962,9 +960,9 @@ bool RimEclipseResultDefinition::hasDynamicResult() const return true; } - if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults()) + if (this->currentGridCellResults()) { - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults()->cellResults(); + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); size_t gridScalarResultIndex = this->scalarResultIndex(); if (gridCellResults->timeStepCount(gridScalarResultIndex) > 1 ) { diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h index 4fcce90049..7e85ec27ea 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h @@ -89,7 +89,7 @@ public: bool isCompletionTypeSelected() const; bool hasCategoryResult() const; - RimReservoirCellResultsStorage* currentGridCellResults() const; + RigCaseCellResultsData* currentGridCellResults() const; void loadDataAndUpdate(); void updateAnyFieldHasChanged(); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp index a5ba5d9a85..5e9f71c1c8 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp @@ -218,15 +218,14 @@ void RimEclipseStatisticsCase::computeStatistics() getSourceCases(sourceCases); if (sourceCases.size() == 0 - || !sourceCases.at(0)->resultsStorage(RiaDefines::MATRIX_MODEL) - || !sourceCases.at(0)->resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()) + || !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)) { return; } // The first source has been read completely from disk, and contains grid and meta data // Use this information for all cases in the case group - size_t timeStepCount = sourceCases.at(0)->resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount(); + size_t timeStepCount = sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(); RimStatisticsConfig statisticsConfig; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index 71ef1ce1e6..c4e0fbcc68 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp @@ -44,7 +44,7 @@ void RimEclipseStatisticsCaseEvaluator::addNamedResult(RigCaseCellResultsData* d // Use time step dates from first result in first source case CVF_ASSERT(m_sourceCases.size() > 0); - std::vector sourceTimeStepInfos = m_sourceCases[0]->resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepInfos(0); + std::vector sourceTimeStepInfos = m_sourceCases[0]->results(RiaDefines::MATRIX_MODEL)->timeStepInfos(0); size_t destinationScalarResultIndex = destinationCellResults->findOrCreateScalarResultIndex(resultType, resultName, true); CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T); @@ -161,7 +161,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& RimEclipseCase* sourceCase = m_sourceCases.at(caseIdx); // Trigger loading of dataset - sourceCase->resultsStorage(poroModel)->findOrLoadScalarResultForTimeStep(resultType, resultName, dataAccessTimeStepIndex); + sourceCase->results(poroModel)->findOrLoadScalarResultForTimeStep(resultType, resultName, dataAccessTimeStepIndex); cvf::ref resultAccessor = RigResultAccessorFactory::createFromNameAndType(sourceCase->eclipseCaseData(), gridIdx, poroModel, dataAccessTimeStepIndex, resultName, resultType); if (resultAccessor.notNull()) @@ -301,8 +301,8 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& if (!eclipseCase->reservoirViews.size()) { - eclipseCase->resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->freeAllocatedResultsData(); - eclipseCase->resultsStorage(RiaDefines::FRACTURE_MODEL)->cellResults()->freeAllocatedResultsData(); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->freeAllocatedResultsData(); + eclipseCase->results(RiaDefines::FRACTURE_MODEL)->freeAllocatedResultsData(); } } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 5cde573a5d..bb2c818c48 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -179,11 +179,11 @@ RimEclipseView::~RimEclipseView() //-------------------------------------------------------------------------------------------------- void RimEclipseView::clampCurrentTimestep() { - if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults()) + if (this->currentGridCellResults()) { - if (m_currentTimeStep() >= static_cast(this->currentGridCellResults()->cellResults()->maxTimeStepCount())) + if (m_currentTimeStep() >= static_cast(this->currentGridCellResults()->maxTimeStepCount())) { - m_currentTimeStep = static_cast(this->currentGridCellResults()->cellResults()->maxTimeStepCount()) -1; + m_currentTimeStep = static_cast(this->currentGridCellResults()->maxTimeStepCount()) -1; } } @@ -289,7 +289,7 @@ void RimEclipseView::createDisplayModel() CVF_ASSERT(currentGridCellResults()); size_t i; - for (i = 0; i < currentGridCellResults()->cellResults()->maxTimeStepCount(); i++) + for (i = 0; i < currentGridCellResults()->maxTimeStepCount(); i++) { timeStepIndices.push_back(i); } @@ -915,11 +915,11 @@ void RimEclipseView::updateDisplayModelVisibility() //-------------------------------------------------------------------------------------------------- /// Convenience for quick access to results //-------------------------------------------------------------------------------------------------- -RimReservoirCellResultsStorage* RimEclipseView::currentGridCellResults() +RigCaseCellResultsData* RimEclipseView::currentGridCellResults() { if (m_eclipseCase) { - return m_eclipseCase->resultsStorage(cellResult->porosityModel()); + return m_eclipseCase->results(cellResult->porosityModel()); } return NULL; @@ -1098,7 +1098,7 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R size_t maxTimeStepCount = cellResultsData->maxTimeStepCount(); if (resultColors->isTernarySaturationSelected() && maxTimeStepCount > 1) { - RimReservoirCellResultsStorage* gridCellResults = resultColors->currentGridCellResults(); + RigCaseCellResultsData* gridCellResults = resultColors->currentGridCellResults(); { size_t scalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL"); if (scalarSetIndex != cvf::UNDEFINED_SIZE_T) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.h b/ApplicationCode/ProjectDataModel/RimEclipseView.h index 3821ff0349..d84c03b2d1 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.h @@ -114,7 +114,7 @@ public: const RimEclipsePropertyFilterCollection* eclipsePropertyFilterCollection() const; void setOverridePropertyFilterCollection(RimEclipsePropertyFilterCollection* pfc); - RimReservoirCellResultsStorage* currentGridCellResults(); + RigCaseCellResultsData* currentGridCellResults(); RigActiveCellInfo* currentActiveCellInfo(); RimEclipseCellColors* currentFaultResultColors(); diff --git a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp index ccb3fa4afe..8d791bace0 100644 --- a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp @@ -168,12 +168,15 @@ std::vector RimGridTimeHistoryCurve::yValues() const CVF_ASSERT(m_eclipseResultDefinition()); m_eclipseResultDefinition->loadResult(); - RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults(); - RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults(); + RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults(); std::vector timeStepDates = cellResultsData->timeStepDates(); - values = RigTimeHistoryResultAccessor::timeHistoryValues(eclTopItem->eclipseCase()->eclipseCaseData(), m_eclipseResultDefinition(), gridIndex, cellIndex, timeStepDates.size()); + values = RigTimeHistoryResultAccessor::timeHistoryValues(eclTopItem->eclipseCase()->eclipseCaseData(), + m_eclipseResultDefinition(), + gridIndex, + cellIndex, + timeStepDates.size()); } if (geoMechGeomSelectionItem() && geoMechGeomSelectionItem()->geoMechCase()) @@ -366,8 +369,7 @@ std::vector RimGridTimeHistoryCurve::timeStepValues() const RimEclipseGeometrySelectionItem* eclTopItem = eclipseGeomSelectionItem(); if (eclTopItem && eclTopItem->eclipseCase()) { - RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults(); - RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults(); + RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults(); std::vector timeStepDates = cellResultsData->timeStepDates(); @@ -415,8 +417,7 @@ std::vector RimGridTimeHistoryCurve::daysSinceSimulationStart() const RimEclipseGeometrySelectionItem* eclTopItem = eclipseGeomSelectionItem(); if (eclTopItem && eclTopItem->eclipseCase()) { - RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults(); - RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults(); + RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults(); daysSinceSimulationStart = cellResultsData->daysSinceSimulationStart(); } diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index af84b86288..6ffd07ff42 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -185,7 +185,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() CVF_ASSERT(rigCaseData); RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; - mainCase->resultsStorage(poroModel)->cellResults()->createPlaceholderResultEntries(); + mainCase->results(poroModel)->createPlaceholderResultEntries(); // Action A : Read active cell info @@ -247,7 +247,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RimEclipseResultCase* rimReservoir = dynamic_cast(caseCollection()->reservoirs[i]); if (!rimReservoir) continue; // Input reservoir - RimReservoirCellResultsStorage* cellResultsStorage = rimReservoir->resultsStorage(poroModel); + RigCaseCellResultsData* cellResultsStorage = rimReservoir->results(poroModel); for (size_t resIdx = 0; resIdx < resultInfos.size(); resIdx++) { @@ -256,21 +256,21 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() bool needsToBeStored = resultInfos[resIdx].m_needsToBeStored; bool mustBeCalculated = resultInfos[resIdx].m_mustBeCalculated; - size_t scalarResultIndex = cellResultsStorage->cellResults()->findScalarResultIndex(resultType, resultName); + size_t scalarResultIndex = cellResultsStorage->findScalarResultIndex(resultType, resultName); if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) { - size_t scalarResultIndex = cellResultsStorage->cellResults()->findOrCreateScalarResultIndex(resultType, resultName, needsToBeStored); + size_t scalarResultIndex = cellResultsStorage->findOrCreateScalarResultIndex(resultType, resultName, needsToBeStored); - if (mustBeCalculated) cellResultsStorage->cellResults()->setMustBeCalculated(scalarResultIndex); + if (mustBeCalculated) cellResultsStorage->setMustBeCalculated(scalarResultIndex); - cellResultsStorage->cellResults()->setTimeStepInfos(scalarResultIndex, timeStepInfos); + cellResultsStorage->setTimeStepInfos(scalarResultIndex, timeStepInfos); - std::vector< std::vector >& dataValues = cellResultsStorage->cellResults()->cellScalarResults(scalarResultIndex); + std::vector< std::vector >& dataValues = cellResultsStorage->cellScalarResults(scalarResultIndex); dataValues.resize(timeStepInfos.size()); } } - cellResultsStorage->cellResults()->createPlaceholderResultEntries(); + cellResultsStorage->createPlaceholderResultEntries(); } } @@ -422,13 +422,13 @@ void RimIdenticalGridCaseGroup::clearStatisticsResults() RimEclipseCase* rimStaticsCase = statisticsCaseCollection->reservoirs[i]; if (!rimStaticsCase) continue; - if (rimStaticsCase->resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()) + if (rimStaticsCase->results(RiaDefines::MATRIX_MODEL)) { - rimStaticsCase->resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->clearAllResults(); } - if (rimStaticsCase->resultsStorage(RiaDefines::FRACTURE_MODEL)->cellResults()) + if (rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)) { - rimStaticsCase->resultsStorage(RiaDefines::FRACTURE_MODEL)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->clearAllResults(); } for (size_t j = 0; j < rimStaticsCase->reservoirViews.size(); j++) diff --git a/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp b/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp index dec01e0f61..0e9bc19aaa 100644 --- a/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp @@ -123,7 +123,7 @@ QList RimMultiSnapshotDefinition::calculateValueOptions( if (rimEclipseView) { QStringList varList; - varList = rimEclipseView->currentGridCellResults()->cellResults()->resultNames(eclipseResultType()); + varList = rimEclipseView->currentGridCellResults()->resultNames(eclipseResultType()); options = toOptionList(varList); } diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 38710f0bfe..1ec7ebb26b 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -211,32 +211,6 @@ QString RimReservoirCellResultsStorage::getCacheDirectoryPath() return cacheDirPath; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(const QString& resultName) -{ - if (!m_cellResults) return cvf::UNDEFINED_SIZE_T; - - return m_cellResults->findOrLoadScalarResult(resultName); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::ResultCatType type, const QString& resultName) -{ - if (!m_cellResults) return cvf::UNDEFINED_SIZE_T; - - return m_cellResults->findOrLoadScalarResult(type, resultName); -} - -size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefines::ResultCatType type, const QString& resultName, size_t timeStepIndex) -{ - if (!m_cellResults) return cvf::UNDEFINED_SIZE_T; - - return m_cellResults->findOrLoadScalarResultForTimeStep(type, resultName, timeStepIndex); -} //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h index a7b537e184..ac3921a82a 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h @@ -46,15 +46,9 @@ public: virtual ~RimReservoirCellResultsStorage(); void setCellResults(RigCaseCellResultsData* cellResults); - RigCaseCellResultsData* cellResults() { return m_cellResults; } - const RigCaseCellResultsData* cellResults() const { return m_cellResults; } size_t storedResultsCount(); - size_t findOrLoadScalarResultForTimeStep(RiaDefines::ResultCatType type, const QString& resultName, size_t timeStepIndex); - size_t findOrLoadScalarResult(RiaDefines::ResultCatType type, const QString& resultName); - size_t findOrLoadScalarResult(const QString& resultName); ///< Simplified search. Assumes unique names across types. - protected: // Overridden methods from PdmObject virtual void setupBeforeSave(); diff --git a/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp index 6b0392aa17..2172cf16d2 100644 --- a/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp +++ b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp @@ -230,9 +230,9 @@ void RimTimeStepFilter::updateSelectedTimeStepIndices() std::vector RimTimeStepFilter::allTimeSteps() const { RimEclipseResultCase* rimEclipseResultCase = parentEclipseResultCase(); - if (rimEclipseResultCase && rimEclipseResultCase->resultsStorage(RiaDefines::MATRIX_MODEL)) + if (rimEclipseResultCase && rimEclipseResultCase->results(RiaDefines::MATRIX_MODEL)) { - return rimEclipseResultCase->resultsStorage(RiaDefines::MATRIX_MODEL)->cellResults()->allTimeStepDatesFromEclipseReader(); + return rimEclipseResultCase->results(RiaDefines::MATRIX_MODEL)->allTimeStepDatesFromEclipseReader(); } return m_timeStepsFromFile; diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp index b221af4200..ba4d57960f 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp @@ -19,6 +19,7 @@ #include "RigEclipseToStimPlanCellTransmissibilityCalculator.h" #include "RigActiveCellInfo.h" +#include "RigCaseCellResultsData.h" #include "RigCellGeometryTools.h" #include "RigEclipseCaseData.h" #include "RigFractureCell.h" @@ -28,7 +29,6 @@ #include "RigHexIntersectionTools.h" #include "RimEclipseCase.h" -#include "RimReservoirCellResultsStorage.h" #include "cvfGeometryTools.h" @@ -235,7 +235,7 @@ cvf::ref RigEclipseToStimPlanCellTransmissibilityCalculator:: { CVF_ASSERT(eclipseCase); - RimReservoirCellResultsStorage* gridCellResults = eclipseCase->resultsStorage(porosityModel); + RigCaseCellResultsData* gridCellResults = eclipseCase->results(porosityModel); // Calling this function will force loading of result from file gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, uiResultName); diff --git a/ApplicationCode/ReservoirDataModel/RigNumberOfFloodedPoreVolumesCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigNumberOfFloodedPoreVolumesCalculator.cpp index f2195cf2d6..085c3e8960 100644 --- a/ApplicationCode/ReservoirDataModel/RigNumberOfFloodedPoreVolumesCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigNumberOfFloodedPoreVolumesCalculator.cpp @@ -38,7 +38,7 @@ //-------------------------------------------------------------------------------------------------- const std::vector* getResultIndexableStaticResult(RigActiveCellInfo* actCellInfo, - RimReservoirCellResultsStorage* gridCellResults, + RigCaseCellResultsData* gridCellResults, QString porvResultName, std::vector &activeCellsResultsTempContainer) { @@ -49,9 +49,9 @@ const std::vector* getResultIndexableStaticResult(RigActiveCellInfo* act if (scalarResultIndexPorv == cvf::UNDEFINED_SIZE_T) return nullptr; - const std::vector* porvResults = &(gridCellResults->cellResults()->cellScalarResults(scalarResultIndexPorv, 0)); + const std::vector* porvResults = &(gridCellResults->cellScalarResults(scalarResultIndexPorv, 0)); - if ( !gridCellResults->cellResults()->isUsingGlobalActiveIndex(scalarResultIndexPorv) ) + if ( !gridCellResults->isUsingGlobalActiveIndex(scalarResultIndexPorv) ) { // PORV is given for all cells @@ -79,7 +79,7 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid(); RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData(); - RimReservoirCellResultsStorage* gridCellResults = caseToApply->resultsStorage(RiaDefines::MATRIX_MODEL); + RigCaseCellResultsData* gridCellResults = caseToApply->results(RiaDefines::MATRIX_MODEL); RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); size_t resultCellCount = actCellInfo->reservoirCellResultCount(); diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 96c372276d..ae15fd209a 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -46,7 +46,7 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalcul { RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData(); RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL; - RimReservoirCellResultsStorage* gridCellResults = caseToApply->resultsStorage(porosityModel); + RigCaseCellResultsData* gridCellResults = caseToApply->results(porosityModel); size_t scalarResultIndexSwat = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); size_t scalarResultIndexSoil = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL"); diff --git a/ApplicationCode/SocketInterface/RiaNNCCommands.cpp b/ApplicationCode/SocketInterface/RiaNNCCommands.cpp index 40c5279df5..cd87c9c638 100644 --- a/ApplicationCode/SocketInterface/RiaNNCCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaNNCCommands.cpp @@ -341,15 +341,15 @@ public: nncData->makeGeneratedConnectionScalarResult(propertyName, m_timeStepCountToRead); } - if (rimCase && rimCase->resultsStorage(m_porosityModelEnum)) + if (rimCase && rimCase->results(m_porosityModelEnum)) { - bool ok = createIJKCellResults(rimCase->resultsStorage(m_porosityModelEnum), propertyName); + bool ok = createIJKCellResults(rimCase->results(m_porosityModelEnum), propertyName); if (!ok) { server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the property named: \"%2\"").arg(propertyName)); return true; } - size_t scalarResultIndex = rimCase->resultsStorage(m_porosityModelEnum)->findOrLoadScalarResult(QString("%1IJK").arg(propertyName)); + size_t scalarResultIndex = rimCase->results(m_porosityModelEnum)->findOrLoadScalarResult(QString("%1IJK").arg(propertyName)); nncData->setScalarResultIndex(propertyName, scalarResultIndex); } @@ -408,7 +408,7 @@ public: return false; } - static bool createIJKCellResults(RimReservoirCellResultsStorage* results, QString propertyName) + static bool createIJKCellResults(RigCaseCellResultsData* results, QString propertyName) { bool ok; ok = scalarResultExistsOrCreate(results, QString("%1IJK").arg(propertyName)); @@ -422,19 +422,19 @@ public: return ok; } - static bool scalarResultExistsOrCreate(RimReservoirCellResultsStorage* results, QString propertyName) + static bool scalarResultExistsOrCreate(RigCaseCellResultsData* results, QString propertyName) { size_t scalarResultIndex = results->findOrLoadScalarResult(propertyName); if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) { - scalarResultIndex = results->cellResults()->findOrCreateScalarResultIndex(RiaDefines::GENERATED, propertyName, true); + scalarResultIndex = results->findOrCreateScalarResultIndex(RiaDefines::GENERATED, propertyName, true); } if (scalarResultIndex != cvf::UNDEFINED_SIZE_T) { std::vector< std::vector >* scalarResultFrames = nullptr; - scalarResultFrames = &(results->cellResults()->cellScalarResults(scalarResultIndex)); - size_t timeStepCount = results->cellResults()->maxTimeStepCount(); + scalarResultFrames = &(results->cellScalarResults(scalarResultIndex)); + size_t timeStepCount = results->maxTimeStepCount(); scalarResultFrames->resize(timeStepCount); return true; } diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index 9414f0aa35..66693d8b65 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -75,20 +75,21 @@ public: size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; std::vector< std::vector >* scalarResultFrames = NULL; - if (rimCase && rimCase->resultsStorage(porosityModelEnum)) + if (rimCase && rimCase->results(porosityModelEnum)) { - scalarResultIndex = rimCase->resultsStorage(porosityModelEnum)->findOrLoadScalarResult(propertyName); + scalarResultIndex = rimCase->results(porosityModelEnum)->findOrLoadScalarResult(propertyName); if (scalarResultIndex != cvf::UNDEFINED_SIZE_T) { - scalarResultFrames = &(rimCase->resultsStorage(porosityModelEnum)->cellResults()->cellScalarResults(scalarResultIndex)); + scalarResultFrames = &(rimCase->results(porosityModelEnum)->cellScalarResults(scalarResultIndex)); } } if (scalarResultFrames == NULL) { - server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName)); + server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName)); } // Write data back : timeStepCount, bytesPrTimestep, dataForTimestep0 ... dataForTimestepN @@ -253,9 +254,9 @@ public: else { // Find the requested data - if (rimCase && rimCase->resultsStorage(porosityModelEnum)) + if (rimCase && rimCase->results(porosityModelEnum)) { - scalarResultIndex = rimCase->resultsStorage(porosityModelEnum)->findOrLoadScalarResult(propertyName); + scalarResultIndex = rimCase->results(porosityModelEnum)->findOrLoadScalarResult(propertyName); } } @@ -276,7 +277,7 @@ public: if (args.size() <= 5) { // Select all - for (size_t tsIdx = 0; tsIdx < rimCase->resultsStorage(porosityModelEnum)->cellResults()->timeStepCount(scalarResultIndex); ++tsIdx) + for (size_t tsIdx = 0; tsIdx < rimCase->results(porosityModelEnum)->timeStepCount(scalarResultIndex); ++tsIdx) { requestedTimesteps.push_back(tsIdx); } @@ -409,24 +410,24 @@ public: size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; std::vector< std::vector >* scalarResultFrames = NULL; - if (rimCase && rimCase->resultsStorage(m_porosityModelEnum)) + if (rimCase && rimCase->results(m_porosityModelEnum)) { - scalarResultIndex = rimCase->resultsStorage(m_porosityModelEnum)->findOrLoadScalarResult(RiaDefines::GENERATED, propertyName); + scalarResultIndex = rimCase->results(m_porosityModelEnum)->findOrLoadScalarResult(RiaDefines::GENERATED, propertyName); if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) { - scalarResultIndex = rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->findOrCreateScalarResultIndex(RiaDefines::GENERATED, propertyName, true); + scalarResultIndex = rimCase->results(m_porosityModelEnum)->findOrCreateScalarResultIndex(RiaDefines::GENERATED, propertyName, true); size_t scalarResWithMostTimeSteps = cvf::UNDEFINED_SIZE_T; - rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->maxTimeStepCount(&scalarResWithMostTimeSteps); - const std::vector timeStepInfos = rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->timeStepInfos(scalarResWithMostTimeSteps); - rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->setTimeStepInfos(scalarResultIndex, timeStepInfos); + rimCase->results(m_porosityModelEnum)->maxTimeStepCount(&scalarResWithMostTimeSteps); + const std::vector timeStepInfos = rimCase->results(m_porosityModelEnum)->timeStepInfos(scalarResWithMostTimeSteps); + rimCase->results(m_porosityModelEnum)->setTimeStepInfos(scalarResultIndex, timeStepInfos); } if (scalarResultIndex != cvf::UNDEFINED_SIZE_T) { - scalarResultFrames = &(rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->cellScalarResults(scalarResultIndex)); - size_t timeStepCount = rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->maxTimeStepCount(); + scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellScalarResults(scalarResultIndex)); + size_t timeStepCount = rimCase->results(m_porosityModelEnum)->maxTimeStepCount(); scalarResultFrames->resize(timeStepCount); m_currentScalarIndex = scalarResultIndex; @@ -660,7 +661,7 @@ public: if (m_requestedTimesteps.size() == 1 && m_currentScalarIndex != cvf::UNDEFINED_SIZE_T) { std::vector< std::vector >* scalarResultFrames = NULL; - scalarResultFrames = &(m_currentReservoir->resultsStorage(m_porosityModelEnum)->cellResults()->cellScalarResults(m_currentScalarIndex)); + scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->cellScalarResults(m_currentScalarIndex)); size_t lastIndexWithDataPresent = cvf::UNDEFINED_SIZE_T; for (size_t i = 0; i < scalarResultFrames->size(); i++) { @@ -802,19 +803,19 @@ public: size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; std::vector< std::vector >* scalarResultFrames = NULL; - if (rimCase && rimCase->resultsStorage(m_porosityModelEnum)) + if (rimCase && rimCase->results(m_porosityModelEnum)) { - scalarResultIndex = rimCase->resultsStorage(m_porosityModelEnum)->findOrLoadScalarResult(RiaDefines::GENERATED, propertyName); + scalarResultIndex = rimCase->results(m_porosityModelEnum)->findOrLoadScalarResult(RiaDefines::GENERATED, propertyName); if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) { - scalarResultIndex = rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->findOrCreateScalarResultIndex(RiaDefines::GENERATED, propertyName, true); + scalarResultIndex = rimCase->results(m_porosityModelEnum)->findOrCreateScalarResultIndex(RiaDefines::GENERATED, propertyName, true); } if (scalarResultIndex != cvf::UNDEFINED_SIZE_T) { - scalarResultFrames = &(rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->cellScalarResults(scalarResultIndex)); - size_t timeStepCount = rimCase->resultsStorage(m_porosityModelEnum)->cellResults()->maxTimeStepCount(); + scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellScalarResults(scalarResultIndex)); + size_t timeStepCount = rimCase->results(m_porosityModelEnum)->maxTimeStepCount(); scalarResultFrames->resize(timeStepCount); m_currentScalarIndex = scalarResultIndex; @@ -1023,7 +1024,7 @@ public: if (m_requestedTimesteps.size() == 1 && m_currentScalarIndex != cvf::UNDEFINED_SIZE_T) { std::vector< std::vector >* scalarResultFrames = NULL; - scalarResultFrames = &(m_currentReservoir->resultsStorage(m_porosityModelEnum)->cellResults()->cellScalarResults(m_currentScalarIndex)); + scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->cellScalarResults(m_currentScalarIndex)); size_t lastIndexWithDataPresent = cvf::UNDEFINED_SIZE_T; for (size_t i = 0; i < scalarResultFrames->size(); i++) { @@ -1194,16 +1195,16 @@ public: } size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; - if (rimCase && rimCase->resultsStorage(porosityModel)) + if (rimCase && rimCase->results(porosityModel)) { - scalarResultIndex = rimCase->resultsStorage(porosityModel)->findOrLoadScalarResult(propertyName); + scalarResultIndex = rimCase->results(porosityModel)->findOrLoadScalarResult(propertyName); } std::vector requestedTimesteps; if (args.size() < 5) { // Select all - for (size_t tsIdx = 0; tsIdx < rimCase->resultsStorage(porosityModel)->cellResults()->timeStepCount(scalarResultIndex); ++tsIdx) + for (size_t tsIdx = 0; tsIdx < rimCase->results(porosityModel)->timeStepCount(scalarResultIndex); ++tsIdx) { requestedTimesteps.push_back(tsIdx); } @@ -1256,7 +1257,7 @@ public: for (size_t timeStep : requestedTimesteps) { - const std::vector& scalarResults = rimCase->resultsStorage(porosityModel)->cellResults()->cellScalarResults(scalarResultIndex, timeStep); + const std::vector& scalarResults = rimCase->results(porosityModel)->cellScalarResults(scalarResultIndex, timeStep); for (const std::pair selectedCell : selectedCells) diff --git a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp index 328377fe21..841e26d8c7 100644 --- a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp +++ b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp @@ -386,7 +386,7 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigEclipseCaseData* eclips RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel(); if (resultColors->isTernarySaturationSelected()) { - RimReservoirCellResultsStorage* gridCellResults = resultColors->currentGridCellResults(); + RigCaseCellResultsData* gridCellResults = resultColors->currentGridCellResults(); if (gridCellResults) { size_t soilScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL"); @@ -666,7 +666,7 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors) if (resultColors->isTernarySaturationSelected()) { - RimReservoirCellResultsStorage* gridCellResults = m_reservoirView->cellResult()->currentGridCellResults(); + RigCaseCellResultsData* gridCellResults = m_reservoirView->cellResult()->currentGridCellResults(); if (gridCellResults) { size_t soilScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL");