From 7598d8c1963f72858fd8ed50925eb7a11284a30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Wed, 9 Aug 2017 14:10:39 +0200 Subject: [PATCH 01/36] #1696 Threshold option for aquifer cells --- .../Flow/RimFlowCharacteristicsPlot.cpp | 6 +- .../Flow/RimFlowCharacteristicsPlot.h | 1 + .../ReservoirDataModel/RigFlowDiagResults.cpp | 34 ++++++++--- .../ReservoirDataModel/RigFlowDiagResults.h | 20 +------ .../RigFlowDiagSolverInterface.cpp | 56 +++++++++++++------ .../RigFlowDiagSolverInterface.h | 27 +++++---- 6 files changed, 88 insertions(+), 56 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp index 90acb4e88b..a1d6c2beed 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp @@ -58,6 +58,7 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot() CAF_PDM_InitFieldNoDefault(&m_timeStepSelectionType, "TimeSelectionType", "Time Steps", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_selectedTimeSteps, "SelectedTimeSteps", "", "", "", ""); + CAF_PDM_InitField(&m_maxPvFraction, "CellPVThreshold", 0.1, "Aquifer Cell Threshold", "", "Exclude Aquifer Effects by adding a Cell Pore Volume Threshold as Fraction of Total Pore Volume.", ""); CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Legend", "", "", ""); @@ -198,6 +199,7 @@ void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::Pdm if (m_timeStepSelectionType == SELECT_AVAILABLE) uiOrdering.add(&m_selectedTimeSteps); uiOrdering.add(&m_showLegend); + uiOrdering.add(&m_maxPvFraction); uiOrdering.skipRemainingFields(); } @@ -288,14 +290,14 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate() for ( int timeStepIdx: calculatedTimesteps ) { - lorenzVals[timeStepIdx] = flowResult->flowCharacteristicsResults(timeStepIdx).m_lorenzCoefficient; + lorenzVals[timeStepIdx] = flowResult->flowCharacteristicsResults(timeStepIdx, m_maxPvFraction()).m_lorenzCoefficient; } m_flowCharPlotWidget->setLorenzCurve(timeStepStrings, timeStepDates, lorenzVals); for ( int timeStepIdx: calculatedTimesteps ) { - const auto & flowCharResults = flowResult->flowCharacteristicsResults(timeStepIdx); + const auto flowCharResults = flowResult->flowCharacteristicsResults(timeStepIdx, m_maxPvFraction()); m_flowCharPlotWidget->addFlowCapStorageCapCurve(timeStepDates[timeStepIdx], flowCharResults.m_flowCapStorageCapCurve.first, flowCharResults.m_flowCapStorageCapCurve.second); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h index d8bfafd664..8e1747d129 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h @@ -87,6 +87,7 @@ private: caf::PdmField > m_timeStepSelectionType; caf::PdmField > m_selectedTimeSteps; caf::PdmField m_showLegend; + caf::PdmField m_maxPvFraction; std::vector m_currentlyPlottedTimeSteps; diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index 1261d74b61..b86e2fdf8b 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -41,7 +41,6 @@ RigFlowDiagResults::RigFlowDiagResults(RimFlowDiagSolution* flowSolution, size_t m_timeStepCount = timeStepCount; m_hasAtemptedNativeResults.resize(timeStepCount, false); m_injProdPairFluxCommunicationTimesteps.resize(timeStepCount); - m_flowCharResultFrames.resize(timeStepCount); } //-------------------------------------------------------------------------------------------------- @@ -121,12 +120,6 @@ void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted(size_t f m_injProdPairFluxCommunicationTimesteps[frameIndex].swap(nativeTimestepResults.injProdWellPairFluxes()); - m_flowCharResultFrames[frameIndex].m_lorenzCoefficient = nativeTimestepResults.lorenzCoefficient(); - m_flowCharResultFrames[frameIndex].m_flowCapStorageCapCurve.first.swap(nativeTimestepResults.flowCapStorageCapCurve().first); - m_flowCharResultFrames[frameIndex].m_flowCapStorageCapCurve.second.swap(nativeTimestepResults.flowCapStorageCapCurve().second); - m_flowCharResultFrames[frameIndex].m_sweepEfficiencyCurve.first.swap(nativeTimestepResults.sweepEfficiencyCurve().first); - m_flowCharResultFrames[frameIndex].m_sweepEfficiencyCurve.second.swap(nativeTimestepResults.sweepEfficiencyCurve().second); - m_hasAtemptedNativeResults[frameIndex] = true; } } @@ -679,8 +672,31 @@ std::vector RigFlowDiagResults::calculatedTimeSteps() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigFlowDiagResults::FlowCharacteristicsResultFrame::FlowCharacteristicsResultFrame() - : m_lorenzCoefficient(HUGE_VAL) +RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::flowCharacteristicsResults(int frameIndex, double max_pv_fraction) { + std::vector tracerNames = m_flowDiagSolution->tracerNames(); + + std::set injectorNames; + std::set producerNames; + for (const QString& tracerName : tracerNames) + { + RimFlowDiagSolution::TracerStatusType status = m_flowDiagSolution->tracerStatusInTimeStep(tracerName, frameIndex); + if (status == RimFlowDiagSolution::INJECTOR) + { + injectorNames.insert(tracerName.toStdString()); + } + else if (status == RimFlowDiagSolution::PRODUCER) + { + producerNames.insert(tracerName.toStdString()); + } + } + + RigFlowDiagResultAddress injectorAddress(RIG_FLD_TOF_RESNAME, injectorNames); + RigFlowDiagResultAddress producerAddress(RIG_FLD_TOF_RESNAME, producerNames); + + const std::vector* injectorResults = resultValues(injectorAddress, frameIndex); + const std::vector* producerResults = resultValues(producerAddress, frameIndex); + + return solverInterface()->calculateFlowCharacteristics(*injectorResults, *producerResults, max_pv_fraction); } diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h index fa230eb809..de8f328237 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h @@ -19,6 +19,8 @@ #include "RigFlowDiagResultAddress.h" +#include "RigFlowDiagSolverInterface.h" + #include "RimFlowDiagSolution.h" #include "cafPdmPointer.h" @@ -32,7 +34,6 @@ class RigFlowDiagResultFrames; class RigStatisticsDataCache; -class RigFlowDiagSolverInterface; class RigActiveCellInfo; class RigFlowDiagResults: public cvf::Object @@ -65,18 +66,8 @@ public: std::vector calculatedTimeSteps(); - struct FlowCharacteristicsResultFrame - { - FlowCharacteristicsResultFrame(); - using Curve = std::pair< std::vector, std::vector >; - - Curve m_flowCapStorageCapCurve; - Curve m_sweepEfficiencyCurve; - double m_lorenzCoefficient; - }; - - const FlowCharacteristicsResultFrame& flowCharacteristicsResults(int frameIndex) { return m_flowCharResultFrames[frameIndex];} + RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame flowCharacteristicsResults(int frameIndex, double max_pv_fraction); private: const std::vector* findOrCalculateResult (const RigFlowDiagResultAddress& resVarAddr, size_t frameIndex); @@ -133,11 +124,6 @@ private: using InjectorProducerCommunicationMap = std::map< std::pair, std::pair >; std::vector m_injProdPairFluxCommunicationTimesteps; - - - - std::vector m_flowCharResultFrames; - }; diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index a69cdf5192..2d677918c6 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -39,7 +39,7 @@ /// //-------------------------------------------------------------------------------------------------- RigFlowDiagTimeStepResult::RigFlowDiagTimeStepResult(size_t activeCellCount) - : m_activeCellCount(activeCellCount), m_lorenzCoefficient(HUGE_VAL) + : m_activeCellCount(activeCellCount) { } @@ -394,24 +394,46 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI } } } - - try - { - Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve(*(injectorSolution.get()), - *(producerSolution.get()), - m_opmFlowDiagStaticData->m_poreVolume, - 0.1); - - result.setFlowCapStorageCapCurve(flowCapStorCapCurve); - result.setSweepEfficiencyCurve(sweepEfficiency(flowCapStorCapCurve)); - result.setLorenzCoefficient(lorenzCoefficient(flowCapStorCapCurve)); - } - catch ( const std::exception& e ) - { - QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: " + QString(e.what())); - } } return result; // Relying on implicit move constructor } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagSolverInterface::calculateFlowCharacteristics(const std::vector& injector_tof, + const std::vector& producer_tof, + double max_pv_fraction) +{ + using namespace Opm::FlowDiagnostics; + RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame result; + + try + { + Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve(injector_tof, + producer_tof, + m_opmFlowDiagStaticData->m_poreVolume, + max_pv_fraction); + + result.m_flowCapStorageCapCurve = flowCapStorCapCurve; + result.m_lorenzCoefficient = lorenzCoefficient(flowCapStorCapCurve); + result.m_sweepEfficiencyCurve = sweepEfficiency(flowCapStorCapCurve); + } + catch (const std::exception& e) + { + QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: " + QString(e.what())); + } + + return result; +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame::FlowCharacteristicsResultFrame() + : m_lorenzCoefficient(HUGE_VAL) +{ + +} diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h index 81a154b715..6787db82e9 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h @@ -42,18 +42,11 @@ public: const std::pair& injProdFluxes) ; using Curve = std::pair< std::vector, std::vector >; - void setFlowCapStorageCapCurve(const Curve& flCapStCapCurve) { m_flowCapStorageCapCurve = flCapStCapCurve;} - void setSweepEfficiencyCurve(const Curve& sweepEffCurve) { m_sweepEfficiencyCurve = sweepEffCurve; } - void setLorenzCoefficient(double coeff) { m_lorenzCoefficient = coeff;} // Used to "steal" the data from this one using swap std::map >& nativeResults() { return m_nativeResults; } std::map, std::pair > & injProdWellPairFluxes() { return m_injProdWellPairFluxes; } - Curve& flowCapStorageCapCurve() { return m_flowCapStorageCapCurve; } - Curve& sweepEfficiencyCurve() { return m_sweepEfficiencyCurve; } - double lorenzCoefficient() { return m_lorenzCoefficient;} - private: void addResult(const RigFlowDiagResultAddress& resAddr, const std::map& cellValues); @@ -61,10 +54,6 @@ private: std::map > m_nativeResults; std::map, std::pair > m_injProdWellPairFluxes; - Curve m_flowCapStorageCapCurve; - Curve m_sweepEfficiencyCurve; - double m_lorenzCoefficient; - size_t m_activeCellCount; }; @@ -74,6 +63,18 @@ class RigOpmFlowDiagStaticData; class RigFlowDiagSolverInterface : public cvf::Object { +public: + struct FlowCharacteristicsResultFrame + { + FlowCharacteristicsResultFrame(); + + using Curve = std::pair< std::vector, std::vector >; + + Curve m_flowCapStorageCapCurve; + Curve m_sweepEfficiencyCurve; + double m_lorenzCoefficient; + }; + public: explicit RigFlowDiagSolverInterface(RimEclipseResultCase * eclipseCase); virtual ~RigFlowDiagSolverInterface(); @@ -82,6 +83,10 @@ public: std::map > injectorTracers, std::map > producerTracers); + FlowCharacteristicsResultFrame calculateFlowCharacteristics(const std::vector& injector_tof, + const std::vector& producer_tof, + double max_pv_fraction); + private: RimEclipseResultCase * m_eclipseCase; From 7cf1c821426d66744af03c0d484d3fbbc3778eae Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 9 Aug 2017 15:03:12 +0200 Subject: [PATCH 02/36] Add system documentation for Eclipse binary file import --- doc/eclipse_binary_file_classes.plantuml | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/eclipse_binary_file_classes.plantuml diff --git a/doc/eclipse_binary_file_classes.plantuml b/doc/eclipse_binary_file_classes.plantuml new file mode 100644 index 0000000000..eb7fd1585a --- /dev/null +++ b/doc/eclipse_binary_file_classes.plantuml @@ -0,0 +1,31 @@ +@startuml + +class RifReaderInterface { +virtual open() +virtual close() +virtual staticResult() +virtual dynamicResult() +virtual timeSteps() +} + +RifEclipseRestartDataAccess <|- RifEclipseRestartFilesetAccess +RifEclipseRestartDataAccess <|- RifEclipseUnifiedRestartFileAccess + +RifReaderInterface <|- RifReaderEclipseOutput + +class RifEclipseOutputFileTools { +helper class with several static functions +used to read data from Eclipse binary files +} + + +RifReaderEclipseOutput o-- "1..N" RifEclipseRestartDataAccess + + +RifEclipseRestartFilesetAccess --o RifEclipseOutputFileTools : uses +RifEclipseUnifiedRestartFileAccess --o RifEclipseOutputFileTools : uses + +ecl_file_type "N" o-- RifEclipseRestartFilesetAccess +ecl_file_type "1" o-- RifEclipseUnifiedRestartFileAccess + +@enduml From 747721a7f842134548b9a1a40902240cc7daeb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 10 Aug 2017 10:09:01 +0200 Subject: [PATCH 03/36] #1698 Use opm-flowdiagnostics calculation of fluxes if not present in Eclipse restart file --- .../ProjectDataModel/RimEclipseResultCase.cpp | 11 ++-- .../RigFlowDiagInterfaceTools.h | 18 ++++++ .../ReservoirDataModel/RigFlowDiagResults.cpp | 2 +- .../RigFlowDiagSolverInterface.cpp | 56 ++++++++++++++----- .../RigFlowDiagSolverInterface.h | 6 +- 5 files changed, 70 insertions(+), 23 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index 0cae5e39c7..3fa275876c 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -136,14 +136,11 @@ bool RimEclipseResultCase::openEclipseGridFile() m_gridAndWellDataIsReadFromFile = true; m_activeCellInfoIsReadFromFile = true; - if (eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes()) + m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this); + + if (m_flowDiagSolutions.size() == 0) { - m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this); - - if (m_flowDiagSolutions.size() == 0) - { - m_flowDiagSolutions.push_back(new RimFlowDiagSolution()); - } + m_flowDiagSolutions.push_back(new RimFlowDiagSolution()); } return true; diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h index ce1edb8f84..4a76a16929 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h @@ -81,6 +81,24 @@ namespace RigFlowDiagInterfaceTools { return extractFluxField(G, getFlux); } + inline Opm::FlowDiagnostics::ConnectionValues + calculateFluxField(const Opm::ECLGraph& G, + const Opm::ECLInitFileData& init, + const Opm::ECLRestartData& rstrt) + { + auto satfunc = Opm::ECLSaturationFunc(G, init); + + Opm::ECLFluxCalc calc(G, std::move(satfunc)); + + auto getFlux = [&calc, &rstrt] + (const Opm::ECLPhaseIndex p) + { + return calc.flux(rstrt, p); + }; + + return extractFluxField(G, getFlux); + } + template Opm::FlowDiagnostics::CellSetValues extractWellFlows(const Opm::ECLGraph& G, diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index b86e2fdf8b..2073e0942b 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -698,5 +698,5 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::f const std::vector* injectorResults = resultValues(injectorAddress, frameIndex); const std::vector* producerResults = resultValues(producerAddress, frameIndex); - return solverInterface()->calculateFlowCharacteristics(*injectorResults, *producerResults, max_pv_fraction); + return solverInterface()->calculateFlowCharacteristics(injectorResults, producerResults, max_pv_fraction); } diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 2d677918c6..0c587adf30 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -164,14 +164,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI // Get set of files QString gridFileName = m_eclipseCase->gridFileName(); - QStringList m_filesWithSameBaseName; + std::string initFileName = getInitFileName(); - if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(gridFileName, &m_filesWithSameBaseName) ) return result; + if (initFileName.empty()) return result; - QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE); - - m_opmFlowDiagStaticData = new RigOpmFlowDiagStaticData(gridFileName.toStdString(), - initFileName.toStdString()); + m_opmFlowDiagStaticData = new RigOpmFlowDiagStaticData(gridFileName.toStdString(), initFileName); progressInfo.incrementProgress(); progressInfo.setProgressDescription("Calculating Connectivities"); @@ -189,6 +186,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI m_opmFlowDiagStaticData->m_fldToolbox->assignPoreVolume( m_opmFlowDiagStaticData->m_poreVolume); // Look for unified restart file + QStringList m_filesWithSameBaseName; + + if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(gridFileName, &m_filesWithSameBaseName) ) return result; QString restartFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE); if ( !restartFileName.isEmpty() ) @@ -251,10 +251,19 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI Opm::FlowDiagnostics::CellSetValues sumWellFluxPrCell; { - Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph), - *currentRestartData); + if (m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes()) + { + Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph), + *currentRestartData); + m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionsVals); + } + else + { + Opm::ECLInitFileData init(getInitFileName()); + Opm::FlowDiagnostics::ConnectionValues connectionVals = RigFlowDiagInterfaceTools::calculateFluxField((*m_opmFlowDiagStaticData->m_eclGraph), init, *currentRestartData); + m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionVals); + } - m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionsVals); progressInfo.incrementProgress(); @@ -402,17 +411,22 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagSolverInterface::calculateFlowCharacteristics(const std::vector& injector_tof, - const std::vector& producer_tof, +RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagSolverInterface::calculateFlowCharacteristics(const std::vector* injector_tof, + const std::vector* producer_tof, double max_pv_fraction) { using namespace Opm::FlowDiagnostics; RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame result; + if (injector_tof == nullptr || producer_tof == nullptr) + { + return result; + } + try { - Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve(injector_tof, - producer_tof, + Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve(*injector_tof, + *producer_tof, m_opmFlowDiagStaticData->m_poreVolume, max_pv_fraction); @@ -428,6 +442,22 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagSolverInte return result; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::string RigFlowDiagSolverInterface::getInitFileName() const +{ + QString gridFileName = m_eclipseCase->gridFileName(); + + QStringList m_filesWithSameBaseName; + + if (!RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(gridFileName, &m_filesWithSameBaseName)) return std::string(); + + QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE); + + return initFileName.toStdString(); +} + //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h index 6787db82e9..405fb1b243 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h @@ -83,11 +83,13 @@ public: std::map > injectorTracers, std::map > producerTracers); - FlowCharacteristicsResultFrame calculateFlowCharacteristics(const std::vector& injector_tof, - const std::vector& producer_tof, + FlowCharacteristicsResultFrame calculateFlowCharacteristics(const std::vector* injector_tof, + const std::vector* producer_tof, double max_pv_fraction); private: + std::string getInitFileName() const; + RimEclipseResultCase * m_eclipseCase; cvf::ref m_opmFlowDiagStaticData; From 03480c38c44b93a2017422ec6322797c23136854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 10 Aug 2017 11:17:19 +0200 Subject: [PATCH 04/36] #1698 Enable Flow Diagnostics cell result when fluxes are not present in Eclipse restart file --- .../ProjectDataModel/RimEclipseResultDefinition.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index 4ac3dd0136..ffd376ee1f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -421,18 +421,11 @@ QList RimEclipseResultDefinition::calculateValueOptions( if ( fieldNeedingOptions == &m_resultTypeUiField ) { - bool hasFlowDiagFluxes = false; - RimEclipseResultCase* eclResCase = dynamic_cast(m_eclipseCase.p()); - if ( eclResCase && eclResCase->eclipseCaseData() ) - { - hasFlowDiagFluxes = eclResCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes(); - } - RimGridTimeHistoryCurve* timeHistoryCurve; this->firstAncestorOrThisOfType(timeHistoryCurve); // Do not include flow diagnostics results if not available or is a time history curve - if ( !hasFlowDiagFluxes || timeHistoryCurve != nullptr ) + if ( timeHistoryCurve != nullptr ) { using ResCatEnum = caf::AppEnum< RiaDefines::ResultCatType >; for ( size_t i = 0; i < ResCatEnum::size(); ++i ) From efb79ac753c85f5b4edae25e50730b06357a859b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 10 Aug 2017 15:08:30 +0200 Subject: [PATCH 05/36] #1202 Flow: Handle separate phase solutions --- .../Flow/RimFlowCharacteristicsPlot.cpp | 6 +-- .../Flow/RimWellAllocationPlot.cpp | 2 +- .../RimEclipseResultDefinition.cpp | 11 ++++- .../RimEclipseResultDefinition.h | 4 +- .../RigFlowDiagInterfaceTools.h | 36 +++++++++++++---- .../RigFlowDiagResultAddress.cpp | 24 ++++++++++- .../RigFlowDiagResultAddress.h | 28 +++++++++++-- .../ReservoirDataModel/RigFlowDiagResults.cpp | 40 +++++++++++-------- .../ReservoirDataModel/RigFlowDiagResults.h | 8 ++-- .../RigFlowDiagSolverInterface.cpp | 26 +++++++----- .../RigFlowDiagSolverInterface.h | 5 ++- 11 files changed, 139 insertions(+), 51 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp index a1d6c2beed..a3fc23a568 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp @@ -120,7 +120,7 @@ void RimFlowCharacteristicsPlot::updateCurrentTimeStep() if (!m_flowDiagSolution()) return; RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults(); - std::vector calculatedTimesteps = flowResult->calculatedTimeSteps(); + std::vector calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL); if (m_currentlyPlottedTimeSteps == calculatedTimesteps) return; @@ -172,7 +172,7 @@ QList RimFlowCharacteristicsPlot::calculateValueOptions( if ( m_flowDiagSolution ) { RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults(); - std::vector calculatedTimesteps = flowResult->calculatedTimeSteps(); + std::vector calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL); QStringList timeStepDates = m_case->timeStepStrings(); @@ -264,7 +264,7 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate() if (m_flowDiagSolution && m_flowCharPlotWidget) { RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults(); - std::vector calculatedTimesteps = flowResult->calculatedTimeSteps(); + std::vector calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL); if (m_timeStepSelectionType == SELECT_AVAILABLE) { diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 17be765928..e606cbea8d 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -341,7 +341,7 @@ std::map *> RimWellAllocationPlot::findReleva { if ( m_flowDiagSolution->tracerStatusInTimeStep(tracerName, m_timeStep) == requestedTracerType ) { - RigFlowDiagResultAddress resAddr(RIG_FLD_CELL_FRACTION_RESNAME, tracerName.toStdString()); + RigFlowDiagResultAddress resAddr(RIG_FLD_CELL_FRACTION_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, tracerName.toStdString()); const std::vector* tracerCellFractions = m_flowDiagSolution->flowDiagResults()->resultValues(resAddr, m_timeStep); if (tracerCellFractions) tracerCellFractionValues[tracerName] = tracerCellFractions; } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index ffd376ee1f..aeeb4a6d4f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -82,6 +82,7 @@ RimEclipseResultDefinition::RimEclipseResultDefinition() m_selectedTracers.uiCapability()->setUiHidden(true); CAF_PDM_InitFieldNoDefault(&m_flowTracerSelectionMode, "FlowTracerSelectionMode", "Tracers", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_phaseSelection, "PhaseSelection", "Phases", "", "", ""); // Ui only fields @@ -131,6 +132,7 @@ void RimEclipseResultDefinition::simpleCopy(const RimEclipseResultDefinition* ot this->setFlowSolution(other->m_flowSolution()); this->setSelectedTracers(other->m_selectedTracers()); m_flowTracerSelectionMode = other->m_flowTracerSelectionMode(); + m_phaseSelection = other->m_phaseSelection; } //-------------------------------------------------------------------------------------------------- @@ -239,6 +241,11 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha loadDataAndUpdate(); } + if (&m_phaseSelection == changedField) + { + loadDataAndUpdate(); + } + if (&m_selectedTracersUiFieldFilter == changedField) { auto visibleTracerNames = tracerNamesMatchingFilter(); @@ -713,7 +720,7 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const } } - return RigFlowDiagResultAddress(m_resultVariable().toStdString(), selTracerNames); + return RigFlowDiagResultAddress(m_resultVariable().toStdString(), m_phaseSelection(), selTracerNames); } //-------------------------------------------------------------------------------------------------- @@ -1020,6 +1027,8 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm uiOrdering.add(&m_selectedTracersUiField); } + uiOrdering.add(&m_phaseSelection); + if ( m_flowSolution() == nullptr ) { assignFlowSolutionFromCase(); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h index 5eb61ed8bf..dcbb8720a4 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h @@ -22,6 +22,8 @@ #include "RiaDefines.h" +#include "RigFlowDiagResultAddress.h" + #include "cafAppEnum.h" #include "cafPdmField.h" #include "cafPdmObject.h" @@ -33,7 +35,6 @@ class RimEclipseCase; class RimEclipseView; class RimReservoirCellResultsStorage; class RimFlowDiagSolution; -class RigFlowDiagResultAddress; //================================================================================================== @@ -124,6 +125,7 @@ protected: caf::PdmField< caf::AppEnum< FlowTracerSelectionType > > m_flowTracerSelectionMode; caf::PdmPtrField m_flowSolutionUiField; + caf::PdmField< RigFlowDiagResultAddress::PhaseSelectionEnum > m_phaseSelection; caf::PdmField m_selectedTracersUiFieldFilter; caf::PdmField > m_selectedTracersUiField; diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h index 4a76a16929..b8b61a88c1 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h @@ -18,6 +18,7 @@ #pragma once +#include "RigFlowDiagResultAddress.h" #include #include @@ -35,15 +36,34 @@ namespace RigFlowDiagInterfaceTools { + std::vector getPhases(RigFlowDiagResultAddress::PhaseSelection phaseSelection) + { + std::vector phases; + + if (phaseSelection & RigFlowDiagResultAddress::PHASE_GAS) + { + phases.push_back(Opm::ECLPhaseIndex::Vapour); + } + if (phaseSelection & RigFlowDiagResultAddress::PHASE_OIL) + { + phases.push_back(Opm::ECLPhaseIndex::Liquid); + } + if (phaseSelection & RigFlowDiagResultAddress::PHASE_WAT) + { + phases.push_back(Opm::ECLPhaseIndex::Aqua); + } + + return phases; + } + template inline Opm::FlowDiagnostics::ConnectionValues extractFluxField(const Opm::ECLGraph& G, - FluxCalc&& getFlux) + FluxCalc&& getFlux, + std::vector actPh) { using ConnVals = Opm::FlowDiagnostics::ConnectionValues; - const auto actPh = G.activePhases(); - auto flux = ConnVals(ConnVals::NumConnections{ G.numConnections() }, ConnVals::NumPhases{ actPh.size() }); @@ -70,7 +90,8 @@ namespace RigFlowDiagInterfaceTools { inline Opm::FlowDiagnostics::ConnectionValues extractFluxFieldFromRestartFile(const Opm::ECLGraph& G, - const Opm::ECLRestartData& rstrt) + const Opm::ECLRestartData& rstrt, + RigFlowDiagResultAddress::PhaseSelection phaseSelection) { auto getFlux = [&G, &rstrt] (const Opm::ECLPhaseIndex p) @@ -78,13 +99,14 @@ namespace RigFlowDiagInterfaceTools { return G.flux(rstrt, p); }; - return extractFluxField(G, getFlux); + return extractFluxField(G, getFlux, getPhases(phaseSelection)); } inline Opm::FlowDiagnostics::ConnectionValues calculateFluxField(const Opm::ECLGraph& G, const Opm::ECLInitFileData& init, - const Opm::ECLRestartData& rstrt) + const Opm::ECLRestartData& rstrt, + RigFlowDiagResultAddress::PhaseSelection phaseSelection) { auto satfunc = Opm::ECLSaturationFunc(G, init); @@ -96,7 +118,7 @@ namespace RigFlowDiagInterfaceTools { return calc.flux(rstrt, p); }; - return extractFluxField(G, getFlux); + return extractFluxField(G, getFlux, getPhases(phaseSelection)); } template diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.cpp index e41c37d665..0469dc0ac2 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.cpp @@ -18,6 +18,19 @@ #include "RigFlowDiagResultAddress.h" +namespace caf +{ + template<> + void RigFlowDiagResultAddress::PhaseSelectionEnum::setUp() + { + addItem(RigFlowDiagResultAddress::PHASE_ALL, "PHASE_ALL", "All"); + addItem(RigFlowDiagResultAddress::PHASE_OIL, "PHASE_OIL", "Oil"); + addItem(RigFlowDiagResultAddress::PHASE_GAS, "PHASE_GAS", "Gas"); + addItem(RigFlowDiagResultAddress::PHASE_WAT, "PHASE_WAT", "Water"); + + setDefault(RigFlowDiagResultAddress::PHASE_ALL); + } +} //-------------------------------------------------------------------------------------------------- /// @@ -35,6 +48,10 @@ std::string RigFlowDiagResultAddress::uiText() const std::string uiVarname = variableName; std::string uitext = uiVarname; + if (phaseSelection != PHASE_ALL) + { + uitext += " (" + RigFlowDiagResultAddress::PhaseSelectionEnum(phaseSelection).uiText().toStdString() + ")"; + } uitext += " ("; for (const std::string& tracerName : selectedTracerNames) { @@ -49,6 +66,11 @@ std::string RigFlowDiagResultAddress::uiText() const //-------------------------------------------------------------------------------------------------- std::string RigFlowDiagResultAddress::uiShortText() const { - return variableName; + std::string uitext = variableName; + if (phaseSelection != PHASE_ALL) + { + uitext += " (" + RigFlowDiagResultAddress::PhaseSelectionEnum(phaseSelection).uiText().toStdString() + ")"; + } + return uitext; } diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h index 7b0844988e..d1a80d738d 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h @@ -17,6 +17,8 @@ ///////////////////////////////////////////////////////////////////////////////// #pragma once +#include "cafAppEnum.h" + #include #include @@ -37,11 +39,24 @@ class RigFlowDiagResultAddress { public: - RigFlowDiagResultAddress(const std::string& aVariableName, const std::set& someSelectedTracerNames) - : variableName(aVariableName), selectedTracerNames(someSelectedTracerNames) {} + enum PhaseSelection + { + PHASE_ALL = 0b111, + PHASE_OIL = 0b001, + PHASE_GAS = 0b010, + PHASE_WAT = 0b100, + }; - RigFlowDiagResultAddress(const std::string& aVariableName, const std::string& tracerName) - : variableName(aVariableName) + typedef caf::AppEnum PhaseSelectionEnum; + + RigFlowDiagResultAddress(const std::string& aVariableName, PhaseSelection phaseSelection, const std::set& someSelectedTracerNames) + : variableName(aVariableName), + phaseSelection(phaseSelection), + selectedTracerNames(someSelectedTracerNames) {} + + RigFlowDiagResultAddress(const std::string& aVariableName, PhaseSelection phaseSelection, const std::string& tracerName) + : variableName(aVariableName), + phaseSelection(phaseSelection) { selectedTracerNames.insert(tracerName); } @@ -53,6 +68,7 @@ public: std::string variableName; std::set selectedTracerNames; + PhaseSelection phaseSelection; bool operator< (const RigFlowDiagResultAddress& other) const { @@ -60,6 +76,10 @@ public: { return selectedTracerNames < other.selectedTracerNames; } + if (phaseSelection != other.phaseSelection) + { + return phaseSelection < other.phaseSelection; + } return variableName < other.variableName; } diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index 2073e0942b..e8f500c436 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -39,7 +39,7 @@ RigFlowDiagResults::RigFlowDiagResults(RimFlowDiagSolution* flowSolution, size_t { m_timeStepCount = timeStepCount; - m_hasAtemptedNativeResults.resize(timeStepCount, false); + m_hasAtemptedNativeResults.resize(timeStepCount); m_injProdPairFluxCommunicationTimesteps.resize(timeStepCount); } @@ -91,7 +91,7 @@ const std::vector* RigFlowDiagResults::findOrCalculateResult(const RigFl if (!solverInterface()) return nullptr; - calculateNativeResultsIfNotPreviouslyAttempted(frameIndex); + calculateNativeResultsIfNotPreviouslyAttempted(frameIndex, resVarAddr.phaseSelection); return findScalarResultFrame(resVarAddr, frameIndex); } @@ -99,12 +99,14 @@ const std::vector* RigFlowDiagResults::findOrCalculateResult(const RigFl //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex) +void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex, RigFlowDiagResultAddress::PhaseSelection phaseSelection) { - if ( !m_hasAtemptedNativeResults[frameIndex] ) + auto it = m_hasAtemptedNativeResults[frameIndex].find(phaseSelection); + if ( it == m_hasAtemptedNativeResults[frameIndex].end() || !it->second ) { RigFlowDiagTimeStepResult nativeTimestepResults = solverInterface()->calculate(frameIndex, + phaseSelection, m_flowDiagSolution->allInjectorTracerActiveCellIndices(frameIndex), m_flowDiagSolution->allProducerTracerActiveCellIndices(frameIndex)); @@ -118,9 +120,9 @@ void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted(size_t f nativeResFrames->frameData(frameIndex).swap(resIt.second); } - m_injProdPairFluxCommunicationTimesteps[frameIndex].swap(nativeTimestepResults.injProdWellPairFluxes()); + m_injProdPairFluxCommunicationTimesteps[frameIndex][phaseSelection].swap(nativeTimestepResults.injProdWellPairFluxes()); - m_hasAtemptedNativeResults[frameIndex] = true; + m_hasAtemptedNativeResults[frameIndex][phaseSelection] = true; } } @@ -421,7 +423,7 @@ std::vector* > RigFlowDiagResults::findResultsForSelec if (tracerType != RimFlowDiagSolution::CLOSED && ( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::UNDEFINED) ) { - selectedTracersResults.push_back(findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, tracerName), frameIndex)); + selectedTracersResults.push_back(findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, resVarAddr.phaseSelection, tracerName), frameIndex)); } } @@ -448,7 +450,7 @@ RigFlowDiagResults::findNamedResultsForSelectedTracers(const RigFlowDiagResultAd if (tracerType != RimFlowDiagSolution::CLOSED && ( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::UNDEFINED) ) { - selectedTracersResults.push_back(std::make_pair(tracerName, findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, tracerName), frameIndex))); + selectedTracersResults.push_back(std::make_pair(tracerName, findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, resVarAddr.phaseSelection, tracerName), frameIndex))); } } @@ -625,10 +627,10 @@ std::pair RigFlowDiagResults::injectorProducerPairFluxes(const s const std::string& prodTracerName, int frameIndex) { - calculateNativeResultsIfNotPreviouslyAttempted(frameIndex); + calculateNativeResultsIfNotPreviouslyAttempted(frameIndex, RigFlowDiagResultAddress::PHASE_ALL); - auto commPair = m_injProdPairFluxCommunicationTimesteps[frameIndex].find(std::make_pair(injTracername, prodTracerName)); - if (commPair != m_injProdPairFluxCommunicationTimesteps[frameIndex].end()) + auto commPair = m_injProdPairFluxCommunicationTimesteps[frameIndex][RigFlowDiagResultAddress::PHASE_ALL].find(std::make_pair(injTracername, prodTracerName)); + if (commPair != m_injProdPairFluxCommunicationTimesteps[frameIndex][RigFlowDiagResultAddress::PHASE_ALL].end()) { return commPair->second; } @@ -643,10 +645,10 @@ std::pair RigFlowDiagResults::injectorProducerPairFluxes(const s //-------------------------------------------------------------------------------------------------- double RigFlowDiagResults::maxAbsPairFlux(int frameIndex) { - calculateNativeResultsIfNotPreviouslyAttempted(frameIndex); + calculateNativeResultsIfNotPreviouslyAttempted(frameIndex, RigFlowDiagResultAddress::PHASE_ALL); double maxFlux = 0.0; - for (const auto& commPair : m_injProdPairFluxCommunicationTimesteps[frameIndex]) + for (const auto& commPair : m_injProdPairFluxCommunicationTimesteps[frameIndex][RigFlowDiagResultAddress::PHASE_ALL]) { if (fabs(commPair.second.first) > maxFlux ) maxFlux = fabs(commPair.second.first); if (fabs(commPair.second.second) > maxFlux ) maxFlux = fabs(commPair.second.second); @@ -658,12 +660,16 @@ double RigFlowDiagResults::maxAbsPairFlux(int frameIndex) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigFlowDiagResults::calculatedTimeSteps() +std::vector RigFlowDiagResults::calculatedTimeSteps(RigFlowDiagResultAddress::PhaseSelection phaseSelection) { std::vector timestepIndices; for (size_t tsIdx = 0; tsIdx < m_timeStepCount; ++tsIdx) { - if (m_hasAtemptedNativeResults[tsIdx]) timestepIndices.push_back(static_cast(tsIdx)); + auto it = m_hasAtemptedNativeResults[tsIdx].find(phaseSelection); + if (it != m_hasAtemptedNativeResults[tsIdx].end() && it->second) + { + timestepIndices.push_back(static_cast(tsIdx)); + } } return timestepIndices; @@ -692,8 +698,8 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::f } } - RigFlowDiagResultAddress injectorAddress(RIG_FLD_TOF_RESNAME, injectorNames); - RigFlowDiagResultAddress producerAddress(RIG_FLD_TOF_RESNAME, producerNames); + RigFlowDiagResultAddress injectorAddress(RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, injectorNames); + RigFlowDiagResultAddress producerAddress(RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, producerNames); const std::vector* injectorResults = resultValues(injectorAddress, frameIndex); const std::vector* producerResults = resultValues(producerAddress, frameIndex); diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h index de8f328237..2935e451fc 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.h @@ -64,14 +64,14 @@ public: std::pair injectorProducerPairFluxes(const std::string& injTracername, const std::string& prodTracerName, int frameIndex); double maxAbsPairFlux(int frameIndex); - std::vector calculatedTimeSteps(); + std::vector calculatedTimeSteps(RigFlowDiagResultAddress::PhaseSelection phaseSelection); RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame flowCharacteristicsResults(int frameIndex, double max_pv_fraction); private: const std::vector* findOrCalculateResult (const RigFlowDiagResultAddress& resVarAddr, size_t frameIndex); - void calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex); + void calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex, RigFlowDiagResultAddress::PhaseSelection phaseSelection); std::vector* calculateDerivedResult(const RigFlowDiagResultAddress& resVarAddr, size_t frameIndex); @@ -117,13 +117,13 @@ private: size_t m_timeStepCount; caf::PdmPointer m_flowDiagSolution; - std::vector m_hasAtemptedNativeResults; + std::vector< std::map > m_hasAtemptedNativeResults; std::map< RigFlowDiagResultAddress, cvf::ref > m_resultSets; std::map< RigFlowDiagResultAddress, cvf::ref > m_resultStatistics; using InjectorProducerCommunicationMap = std::map< std::pair, std::pair >; - std::vector m_injProdPairFluxCommunicationTimesteps; + std::vector< std::map > m_injProdPairFluxCommunicationTimesteps; }; diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 0c587adf30..3d74d710d6 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -49,12 +49,14 @@ RigFlowDiagTimeStepResult::RigFlowDiagTimeStepResult(size_t activeCellCount) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigFlowDiagTimeStepResult::setTracerTOF(const std::string& tracerName, const std::map& cellValues) +void RigFlowDiagTimeStepResult::setTracerTOF(const std::string& tracerName, + RigFlowDiagResultAddress::PhaseSelection phaseSelection, + const std::map& cellValues) { std::set tracers; tracers.insert(tracerName); - RigFlowDiagResultAddress resAddr(RIG_FLD_TOF_RESNAME, tracers); + RigFlowDiagResultAddress resAddr(RIG_FLD_TOF_RESNAME, phaseSelection, tracers); this->addResult(resAddr, cellValues); @@ -68,12 +70,14 @@ void RigFlowDiagTimeStepResult::setTracerTOF(const std::string& tracerName, cons //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigFlowDiagTimeStepResult::setTracerFraction(const std::string& tracerName, const std::map& cellValues) +void RigFlowDiagTimeStepResult::setTracerFraction(const std::string& tracerName, + RigFlowDiagResultAddress::PhaseSelection phaseSelection, + const std::map& cellValues) { std::set tracers; tracers.insert(tracerName); - this->addResult(RigFlowDiagResultAddress(RIG_FLD_CELL_FRACTION_RESNAME, tracers), cellValues); + this->addResult(RigFlowDiagResultAddress(RIG_FLD_CELL_FRACTION_RESNAME, phaseSelection, tracers), cellValues); } //-------------------------------------------------------------------------------------------------- @@ -148,6 +152,7 @@ RigFlowDiagSolverInterface::~RigFlowDiagSolverInterface() /// //-------------------------------------------------------------------------------------------------- RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepIndex, + RigFlowDiagResultAddress::PhaseSelection phaseSelection, std::map > injectorTracers, std::map > producerTracers) { @@ -254,13 +259,14 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI if (m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes()) { Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph), - *currentRestartData); + *currentRestartData, + phaseSelection); m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionsVals); } else { Opm::ECLInitFileData init(getInitFileName()); - Opm::FlowDiagnostics::ConnectionValues connectionVals = RigFlowDiagInterfaceTools::calculateFluxField((*m_opmFlowDiagStaticData->m_eclGraph), init, *currentRestartData); + Opm::FlowDiagnostics::ConnectionValues connectionVals = RigFlowDiagInterfaceTools::calculateFluxField((*m_opmFlowDiagStaticData->m_eclGraph), init, *currentRestartData, phaseSelection); m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionVals); } @@ -343,9 +349,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI for ( const CellSetID& tracerId: injectorSolution->fd.startPoints() ) { CellSetValues tofVals = injectorSolution->fd.timeOfFlight(tracerId); - result.setTracerTOF(tracerId.to_string(), tofVals); + result.setTracerTOF(tracerId.to_string(), phaseSelection, tofVals); CellSetValues fracVals = injectorSolution->fd.concentration(tracerId); - result.setTracerFraction(tracerId.to_string(), fracVals); + result.setTracerFraction(tracerId.to_string(), phaseSelection, fracVals); } progressInfo.incrementProgress(); @@ -373,9 +379,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI for ( const CellSetID& tracerId: producerSolution->fd.startPoints() ) { CellSetValues tofVals = producerSolution->fd.timeOfFlight(tracerId); - result.setTracerTOF(tracerId.to_string(), tofVals); + result.setTracerTOF(tracerId.to_string(), phaseSelection, tofVals); CellSetValues fracVals = producerSolution->fd.concentration(tracerId); - result.setTracerFraction(tracerId.to_string(), fracVals); + result.setTracerFraction(tracerId.to_string(), phaseSelection, fracVals); } progressInfo.incrementProgress(); diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h index 405fb1b243..eee1f75860 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h @@ -35,8 +35,8 @@ class RigFlowDiagTimeStepResult public: explicit RigFlowDiagTimeStepResult(size_t activeCellCount); - void setTracerTOF (const std::string& tracerName, const std::map& cellValues); - void setTracerFraction(const std::string& tracerName, const std::map& cellValues); + void setTracerTOF (const std::string& tracerName, RigFlowDiagResultAddress::PhaseSelection phaseSelection, const std::map& cellValues); + void setTracerFraction(const std::string& tracerName, RigFlowDiagResultAddress::PhaseSelection phaseSelection, const std::map& cellValues); void setInjProdWellPairFlux(const std::string& injectorTracerName, const std::string& producerTracerName, const std::pair& injProdFluxes) ; @@ -80,6 +80,7 @@ public: virtual ~RigFlowDiagSolverInterface(); RigFlowDiagTimeStepResult calculate(size_t timestep, + RigFlowDiagResultAddress::PhaseSelection phaseSelection, std::map > injectorTracers, std::map > producerTracers); From a61882d092ab9248e99f8204f85303aafac8bf6d Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Wed, 9 Aug 2017 15:09:19 +0200 Subject: [PATCH 06/36] #1126 Adding first implementation of calculator for TOF-accumulated phaase fraction. Not yet tested or called from any code. --- .../ReservoirDataModel/CMakeLists_files.cmake | 3 + ...TofAccumulatedPhaseFractionsCalculator.cpp | 114 ++++++++++++++++++ ...igTofAccumulatedPhaseFractionsCalculator.h | 53 ++++++++ ...cumulatedPhaseFractionsCalculator-Test.cpp | 29 +++++ 4 files changed, 199 insertions(+) create mode 100644 ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp create mode 100644 ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h create mode 100644 ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index 926c871211..d5afeb7338 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -58,6 +58,8 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.h ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.h ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.h +${CEE_CURRENT_LIST_DIR}RigTOFaccumulatedPhaseFractionsPlot.h + ) @@ -110,6 +112,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.cpp ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.cpp ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.cpp +${CEE_CURRENT_LIST_DIR}RigTOFaccumulatedPhaseFractionsPlot.cpp ) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp new file mode 100644 index 0000000000..1b9c9490b7 --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -0,0 +1,114 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RigTofAccumulatedPhaseFractionsCalculator.h" + +#include "RigEclipseCaseData.h" +#include "RimEclipseCase.h" +#include "RimReservoirCellResultsStorage.h" +#include "RigResultAccessor.h" +#include "RigResultAccessorFactory.h" +#include "RigSingleWellResultsData.h" +#include "RigFlowDiagResultAddress.h" +#include "RimFlowDiagSolution.h" +#include "RigFlowDiagResults.h" +#include "RigCaseCellResultsData.h" + +#include + + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() +{ + RigEclipseCaseData* eclipseCaseData = m_case->eclipseCaseData(); + + RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS; + + + RimReservoirCellResultsStorage* gridCellResults = m_case->results(porosityModel); + + size_t scalarResultIndexSwat = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); + size_t scalarResultIndexSoil = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL"); + size_t scalarResultIndexSgas = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); + size_t scalarResultIndexPorv = gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORV"); + + std::vector& swatResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, m_timeStep); + std::vector& soilResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, m_timeStep); + std::vector& sgasResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, m_timeStep); + std::vector& porvResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, m_timeStep); + + const RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo(porosityModel); + + std::string resultNameTof = "TOF"; + const std::vector* tofData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, m_wellName.toStdString()), + m_timeStep); + + std::string resultNameFraction = "Fraction"; + const std::vector* fractionData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, m_wellName.toStdString()), + m_timeStep); + + + sortTofAndCalculateAccPhaseFraction(tofData, fractionData, porvResults, swatResults, soilResults, sgasResults); + + + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, std::vector& porvResults, std::vector& swatResults, std::vector& soilResults, std::vector& sgasResults) +{ + std::map tofAndIndexMap; + + for (int i = 0; i < tofData->size(); i++) + { + tofAndIndexMap[tofData->at(i)] = i; + } + + + double fractionPorvSum = 0.0; + double fractionPorvPhaseSumSwat = 0.0; + double fractionPorvPhaseSumSoil = 0.0; + double fractionPorvPhaseSumSgas = 0.0; + + std::vector accumulatedPhaseFractionSwat; + std::vector accumulatedPhaseFractionSoil; + std::vector accumulatedPhaseFractionSgas; + std::vector tofInIncreasingOrder; + + + for (auto element : tofAndIndexMap) //todo - check handling of several cells have same tof value + { + int index = element.second; + double tofValue = element.first; + tofInIncreasingOrder.push_back(tofValue); + + fractionPorvSum += fractionData->at(index) * porvResults[index]; + fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults[index] * swatResults[index]; + fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults[index] * soilResults[index]; + fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults[index] * sgasResults[index]; + + accumulatedPhaseFractionSwat.push_back(fractionPorvPhaseSumSwat / fractionPorvSum); + accumulatedPhaseFractionSoil.push_back(fractionPorvPhaseSumSoil / fractionPorvSum); + accumulatedPhaseFractionSgas.push_back(fractionPorvPhaseSumSgas / fractionPorvSum); + } +} diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h new file mode 100644 index 0000000000..1cfb3b7a4e --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmField.h" +#include "cafPdmObject.h" +#include "cafPdmPtrField.h" + +#include "cvfBase.h" +#include "cvfVector3.h" + +#include +#include "RimFlowDiagSolution.h" + +class RimEclipseCase; + +//================================================================================================== +/// +//================================================================================================== + +class RigTofAccumulatedPhaseFractionsCalculator +{ + +public: + void computeTOFaccumulations(); + + void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, std::vector& porvResults, std::vector& swatResults, std::vector& soilResults, std::vector& sgasResults); + +private: + RimEclipseCase* m_case; + QString m_wellName; + + caf::PdmField m_timeStep; + caf::PdmPtrField m_flowDiagSolution; + +}; + diff --git a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp new file mode 100644 index 0000000000..d17bf6624e --- /dev/null +++ b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp @@ -0,0 +1,29 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 - Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "gtest/gtest.h" + +#include "RigTofAccumulatedPhaseFractionsCalculator.h" + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFraction) +{ +//TODO +} \ No newline at end of file From 40addb9a10ed4f349ae133e0edcb2558a903d0c5 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Wed, 9 Aug 2017 15:41:55 +0200 Subject: [PATCH 07/36] #1126 Adding (dummy) unit test. Calling the sortTofAndCalculateAccPhaseFraction function, but no check of values calculated yet --- ...TofAccumulatedPhaseFractionsCalculator.cpp | 33 +++++++++------ ...igTofAccumulatedPhaseFractionsCalculator.h | 7 +++- ...cumulatedPhaseFractionsCalculator-Test.cpp | 41 ++++++++++++++++++- 3 files changed, 65 insertions(+), 16 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 1b9c9490b7..0c7b72cd02 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -50,20 +50,22 @@ void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() size_t scalarResultIndexSgas = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); size_t scalarResultIndexPorv = gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORV"); - std::vector& swatResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, m_timeStep); - std::vector& soilResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, m_timeStep); - std::vector& sgasResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, m_timeStep); - std::vector& porvResults = eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, m_timeStep); + const std::vector* swatResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, m_timeStep)); + const std::vector* soilResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, m_timeStep)); + const std::vector* sgasResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, m_timeStep)); + const std::vector* porvResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, m_timeStep)); const RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo(porosityModel); std::string resultNameTof = "TOF"; - const std::vector* tofData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, m_wellName.toStdString()), - m_timeStep); + const std::vector* tofData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, + m_wellName.toStdString()), + m_timeStep); std::string resultNameFraction = "Fraction"; - const std::vector* fractionData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, m_wellName.toStdString()), - m_timeStep); + const std::vector* fractionData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, + m_wellName.toStdString()), + m_timeStep); sortTofAndCalculateAccPhaseFraction(tofData, fractionData, porvResults, swatResults, soilResults, sgasResults); @@ -75,7 +77,12 @@ void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, std::vector& porvResults, std::vector& swatResults, std::vector& soilResults, std::vector& sgasResults) +void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, + const std::vector* fractionData, + const std::vector* porvResults, + const std::vector* swatResults, + const std::vector* soilResults, + const std::vector* sgasResults) { std::map tofAndIndexMap; @@ -102,10 +109,10 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract double tofValue = element.first; tofInIncreasingOrder.push_back(tofValue); - fractionPorvSum += fractionData->at(index) * porvResults[index]; - fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults[index] * swatResults[index]; - fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults[index] * soilResults[index]; - fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults[index] * sgasResults[index]; + fractionPorvSum += fractionData->at(index) * porvResults->at(index); + fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults->at(index) * swatResults->at(index); + fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults->at(index) * soilResults->at(index); + fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults->at(index) * sgasResults->at(index); accumulatedPhaseFractionSwat.push_back(fractionPorvPhaseSumSwat / fractionPorvSum); accumulatedPhaseFractionSoil.push_back(fractionPorvPhaseSumSoil / fractionPorvSum); diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index 1cfb3b7a4e..e92ead9b29 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -40,7 +40,12 @@ class RigTofAccumulatedPhaseFractionsCalculator public: void computeTOFaccumulations(); - void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, std::vector& porvResults, std::vector& swatResults, std::vector& soilResults, std::vector& sgasResults); + static void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, + const std::vector* fractionData, + const std::vector* porvResults, + const std::vector* swatResults, + const std::vector* soilResults, + const std::vector* sgasResults); private: RimEclipseCase* m_case; diff --git a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp index d17bf6624e..0e3096ddce 100644 --- a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp +++ b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp @@ -23,7 +23,44 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFraction) +TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFractionTest) { -//TODO + std::vector tofDataVector; + tofDataVector.push_back(0.001); + tofDataVector.push_back(0.1); + tofDataVector.push_back(0.01); + + std::vector fractionDataVector; + fractionDataVector.push_back(0.002); + fractionDataVector.push_back(0.2); + fractionDataVector.push_back(0.02); + + std::vector porvResultVector; + porvResultVector.push_back(0.002); + porvResultVector.push_back(0.2); + porvResultVector.push_back(0.02); + + std::vector swatResultVector; + swatResultVector.push_back(0.1); + swatResultVector.push_back(0.3); + swatResultVector.push_back(0.6); + + std::vector soilResultVector; + soilResultVector.push_back(0.3); + soilResultVector.push_back(0.6); + soilResultVector.push_back(0.1); + + std::vector sgasResultVector; + sgasResultVector.push_back(0.6); + sgasResultVector.push_back(0.1); + sgasResultVector.push_back(0.3); + + RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(&(tofDataVector), + &(fractionDataVector), + &(porvResultVector), + &(swatResultVector), + &(soilResultVector), + &(sgasResultVector)); + + EXPECT_EQ(1, 1); } \ No newline at end of file From 42245b22af6a06e2215cd9ee346e06b1d1a75fa0 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 10 Aug 2017 11:02:54 +0200 Subject: [PATCH 08/36] #1126 Adding unit test --- ...TofAccumulatedPhaseFractionsCalculator.cpp | 54 +++++-------------- ...igTofAccumulatedPhaseFractionsCalculator.h | 6 ++- ...cumulatedPhaseFractionsCalculator-Test.cpp | 30 ++++++++--- 3 files changed, 40 insertions(+), 50 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 0c7b72cd02..a5fa6ea58d 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -68,54 +68,24 @@ void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() m_timeStep); - sortTofAndCalculateAccPhaseFraction(tofData, fractionData, porvResults, swatResults, soilResults, sgasResults); - - - -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, - const std::vector* fractionData, - const std::vector* porvResults, - const std::vector* swatResults, - const std::vector* soilResults, - const std::vector* sgasResults) -{ - std::map tofAndIndexMap; - - for (int i = 0; i < tofData->size(); i++) - { - tofAndIndexMap[tofData->at(i)] = i; - } - - - double fractionPorvSum = 0.0; - double fractionPorvPhaseSumSwat = 0.0; - double fractionPorvPhaseSumSoil = 0.0; - double fractionPorvPhaseSumSgas = 0.0; - std::vector accumulatedPhaseFractionSwat; std::vector accumulatedPhaseFractionSoil; std::vector accumulatedPhaseFractionSgas; std::vector tofInIncreasingOrder; - for (auto element : tofAndIndexMap) //todo - check handling of several cells have same tof value - { - int index = element.second; - double tofValue = element.first; - tofInIncreasingOrder.push_back(tofValue); + sortTofAndCalculateAccPhaseFraction(tofData, + fractionData, + porvResults, + swatResults, + soilResults, + sgasResults, + accumulatedPhaseFractionSwat, + accumulatedPhaseFractionSoil, + accumulatedPhaseFractionSgas, + tofInIncreasingOrder); + - fractionPorvSum += fractionData->at(index) * porvResults->at(index); - fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults->at(index) * swatResults->at(index); - fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults->at(index) * soilResults->at(index); - fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults->at(index) * sgasResults->at(index); - accumulatedPhaseFractionSwat.push_back(fractionPorvPhaseSumSwat / fractionPorvSum); - accumulatedPhaseFractionSoil.push_back(fractionPorvPhaseSumSoil / fractionPorvSum); - accumulatedPhaseFractionSgas.push_back(fractionPorvPhaseSumSgas / fractionPorvSum); - } } + diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index e92ead9b29..e98fe0ac26 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -45,7 +45,11 @@ public: const std::vector* porvResults, const std::vector* swatResults, const std::vector* soilResults, - const std::vector* sgasResults); + const std::vector* sgasResults, + std::vector& tofInIncreasingOrder, + std::vector& accumulatedPhaseFractionSwat, + std::vector& accumulatedPhaseFractionSoil, + std::vector& accumulatedPhaseFractionSgas); private: RimEclipseCase* m_case; diff --git a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp index 0e3096ddce..f0a6124ce5 100644 --- a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp +++ b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp @@ -19,7 +19,6 @@ #include "RigTofAccumulatedPhaseFractionsCalculator.h" - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -36,9 +35,9 @@ TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFract fractionDataVector.push_back(0.02); std::vector porvResultVector; - porvResultVector.push_back(0.002); - porvResultVector.push_back(0.2); - porvResultVector.push_back(0.02); + porvResultVector.push_back(1); + porvResultVector.push_back(1); + porvResultVector.push_back(1.5); std::vector swatResultVector; swatResultVector.push_back(0.1); @@ -55,12 +54,29 @@ TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFract sgasResultVector.push_back(0.1); sgasResultVector.push_back(0.3); + + std::vector accumulatedPhaseFractionSwat; + std::vector accumulatedPhaseFractionSoil; + std::vector accumulatedPhaseFractionSgas; + std::vector tofInIncreasingOrder; + RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(&(tofDataVector), &(fractionDataVector), &(porvResultVector), &(swatResultVector), &(soilResultVector), - &(sgasResultVector)); + &(sgasResultVector), + tofInIncreasingOrder, + accumulatedPhaseFractionSwat, + accumulatedPhaseFractionSoil, + accumulatedPhaseFractionSgas + ); - EXPECT_EQ(1, 1); -} \ No newline at end of file + EXPECT_LT(tofInIncreasingOrder[0], tofInIncreasingOrder[1]); + EXPECT_LT(tofInIncreasingOrder[1], tofInIncreasingOrder[2]); + + EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSwat[0], 0.1000); + EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSoil[1], 0.1125); + EXPECT_LT(accumulatedPhaseFractionSgas[2] - 0.13017, 0.00001); +} + From 4f2d3c7f5b1724e9fd9e6776be1c9fec54e30dc7 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 10 Aug 2017 11:41:36 +0200 Subject: [PATCH 09/36] #1126 Fixing missing/wrong filenames in cmake-files, and error in last check-in --- .../ReservoirDataModel/CMakeLists_files.cmake | 4 +- ...TofAccumulatedPhaseFractionsCalculator.cpp | 45 +++++++++++++++++++ .../UnitTests/CMakeLists_files.cmake | 1 + 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index d5afeb7338..332a8c46bd 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -58,7 +58,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.h ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.h ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.h -${CEE_CURRENT_LIST_DIR}RigTOFaccumulatedPhaseFractionsPlot.h +${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.h ) @@ -112,7 +112,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.cpp ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.cpp ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.cpp -${CEE_CURRENT_LIST_DIR}RigTOFaccumulatedPhaseFractionsPlot.cpp +${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.cpp ) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index a5fa6ea58d..d66c3ca064 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -89,3 +89,48 @@ void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, + const std::vector* fractionData, + const std::vector* porvResults, + const std::vector* swatResults, + const std::vector* soilResults, + const std::vector* sgasResults, + std::vector& tofInIncreasingOrder, + std::vector& accumulatedPhaseFractionSwat, + std::vector& accumulatedPhaseFractionSoil, + std::vector& accumulatedPhaseFractionSgas) + +{ + std::map tofAndIndexMap; + + for (int i = 0; i < tofData->size(); i++) + { + tofAndIndexMap[tofData->at(i)] = i; + } + + + double fractionPorvSum = 0.0; + double fractionPorvPhaseSumSwat = 0.0; + double fractionPorvPhaseSumSoil = 0.0; + double fractionPorvPhaseSumSgas = 0.0; + + for (auto element : tofAndIndexMap) //todo - check handling of several cells have same tof value + { + int index = element.second; + double tofValue = element.first; + tofInIncreasingOrder.push_back(tofValue); + + fractionPorvSum += fractionData->at(index) * porvResults->at(index); + fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults->at(index) * swatResults->at(index); + fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults->at(index) * soilResults->at(index); + fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults->at(index) * sgasResults->at(index); + + accumulatedPhaseFractionSwat.push_back(fractionPorvPhaseSumSwat / fractionPorvSum); + accumulatedPhaseFractionSoil.push_back(fractionPorvPhaseSumSoil / fractionPorvSum); + accumulatedPhaseFractionSgas.push_back(fractionPorvPhaseSumSgas / fractionPorvSum); + } +} \ No newline at end of file diff --git a/ApplicationCode/UnitTests/CMakeLists_files.cmake b/ApplicationCode/UnitTests/CMakeLists_files.cmake index 62c9c6eb0f..ae20b6a990 100644 --- a/ApplicationCode/UnitTests/CMakeLists_files.cmake +++ b/ApplicationCode/UnitTests/CMakeLists_files.cmake @@ -24,6 +24,7 @@ ${CEE_CURRENT_LIST_DIR}RivTernaryScalarMapper-Test.cpp ${CEE_CURRENT_LIST_DIR}ScalarMapper-Test.cpp ${CEE_CURRENT_LIST_DIR}WellPathAsciiFileReader-Test.cpp ${CEE_CURRENT_LIST_DIR}opm-flowdiagnostics-Test.cpp +${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator-Test.cpp ) list(APPEND CODE_HEADER_FILES From 35cc413f4df72b63d65f09d414ab07284528531b Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 10 Aug 2017 13:07:17 +0200 Subject: [PATCH 10/36] #1126 Adding handling of multiple cells with same tof. No test yet. --- ...TofAccumulatedPhaseFractionsCalculator.cpp | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index d66c3ca064..7e8de5b237 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -105,11 +105,25 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract std::vector& accumulatedPhaseFractionSgas) { - std::map tofAndIndexMap; + std::map > tofAndIndexMap; for (int i = 0; i < tofData->size(); i++) { - tofAndIndexMap[tofData->at(i)] = i; + auto it = tofAndIndexMap.find(tofData->at(i)); + if (it == tofAndIndexMap.end()) + { + //Key does not exist + std::vector vectorOfIndexes; + vectorOfIndexes.push_back(i); + tofAndIndexMap[tofData->at(i)] = vectorOfIndexes; + } + else + { + //Key does exisit + std::vector vectorOfIndexes = it->second; + vectorOfIndexes.push_back(i); + tofAndIndexMap[tofData->at(i)] = vectorOfIndexes; + } } @@ -118,17 +132,18 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract double fractionPorvPhaseSumSoil = 0.0; double fractionPorvPhaseSumSgas = 0.0; - for (auto element : tofAndIndexMap) //todo - check handling of several cells have same tof value + for (auto element : tofAndIndexMap) { - int index = element.second; double tofValue = element.first; + for (int index : element.second) + { + fractionPorvSum += fractionData->at(index) * porvResults->at(index); + fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults->at(index) * swatResults->at(index); + fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults->at(index) * soilResults->at(index); + fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults->at(index) * sgasResults->at(index); + } + tofInIncreasingOrder.push_back(tofValue); - - fractionPorvSum += fractionData->at(index) * porvResults->at(index); - fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults->at(index) * swatResults->at(index); - fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults->at(index) * soilResults->at(index); - fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults->at(index) * sgasResults->at(index); - accumulatedPhaseFractionSwat.push_back(fractionPorvPhaseSumSwat / fractionPorvSum); accumulatedPhaseFractionSoil.push_back(fractionPorvPhaseSumSoil / fractionPorvSum); accumulatedPhaseFractionSgas.push_back(fractionPorvPhaseSumSgas / fractionPorvSum); From e19a63dcff843793a7b390daa1078f07e1f5d59c Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 10 Aug 2017 13:34:03 +0200 Subject: [PATCH 11/36] #1126 Adding test with same TOF-value for two cells --- ...cumulatedPhaseFractionsCalculator-Test.cpp | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp index f0a6124ce5..c7cb08a117 100644 --- a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp +++ b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp @@ -74,9 +74,86 @@ TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFract EXPECT_LT(tofInIncreasingOrder[0], tofInIncreasingOrder[1]); EXPECT_LT(tofInIncreasingOrder[1], tofInIncreasingOrder[2]); + + double sumForOneTOF = accumulatedPhaseFractionSwat[2] + + accumulatedPhaseFractionSoil[2] + + accumulatedPhaseFractionSgas[2]; + EXPECT_DOUBLE_EQ(sumForOneTOF, 1.00); EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSwat[0], 0.1000); EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSoil[1], 0.1125); EXPECT_LT(accumulatedPhaseFractionSgas[2] - 0.13017, 0.00001); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFractionTest2) +{ + std::vector tofDataVector2; + tofDataVector2.push_back(0.001); + tofDataVector2.push_back(0.1); + tofDataVector2.push_back(0.01); + tofDataVector2.push_back(0.1); + + std::vector fractionDataVector2; + fractionDataVector2.push_back(0.002); + fractionDataVector2.push_back(0.2); + fractionDataVector2.push_back(0.02); + fractionDataVector2.push_back(0.02); + + std::vector porvResultVector2; + porvResultVector2.push_back(1); + porvResultVector2.push_back(1); + porvResultVector2.push_back(1.5); + porvResultVector2.push_back(1.5); + + std::vector swatResultVector2; + swatResultVector2.push_back(0.1); + swatResultVector2.push_back(0.3); + swatResultVector2.push_back(0.6); + swatResultVector2.push_back(0.6); + + std::vector soilResultVector2; + soilResultVector2.push_back(0.3); + soilResultVector2.push_back(0.6); + soilResultVector2.push_back(0.1); + soilResultVector2.push_back(0.1); + + std::vector sgasResultVector2; + sgasResultVector2.push_back(0.6); + sgasResultVector2.push_back(0.1); + sgasResultVector2.push_back(0.3); + sgasResultVector2.push_back(0.3); + + std::vector accumulatedPhaseFractionSwat2; + std::vector accumulatedPhaseFractionSoil2; + std::vector accumulatedPhaseFractionSgas2; + std::vector tofInIncreasingOrder2; + + RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(&(tofDataVector2), + &(fractionDataVector2), + &(porvResultVector2), + &(swatResultVector2), + &(soilResultVector2), + &(sgasResultVector2), + tofInIncreasingOrder2, + accumulatedPhaseFractionSwat2, + accumulatedPhaseFractionSoil2, + accumulatedPhaseFractionSgas2); + EXPECT_EQ(tofInIncreasingOrder2.size(), 3); + + double sumForOneTOF = accumulatedPhaseFractionSwat2[2] + + accumulatedPhaseFractionSoil2[2] + + accumulatedPhaseFractionSgas2[2]; + EXPECT_DOUBLE_EQ(sumForOneTOF, 1.00); + + EXPECT_LT(tofInIncreasingOrder2[0], tofInIncreasingOrder2[1]); + EXPECT_LT(tofInIncreasingOrder2[1], tofInIncreasingOrder2[2]); + + EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSwat2[0], 0.1000); + EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSoil2[1], 0.1125); + EXPECT_LT(accumulatedPhaseFractionSgas2[2] - 0.149618, 0.00001); + +} + From 2ce81e904597a84561461b16ebf546308027d4fc Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 10 Aug 2017 15:17:46 +0200 Subject: [PATCH 12/36] #1126 Updating inserting to map to use insert. Adding access functions for calculated data and constructor for class (not finished) --- ...TofAccumulatedPhaseFractionsCalculator.cpp | 34 +++++++++++-------- ...igTofAccumulatedPhaseFractionsCalculator.h | 22 ++++++++++-- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 7e8de5b237..0ec72f807d 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -33,6 +33,19 @@ +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalculator(RimEclipseCase* caseToApply, + QString wellname, + size_t timestep) + :m_case(caseToApply), + m_wellName(wellname), + m_timeStep(timestep) +{ + computeTOFaccumulations(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -109,24 +122,17 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract for (int i = 0; i < tofData->size(); i++) { - auto it = tofAndIndexMap.find(tofData->at(i)); - if (it == tofAndIndexMap.end()) + std::vector vectorOfIndexes; + vectorOfIndexes.push_back(i); + + auto iteratorBoolFromInsertToMap = tofAndIndexMap.insert(std::make_pair(tofData->at(i), vectorOfIndexes)); + if (!iteratorBoolFromInsertToMap.second) { - //Key does not exist - std::vector vectorOfIndexes; - vectorOfIndexes.push_back(i); - tofAndIndexMap[tofData->at(i)] = vectorOfIndexes; - } - else - { - //Key does exisit - std::vector vectorOfIndexes = it->second; - vectorOfIndexes.push_back(i); - tofAndIndexMap[tofData->at(i)] = vectorOfIndexes; + //Element exist alread, was not inserted + iteratorBoolFromInsertToMap.first->second.push_back(i); } } - double fractionPorvSum = 0.0; double fractionPorvPhaseSumSwat = 0.0; double fractionPorvPhaseSumSoil = 0.0; diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index e98fe0ac26..f47087bda6 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -38,8 +38,15 @@ class RigTofAccumulatedPhaseFractionsCalculator { public: - void computeTOFaccumulations(); + explicit RigTofAccumulatedPhaseFractionsCalculator(RimEclipseCase* caseToApply, + QString wellname, + size_t timestep); + const std::vector& sortedUniqueTOFValues() const { return m_tofInIncreasingOrder; } + const std::vector& accumulatedPhaseFractionsSwat() const { return m_accumulatedPhaseFractionSwat; } + const std::vector& accumulatedPhaseFractionsSoil() const { return m_accumulatedPhaseFractionSoil; } + const std::vector& accumulatedPhaseFractionsSgas() const { return m_accumulatedPhaseFractionSgas; } + static void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, const std::vector* porvResults, @@ -51,12 +58,21 @@ public: std::vector& accumulatedPhaseFractionSoil, std::vector& accumulatedPhaseFractionSgas); +private: + void computeTOFaccumulations(); + + private: RimEclipseCase* m_case; QString m_wellName; + size_t m_timeStep; - caf::PdmField m_timeStep; - caf::PdmPtrField m_flowDiagSolution; + RimFlowDiagSolution* m_flowDiagSolution ; //hente fra case, rimEclipseResultCase? + + std::vector m_tofInIncreasingOrder; + std::vector m_accumulatedPhaseFractionSwat; + std::vector m_accumulatedPhaseFractionSgas; + std::vector m_accumulatedPhaseFractionSoil; }; From db6d471e9c38c6a8727d0ac4ea683842e25be8e5 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 10 Aug 2017 15:25:51 +0200 Subject: [PATCH 13/36] #1126 Fixing constructor --- ...TofAccumulatedPhaseFractionsCalculator.cpp | 30 ++++++++----------- ...igTofAccumulatedPhaseFractionsCalculator.h | 6 ++-- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 0ec72f807d..6e3e181543 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -18,16 +18,17 @@ #include "RigTofAccumulatedPhaseFractionsCalculator.h" +#include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" -#include "RimEclipseCase.h" -#include "RimReservoirCellResultsStorage.h" +#include "RigFlowDiagResultAddress.h" +#include "RigFlowDiagResults.h" #include "RigResultAccessor.h" #include "RigResultAccessorFactory.h" #include "RigSingleWellResultsData.h" -#include "RigFlowDiagResultAddress.h" + +#include "RimEclipseResultCase.h" #include "RimFlowDiagSolution.h" -#include "RigFlowDiagResults.h" -#include "RigCaseCellResultsData.h" +#include "RimReservoirCellResultsStorage.h" #include @@ -36,13 +37,15 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalculator(RimEclipseCase* caseToApply, +RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalculator(RimEclipseResultCase* caseToApply, QString wellname, size_t timestep) :m_case(caseToApply), m_wellName(wellname), m_timeStep(timestep) { + m_flowDiagSolution = caseToApply->defaultFlowDiagSolution(); + computeTOFaccumulations(); } @@ -80,23 +83,16 @@ void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() m_wellName.toStdString()), m_timeStep); - - std::vector accumulatedPhaseFractionSwat; - std::vector accumulatedPhaseFractionSoil; - std::vector accumulatedPhaseFractionSgas; - std::vector tofInIncreasingOrder; - - sortTofAndCalculateAccPhaseFraction(tofData, fractionData, porvResults, swatResults, soilResults, sgasResults, - accumulatedPhaseFractionSwat, - accumulatedPhaseFractionSoil, - accumulatedPhaseFractionSgas, - tofInIncreasingOrder); + m_accumulatedPhaseFractionSwat, + m_accumulatedPhaseFractionSoil, + m_accumulatedPhaseFractionSgas, + m_tofInIncreasingOrder); diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index f47087bda6..3c77fe0243 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -28,7 +28,7 @@ #include #include "RimFlowDiagSolution.h" -class RimEclipseCase; +class RimEclipseResultCase; //================================================================================================== /// @@ -38,7 +38,7 @@ class RigTofAccumulatedPhaseFractionsCalculator { public: - explicit RigTofAccumulatedPhaseFractionsCalculator(RimEclipseCase* caseToApply, + explicit RigTofAccumulatedPhaseFractionsCalculator(RimEclipseResultCase* caseToApply, QString wellname, size_t timestep); @@ -63,7 +63,7 @@ private: private: - RimEclipseCase* m_case; + RimEclipseResultCase* m_case; QString m_wellName; size_t m_timeStep; From ebab0b50a317846936eb5752240fa00f24808556 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Fri, 11 Aug 2017 09:27:27 +0200 Subject: [PATCH 14/36] #1126 moving finding data and calling sortTofAndCalculateAccPhaseFraction to constructor --- ...TofAccumulatedPhaseFractionsCalculator.cpp | 65 +++++++------------ ...igTofAccumulatedPhaseFractionsCalculator.h | 13 +--- 2 files changed, 26 insertions(+), 52 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 6e3e181543..b9ea8a427e 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -40,65 +40,46 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalculator(RimEclipseResultCase* caseToApply, QString wellname, size_t timestep) - :m_case(caseToApply), - m_wellName(wellname), - m_timeStep(timestep) { - m_flowDiagSolution = caseToApply->defaultFlowDiagSolution(); - - computeTOFaccumulations(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() -{ - RigEclipseCaseData* eclipseCaseData = m_case->eclipseCaseData(); + RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData(); RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS; - - - RimReservoirCellResultsStorage* gridCellResults = m_case->results(porosityModel); + RimReservoirCellResultsStorage* gridCellResults = caseToApply->results(porosityModel); size_t scalarResultIndexSwat = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); size_t scalarResultIndexSoil = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL"); size_t scalarResultIndexSgas = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); size_t scalarResultIndexPorv = gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORV"); + const std::vector* swatResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, timestep)); + const std::vector* soilResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, timestep)); + const std::vector* sgasResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, timestep)); + const std::vector* porvResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, timestep)); - const std::vector* swatResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, m_timeStep)); - const std::vector* soilResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, m_timeStep)); - const std::vector* sgasResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, m_timeStep)); - const std::vector* porvResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, m_timeStep)); - const RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo(porosityModel); + RimFlowDiagSolution* flowDiagSolution = caseToApply->defaultFlowDiagSolution(); std::string resultNameTof = "TOF"; - const std::vector* tofData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, - m_wellName.toStdString()), - m_timeStep); - + const std::vector* tofData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, + wellname.toStdString()), + timestep); + std::string resultNameFraction = "Fraction"; - const std::vector* fractionData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, - m_wellName.toStdString()), - m_timeStep); + const std::vector* fractionData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, + wellname.toStdString()), + timestep); - sortTofAndCalculateAccPhaseFraction(tofData, - fractionData, - porvResults, - swatResults, - soilResults, - sgasResults, - m_accumulatedPhaseFractionSwat, - m_accumulatedPhaseFractionSoil, - m_accumulatedPhaseFractionSgas, + sortTofAndCalculateAccPhaseFraction(tofData, + fractionData, + porvResults, + swatResults, + soilResults, + sgasResults, + m_accumulatedPhaseFractionSwat, + m_accumulatedPhaseFractionSoil, + m_accumulatedPhaseFractionSgas, m_tofInIncreasingOrder); - - - } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index 3c77fe0243..4a070c0985 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -47,6 +47,8 @@ public: const std::vector& accumulatedPhaseFractionsSoil() const { return m_accumulatedPhaseFractionSoil; } const std::vector& accumulatedPhaseFractionsSgas() const { return m_accumulatedPhaseFractionSgas; } + +private: static void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, const std::vector* porvResults, @@ -59,16 +61,6 @@ public: std::vector& accumulatedPhaseFractionSgas); private: - void computeTOFaccumulations(); - - -private: - RimEclipseResultCase* m_case; - QString m_wellName; - size_t m_timeStep; - - RimFlowDiagSolution* m_flowDiagSolution ; //hente fra case, rimEclipseResultCase? - std::vector m_tofInIncreasingOrder; std::vector m_accumulatedPhaseFractionSwat; std::vector m_accumulatedPhaseFractionSgas; @@ -76,3 +68,4 @@ private: }; +//TODO: tester... \ No newline at end of file From ef1208e2f54e10ca43ce99916d08758fd3f0e051 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Fri, 11 Aug 2017 10:10:16 +0200 Subject: [PATCH 15/36] #1126 Adding RigTofAccumulatedPhaseFractionsCalculatorTester with function calling sortTofAndCalculateAccPhaseFraction, so that this function can be set private. --- ...TofAccumulatedPhaseFractionsCalculator.cpp | 6 +-- ...igTofAccumulatedPhaseFractionsCalculator.h | 28 ++++++++++++- ...cumulatedPhaseFractionsCalculator-Test.cpp | 42 +++++++++---------- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index b9ea8a427e..ed12591bef 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -41,7 +41,6 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalcul QString wellname, size_t timestep) { - RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData(); RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS; RimReservoirCellResultsStorage* gridCellResults = caseToApply->results(porosityModel); @@ -54,8 +53,7 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalcul const std::vector* soilResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, timestep)); const std::vector* sgasResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, timestep)); const std::vector* porvResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, timestep)); - - + RimFlowDiagSolution* flowDiagSolution = caseToApply->defaultFlowDiagSolution(); std::string resultNameTof = "TOF"; @@ -105,7 +103,7 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract auto iteratorBoolFromInsertToMap = tofAndIndexMap.insert(std::make_pair(tofData->at(i), vectorOfIndexes)); if (!iteratorBoolFromInsertToMap.second) { - //Element exist alread, was not inserted + //Element exist already, was not inserted iteratorBoolFromInsertToMap.first->second.push_back(i); } } diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index 4a070c0985..e2abcc6cb8 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -49,6 +49,7 @@ public: private: + friend class RigTofAccumulatedPhaseFractionsCalculatorTester; static void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, const std::vector* porvResults, @@ -68,4 +69,29 @@ private: }; -//TODO: tester... \ No newline at end of file +class RigTofAccumulatedPhaseFractionsCalculatorTester +{ +public: + static void testSortTofAndCalculateAccPhaseFraction(const std::vector* tofData, + const std::vector* fractionData, + const std::vector* porvResults, + const std::vector* swatResults, + const std::vector* soilResults, + const std::vector* sgasResults, + std::vector& tofInIncreasingOrder, + std::vector& accumulatedPhaseFractionSwat, + std::vector& accumulatedPhaseFractionSoil, + std::vector& accumulatedPhaseFractionSgas) + { + RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(tofData, + fractionData, + porvResults, + swatResults, + soilResults, + sgasResults, + tofInIncreasingOrder, + accumulatedPhaseFractionSwat, + accumulatedPhaseFractionSoil, + accumulatedPhaseFractionSgas); + } +}; diff --git a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp index c7cb08a117..d4ddbf71cb 100644 --- a/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp +++ b/ApplicationCode/UnitTests/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp @@ -60,17 +60,17 @@ TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFract std::vector accumulatedPhaseFractionSgas; std::vector tofInIncreasingOrder; - RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(&(tofDataVector), - &(fractionDataVector), - &(porvResultVector), - &(swatResultVector), - &(soilResultVector), - &(sgasResultVector), - tofInIncreasingOrder, - accumulatedPhaseFractionSwat, - accumulatedPhaseFractionSoil, - accumulatedPhaseFractionSgas - ); + RigTofAccumulatedPhaseFractionsCalculatorTester::testSortTofAndCalculateAccPhaseFraction(&(tofDataVector), + &(fractionDataVector), + &(porvResultVector), + &(swatResultVector), + &(soilResultVector), + &(sgasResultVector), + tofInIncreasingOrder, + accumulatedPhaseFractionSwat, + accumulatedPhaseFractionSoil, + accumulatedPhaseFractionSgas + ); EXPECT_LT(tofInIncreasingOrder[0], tofInIncreasingOrder[1]); EXPECT_LT(tofInIncreasingOrder[1], tofInIncreasingOrder[2]); @@ -131,16 +131,16 @@ TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFract std::vector accumulatedPhaseFractionSgas2; std::vector tofInIncreasingOrder2; - RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(&(tofDataVector2), - &(fractionDataVector2), - &(porvResultVector2), - &(swatResultVector2), - &(soilResultVector2), - &(sgasResultVector2), - tofInIncreasingOrder2, - accumulatedPhaseFractionSwat2, - accumulatedPhaseFractionSoil2, - accumulatedPhaseFractionSgas2); + RigTofAccumulatedPhaseFractionsCalculatorTester::testSortTofAndCalculateAccPhaseFraction(&(tofDataVector2), + &(fractionDataVector2), + &(porvResultVector2), + &(swatResultVector2), + &(soilResultVector2), + &(sgasResultVector2), + tofInIncreasingOrder2, + accumulatedPhaseFractionSwat2, + accumulatedPhaseFractionSoil2, + accumulatedPhaseFractionSgas2); EXPECT_EQ(tofInIncreasingOrder2.size(), 3); double sumForOneTOF = accumulatedPhaseFractionSwat2[2] From abd058da8b8167a52b0b0e4b7b6ae01adaf8ba4f Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Fri, 11 Aug 2017 11:26:35 +0200 Subject: [PATCH 16/36] #1126 Update after merge - using ALL for PhaseSelection --- .../RigTofAccumulatedPhaseFractionsCalculator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index ed12591bef..030c0f856f 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -58,11 +58,13 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalcul std::string resultNameTof = "TOF"; const std::vector* tofData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, + RigFlowDiagResultAddress::PhaseSelection::PHASE_ALL, wellname.toStdString()), timestep); std::string resultNameFraction = "Fraction"; const std::vector* fractionData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, + RigFlowDiagResultAddress::PhaseSelection::PHASE_ALL, wellname.toStdString()), timestep); From b1e9e847845d42e68cb214f02f70e9d02591dbdf Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 10 Aug 2017 11:14:32 +0200 Subject: [PATCH 17/36] #1691 Removed unused function and cleaned up includes and whitespace --- .../FileInterface/RifReaderEclipseOutput.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index 55f0ec81ca..cf621be718 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -24,9 +24,6 @@ #include "cvfCollection.h" -#include -#include - class RifEclipseOutputFileTools; class RifEclipseRestartDataAccess; class RigGridBase; @@ -73,9 +70,7 @@ private: void importFaults(const QStringList& fileSet, cvf::Collection* faults); - void openInitFile(); - bool openDynamicAccess(); void extractResultValuesBasedOnPorosityModel(PorosityModelResultType matrixOrFracture, std::vector* values, const std::vector& fileValues); void transferNNCData( const ecl_grid_type * mainEclGrid , const ecl_file_type * init_file, @@ -86,15 +81,16 @@ private: QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, PorosityModelResultType matrixOrFracture, size_t timeStepCount) const; virtual std::vector timeSteps(); -private: - QString m_fileName; // Name of file used to start accessing Eclipse output files - QStringList m_filesWithSameBaseName; // Set of files in filename's path with same base name as filename - RigEclipseCaseData* m_eclipseCase; +private: + QString m_fileName; // Name of file used to start accessing Eclipse output files + QStringList m_filesWithSameBaseName; // Set of files in filename's path with same base name as filename + + RigEclipseCaseData* m_eclipseCase; std::vector m_timeSteps; std::vector m_daysSinceSimulationStart; - ecl_file_type* m_ecl_init_file; // File access to static results - cvf::ref m_dynamicResultsAccess; // File access to dynamic results + ecl_file_type* m_ecl_init_file; // File access to static results + cvf::ref m_dynamicResultsAccess; // File access to dynamic results }; From 9223282db4e1b133c5498c64af86d2da21afd408 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 10 Aug 2017 11:41:29 +0200 Subject: [PATCH 18/36] #1691 Remove caching of time step related data --- .../FileInterface/RifReaderEclipseOutput.cpp | 29 +++++++------------ .../FileInterface/RifReaderEclipseOutput.h | 5 ---- .../FileInterface/RifReaderInterface.h | 3 -- 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index d9bd2fe15a..6c9c4c29f3 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -194,8 +194,6 @@ RifReaderEclipseOutput::RifReaderEclipseOutput() m_fileName.clear(); m_filesWithSameBaseName.clear(); - m_timeSteps.clear(); - m_eclipseCase = NULL; m_ecl_init_file = NULL; @@ -648,6 +646,9 @@ void RifReaderEclipseOutput::buildMetaData() RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RifReaderInterface::MATRIX_RESULTS); RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS); + std::vector timeSteps; + std::vector daysSinceSimulationStart; + // Create access object for dynamic results m_dynamicResultsAccess = createDynamicResultsAccess(); if (m_dynamicResultsAccess.notNull()) @@ -657,7 +658,7 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.incrementProgress(); // Get time steps - m_dynamicResultsAccess->timeSteps(&m_timeSteps, &m_daysSinceSimulationStart); + m_dynamicResultsAccess->timeSteps(&timeSteps, &daysSinceSimulationStart); std::vector reportNumbers = m_dynamicResultsAccess->reportNumbers(); QStringList resultNames; @@ -673,7 +674,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < matrixResultNames.size(); ++i) { size_t resIndex = matrixModelResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, matrixResultNames[i], false); - matrixModelResults->setTimeStepDates(resIndex, m_timeSteps, m_daysSinceSimulationStart, reportNumbers); + matrixModelResults->setTimeStepDates(resIndex, timeSteps, daysSinceSimulationStart, reportNumbers); } } @@ -686,7 +687,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < fractureResultNames.size(); ++i) { size_t resIndex = fractureModelResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, fractureResultNames[i], false); - fractureModelResults->setTimeStepDates(resIndex, m_timeSteps, m_daysSinceSimulationStart, reportNumbers); + fractureModelResults->setTimeStepDates(resIndex, timeSteps, daysSinceSimulationStart, reportNumbers); } } @@ -726,13 +727,13 @@ void RifReaderEclipseOutput::buildMetaData() std::vector staticDay; std::vector staticReportNumber; { - if ( m_timeSteps.size() > 0 ) + if ( timeSteps.size() > 0 ) { - staticDate.push_back(m_timeSteps.front()); + staticDate.push_back(timeSteps.front()); } - if (m_daysSinceSimulationStart.size() > 0) + if (daysSinceSimulationStart.size() > 0) { - staticDay.push_back(m_daysSinceSimulationStart.front()); + staticDay.push_back(daysSinceSimulationStart.front()); } std::vector reportNumbers; @@ -1655,7 +1656,7 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid, boo } - wellResults->computeMappingFromResultTimeIndicesToWellTimeIndices(m_timeSteps); + wellResults->computeMappingFromResultTimeIndicesToWellTimeIndices(timeSteps); wells.push_back(wellResults.p()); @@ -1833,14 +1834,6 @@ void RifReaderEclipseOutput::openInitFile() } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RifReaderEclipseOutput::timeSteps() -{ - return m_timeSteps; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index cf621be718..846bc0e2c9 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -80,17 +80,12 @@ private: QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, PorosityModelResultType matrixOrFracture, size_t timeStepCount) const; - virtual std::vector timeSteps(); - private: QString m_fileName; // Name of file used to start accessing Eclipse output files QStringList m_filesWithSameBaseName; // Set of files in filename's path with same base name as filename RigEclipseCaseData* m_eclipseCase; - std::vector m_timeSteps; - std::vector m_daysSinceSimulationStart; - ecl_file_type* m_ecl_init_file; // File access to static results cvf::ref m_dynamicResultsAccess; // File access to dynamic results }; diff --git a/ApplicationCode/FileInterface/RifReaderInterface.h b/ApplicationCode/FileInterface/RifReaderInterface.h index be8fa983b5..0940630212 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.h +++ b/ApplicationCode/FileInterface/RifReaderInterface.h @@ -67,12 +67,9 @@ public: virtual bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector* values) = 0; virtual bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values) = 0; - virtual std::vector timeSteps() { std::vector timeSteps; return timeSteps; } - void setFilenamesWithFaults(const std::vector& filenames) { m_filenamesWithFaults = filenames; } std::vector filenamesWithFaults() { return m_filenamesWithFaults; } - private: std::vector m_filenamesWithFaults; caf::PdmPointer m_settings; From 66c28d8cee781be38d9ca0c3ae9878e96938fefa Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 10 Aug 2017 13:08:38 +0200 Subject: [PATCH 19/36] #1691 File Interface : Add support for time step filtering --- .../FileInterface/RifReaderEclipseOutput.cpp | 26 +++++++++-- .../FileInterface/RifReaderInterface.cpp | 43 +++++++++++++++++++ .../FileInterface/RifReaderInterface.h | 8 ++++ .../FileInterface/RifReaderMockModel.cpp | 2 - 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 6c9c4c29f3..c60ccf7807 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -657,9 +657,27 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.incrementProgress(); + std::vector reportNumbers; + // Get time steps - m_dynamicResultsAccess->timeSteps(&timeSteps, &daysSinceSimulationStart); - std::vector reportNumbers = m_dynamicResultsAccess->reportNumbers(); + { + std::vector timeStepsOnFile; + std::vector daysSinceSimulationStartOnFile; + std::vector reportNumbersOnFile; + + m_dynamicResultsAccess->timeSteps(&timeStepsOnFile, &daysSinceSimulationStartOnFile); + reportNumbersOnFile = m_dynamicResultsAccess->reportNumbers(); + + for (size_t i = 0; i < timeStepsOnFile.size(); i++) + { + if (this->isTimeStepIncludedByFilter(i)) + { + timeSteps.push_back(timeStepsOnFile[i]); + daysSinceSimulationStart.push_back(daysSinceSimulationStartOnFile[i]); + reportNumbers.push_back(reportNumbersOnFile[i]); + } + } + } QStringList resultNames; std::vector resultNamesDataItemCounts; @@ -857,8 +875,10 @@ bool RifReaderEclipseOutput::dynamicResult(const QString& result, PorosityModelR if (m_dynamicResultsAccess.notNull()) { + size_t indexOnFile = timeStepIndexOnFile(stepIndex); + std::vector fileValues; - if (!m_dynamicResultsAccess->results(result, stepIndex, m_eclipseCase->mainGrid()->gridCount(), &fileValues)) + if (!m_dynamicResultsAccess->results(result, indexOnFile, m_eclipseCase->mainGrid()->gridCount(), &fileValues)) { return false; } diff --git a/ApplicationCode/FileInterface/RifReaderInterface.cpp b/ApplicationCode/FileInterface/RifReaderInterface.cpp index b7c68a5f0b..4a211ef9f5 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.cpp +++ b/ApplicationCode/FileInterface/RifReaderInterface.cpp @@ -68,6 +68,9 @@ bool RifReaderInterface::isNNCsEnabled() return false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix() { if (m_settings.notNull()) @@ -77,3 +80,43 @@ const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix() return QString(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifReaderInterface::setTimestepIndicesForImport(const std::vector& timeStepIndices) +{ + m_includedTimeStepIndices = timeStepIndices; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RifReaderInterface::isTimeStepIncludedByFilter(size_t timeStepIndex) const +{ + if (m_includedTimeStepIndices.empty()) return true; + + for (auto i : m_includedTimeStepIndices) + { + if (i == timeStepIndex) + { + return true; + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t RifReaderInterface::timeStepIndexOnFile(size_t timeStepIndex) const +{ + if (timeStepIndex < m_includedTimeStepIndices.size()) + { + return m_includedTimeStepIndices[timeStepIndex]; + } + + return timeStepIndex; +} + diff --git a/ApplicationCode/FileInterface/RifReaderInterface.h b/ApplicationCode/FileInterface/RifReaderInterface.h index 0940630212..5e0f2a08b6 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.h +++ b/ApplicationCode/FileInterface/RifReaderInterface.h @@ -70,7 +70,15 @@ public: void setFilenamesWithFaults(const std::vector& filenames) { m_filenamesWithFaults = filenames; } std::vector filenamesWithFaults() { return m_filenamesWithFaults; } + void setTimestepIndicesForImport(const std::vector& timeStepIndices); + +protected: + bool isTimeStepIncludedByFilter(size_t timeStepIndex) const; + size_t timeStepIndexOnFile(size_t timeStepIndex) const; + private: std::vector m_filenamesWithFaults; caf::PdmPointer m_settings; + + std::vector m_includedTimeStepIndices; }; diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index a8e4f37b7e..dee15942f5 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -20,8 +20,6 @@ #include "RifReaderMockModel.h" -#include "RifReaderInterface.h" - #include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" From 5775c3bb20ca4d2d60a3b32d6a7912ac54c5d3a4 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 10 Aug 2017 14:59:15 +0200 Subject: [PATCH 20/36] Remove duplicate definitions of file names --- ApplicationCode/ModelVisualization/CMakeLists_files.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake index 6f3dffcf80..651bc5648a 100644 --- a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake @@ -36,10 +36,8 @@ ${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.h ${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.h ${CEE_CURRENT_LIST_DIR}RivPartPriority.h -${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.h ${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.h -${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivFishbonesSubsPartMgr.h ) @@ -70,10 +68,8 @@ ${CEE_CURRENT_LIST_DIR}RivPipeQuadToSegmentMapper.cpp ${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.cpp ${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.cpp -${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.cpp -${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivFishbonesSubsPartMgr.cpp ) From 624f14da465e6f37680dae5690d2adde62b55211 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 10 Aug 2017 15:07:56 +0200 Subject: [PATCH 21/36] Prefix enum values with RIF_ FLOAT causes Cotire compile to fail --- .../RicWellPathExportCompletionDataFeature.cpp | 2 +- .../FileInterface/RifEclipseDataTableFormatter.cpp | 4 ++-- .../FileInterface/RifEclipseDataTableFormatter.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index 02df8725e8..d7bc3d8fd7 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -469,7 +469,7 @@ void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseData RifEclipseOutputTableColumn("K2"), RifEclipseOutputTableColumn("Status"), RifEclipseOutputTableColumn("SAT"), - RifEclipseOutputTableColumn("TR", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::SCIENTIFIC)), + RifEclipseOutputTableColumn("TR", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC)), RifEclipseOutputTableColumn("DIAM"), RifEclipseOutputTableColumn("KH"), RifEclipseOutputTableColumn("S"), diff --git a/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.cpp b/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.cpp index 01fb6851b8..4ed1a6a699 100644 --- a/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.cpp +++ b/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.cpp @@ -248,9 +248,9 @@ QString RifEclipseDataTableFormatter::format(double num, RifEclipseOutputTableDo { switch (doubleFormat.format) { - case RifEclipseOutputTableDoubleFormat::FLOAT: + case RifEclipseOutputTableDoubleFormat::RIF_FLOAT: return QString("%1").arg(num, 0, 'f', doubleFormat.width); - case RifEclipseOutputTableDoubleFormat::SCIENTIFIC: + case RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC: return QString("%1").arg(num, 0, 'E'); default: return QString("%1"); diff --git a/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.h b/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.h index fdb309eb1a..dab0e8fd8a 100644 --- a/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.h +++ b/ApplicationCode/FileInterface/RifEclipseDataTableFormatter.h @@ -46,8 +46,8 @@ enum RifEclipseOutputTableAlignment //================================================================================================== enum RifEclipseOutputTableDoubleFormat { - SCIENTIFIC, - FLOAT, + RIF_SCIENTIFIC, + RIF_FLOAT, }; //================================================================================================== @@ -64,7 +64,7 @@ struct RifEclipseOutputTableLine //================================================================================================== struct RifEclipseOutputTableDoubleFormatting { - RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat format = FLOAT, int width = 5) + RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat format = RIF_FLOAT, int width = 5) : format(format), width(width) {} From 78da4c6469a1420f3f808624472d95d0d1d6a114 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 07:34:54 +0200 Subject: [PATCH 22/36] #1691 Add time step filter to RimCase and use from RimEclipseResultCase --- .../FileInterface/RifReaderInterface.cpp | 12 ++--- .../FileInterface/RifReaderInterface.h | 4 +- .../ProjectDataModel/CMakeLists_files.cmake | 2 + ApplicationCode/ProjectDataModel/RimCase.cpp | 22 +++++---- ApplicationCode/ProjectDataModel/RimCase.h | 5 ++ .../ProjectDataModel/RimEclipseResultCase.cpp | 13 ++++- .../ProjectDataModel/RimTimeStepFilter.cpp | 47 +++++++++++++++++++ .../ProjectDataModel/RimTimeStepFilter.h | 40 ++++++++++++++++ 8 files changed, 125 insertions(+), 20 deletions(-) create mode 100644 ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp create mode 100644 ApplicationCode/ProjectDataModel/RimTimeStepFilter.h diff --git a/ApplicationCode/FileInterface/RifReaderInterface.cpp b/ApplicationCode/FileInterface/RifReaderInterface.cpp index 4a211ef9f5..5ac64818a7 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.cpp +++ b/ApplicationCode/FileInterface/RifReaderInterface.cpp @@ -84,9 +84,9 @@ const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RifReaderInterface::setTimestepIndicesForImport(const std::vector& timeStepIndices) +void RifReaderInterface::setTimeStepFilter(const std::vector& fileTimeStepIndices) { - m_includedTimeStepIndices = timeStepIndices; + m_fileTimeStepIndices = fileTimeStepIndices; } //-------------------------------------------------------------------------------------------------- @@ -94,9 +94,9 @@ void RifReaderInterface::setTimestepIndicesForImport(const std::vector& //-------------------------------------------------------------------------------------------------- bool RifReaderInterface::isTimeStepIncludedByFilter(size_t timeStepIndex) const { - if (m_includedTimeStepIndices.empty()) return true; + if (m_fileTimeStepIndices.empty()) return true; - for (auto i : m_includedTimeStepIndices) + for (auto i : m_fileTimeStepIndices) { if (i == timeStepIndex) { @@ -112,9 +112,9 @@ bool RifReaderInterface::isTimeStepIncludedByFilter(size_t timeStepIndex) const //-------------------------------------------------------------------------------------------------- size_t RifReaderInterface::timeStepIndexOnFile(size_t timeStepIndex) const { - if (timeStepIndex < m_includedTimeStepIndices.size()) + if (timeStepIndex < m_fileTimeStepIndices.size()) { - return m_includedTimeStepIndices[timeStepIndex]; + return m_fileTimeStepIndices[timeStepIndex]; } return timeStepIndex; diff --git a/ApplicationCode/FileInterface/RifReaderInterface.h b/ApplicationCode/FileInterface/RifReaderInterface.h index 5e0f2a08b6..4257d00292 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.h +++ b/ApplicationCode/FileInterface/RifReaderInterface.h @@ -70,7 +70,7 @@ public: void setFilenamesWithFaults(const std::vector& filenames) { m_filenamesWithFaults = filenames; } std::vector filenamesWithFaults() { return m_filenamesWithFaults; } - void setTimestepIndicesForImport(const std::vector& timeStepIndices); + void setTimeStepFilter(const std::vector& fileTimeStepIndices); protected: bool isTimeStepIncludedByFilter(size_t timeStepIndex) const; @@ -80,5 +80,5 @@ private: std::vector m_filenamesWithFaults; caf::PdmPointer m_settings; - std::vector m_includedTimeStepIndices; + std::vector m_fileTimeStepIndices; }; diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index 2b66ae7980..2dd6ddcb52 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -90,6 +90,7 @@ ${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.h ${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.h ${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.h ${CEE_CURRENT_LIST_DIR}RimDialogData.h +${CEE_CURRENT_LIST_DIR}RimTimeStepFilter.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -178,6 +179,7 @@ ${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.cpp ${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.cpp ${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.cpp ${CEE_CURRENT_LIST_DIR}RimDialogData.cpp +${CEE_CURRENT_LIST_DIR}RimTimeStepFilter.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ProjectDataModel/RimCase.cpp b/ApplicationCode/ProjectDataModel/RimCase.cpp index 0dc84cde35..b9ab321d5c 100644 --- a/ApplicationCode/ProjectDataModel/RimCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimCase.cpp @@ -19,17 +19,15 @@ #include "RimCase.h" +#include "RiaApplication.h" +#include "RimFormationNames.h" +#include "RimFormationNamesCollection.h" +#include "RimOilField.h" +#include "RimProject.h" +#include "RimTimeStepFilter.h" + #include "cafPdmObjectFactory.h" -#include -#include -#include -#include -#include "RimProject.h" -#include "RiaApplication.h" -#include "RimOilField.h" -#include "RimFormationNamesCollection.h" -#include "RimFormationNames.h" CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimCase, "RimCase"); @@ -45,7 +43,11 @@ RimCase::RimCase() caseId.uiCapability()->setUiReadOnly(true); CAF_PDM_InitFieldNoDefault(&activeFormationNames, "DefaultFormationNames", "Formation Names File", "", "", ""); - + + CAF_PDM_InitFieldNoDefault(&m_timeStepFilter, "TimeStepFilter", "Time Step Filter", "", "", ""); + m_timeStepFilter.uiCapability()->setUiHidden(true); + m_timeStepFilter.uiCapability()->setUiTreeChildrenHidden(true); + m_timeStepFilter = new RimTimeStepFilter; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimCase.h b/ApplicationCode/ProjectDataModel/RimCase.h index cb274de8f0..cac5577357 100644 --- a/ApplicationCode/ProjectDataModel/RimCase.h +++ b/ApplicationCode/ProjectDataModel/RimCase.h @@ -22,6 +22,7 @@ #include "cafPdmPtrField.h" #include "cafPdmField.h" #include "cafPdmObject.h" +#include "cafPdmChildField.h" #include "cvfBase.h" #include "cvfVector3.h" @@ -30,6 +31,7 @@ class RimView; class RimFormationNames; +class RimTimeStepFilter; namespace cvf { class BoundingBox; @@ -68,6 +70,9 @@ protected: virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; private: virtual caf::PdmFieldHandle* userDescriptionField() override { return &caseUserDescription; } + +protected: + caf::PdmChildField m_timeStepFilter; }; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index 3fa275876c..50710214d5 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -29,14 +29,15 @@ #include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" +#include "RigFlowDiagSolverInterface.h" #include "RigMainGrid.h" +#include "RimFlowDiagSolution.h" #include "RimMockModelSettings.h" #include "RimProject.h" #include "RimReservoirCellResultsStorage.h" +#include "RimTimeStepFilter.h" #include "RimTools.h" -#include "RimFlowDiagSolution.h" -#include "RigFlowDiagSolverInterface.h" #include "cafPdmSettings.h" #include "cafPdmUiPropertyViewDialog.h" @@ -111,6 +112,11 @@ bool RimEclipseResultCase::openEclipseGridFile() readerInterface->setReaderSetting(prefs->readerSettings()); readerInterface->setFilenamesWithFaults(this->filesContainingFaults()); + if (!m_timeStepFilter->timeStepIndicesToImport().empty()) + { + readerInterface->setTimeStepFilter(m_timeStepFilter->timeStepIndicesToImport()); + } + cvf::ref eclipseCase = new RigEclipseCaseData; if (!readerInterface->open(caseFileName(), eclipseCase.p())) { @@ -460,5 +466,8 @@ void RimEclipseResultCase::defineUiOrdering(QString uiConfigName, caf::PdmUiOrde group->add(&flipXAxis); group->add(&flipYAxis); + auto group1 = uiOrdering.addNewGroup("Time Step Filter"); + group1->setCollapsedByDefault(true); + m_timeStepFilter->uiOrdering(uiConfigName, *group1); } diff --git a/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp new file mode 100644 index 0000000000..1d176929cd --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp @@ -0,0 +1,47 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimTimeStepFilter.h" + +CAF_PDM_SOURCE_INIT(RimTimeStepFilter, "TimeStepFilter"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimTimeStepFilter::RimTimeStepFilter() +{ + CAF_PDM_InitObject("Time Step Filter", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&m_timeStepIndicesToImport, "TimeStepIndicesToImport", "Values", "", "", ""); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimTimeStepFilter::timeStepIndicesToImport() const +{ + std::vector indices; + + // Convert vector from int to size_t + for (auto intValue : m_timeStepIndicesToImport.v()) + { + indices.push_back(intValue); + } + + return indices; +} diff --git a/ApplicationCode/ProjectDataModel/RimTimeStepFilter.h b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.h new file mode 100644 index 0000000000..12830b44b9 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimTimeStepFilter.h @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmObject.h" +#include "cafPdmField.h" + +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +class RimTimeStepFilter : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; +public: + RimTimeStepFilter(); + + std::vector timeStepIndicesToImport() const; + +private: + caf::PdmField< std::vector > m_timeStepIndicesToImport; +}; + From 3253c8968e95075d5340b9e3e3c7d3dba832b099 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 07:47:40 +0200 Subject: [PATCH 23/36] #1691 Move RigResultInfo into separate file --- .../RimIdenticalGridCaseGroup.cpp | 4 +- .../RimReservoirCellResultsStorage.cpp | 5 ++- .../ReservoirDataModel/CMakeLists_files.cmake | 2 + .../RigCaseCellResultsData.cpp | 8 ++-- .../RigCaseCellResultsData.h | 18 +------- .../ReservoirDataModel/RigResultInfo.cpp | 32 ++++++++++++++ .../ReservoirDataModel/RigResultInfo.h | 42 +++++++++++++++++++ 7 files changed, 87 insertions(+), 24 deletions(-) create mode 100644 ApplicationCode/ReservoirDataModel/RigResultInfo.cpp create mode 100644 ApplicationCode/ReservoirDataModel/RigResultInfo.h diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index e91aac25f8..bc4aabebb6 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -22,10 +22,10 @@ #include "RigActiveCellInfo.h" #include "RigCaseCellResultsData.h" -#include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" #include "RigGridManager.h" #include "RigMainGrid.h" +#include "RigResultInfo.h" #include "RimCaseCollection.h" #include "RimCellEdgeColors.h" @@ -242,7 +242,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() std::vector daysSinceSimulationStart = rigCaseData->results(poroModel)->daysSinceSimulationStart(0); std::vector reportStepNumbers = rigCaseData->results(poroModel)->reportStepNumbers(0); - const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); + const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++) { diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index ecdb171056..e138268a9d 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -21,9 +21,10 @@ #include "RigActiveCellInfo.h" #include "RigCaseCellResultsData.h" -#include "RigEclipseCaseData.h" #include "RigCell.h" +#include "RigEclipseCaseData.h" #include "RigMainGrid.h" +#include "RigResultInfo.h" #include "RimEclipseCase.h" #include "RimTools.h" @@ -90,7 +91,7 @@ void RimReservoirCellResultsStorage::setupBeforeSave() if (!m_cellResults) return; - const std::vector& resInfo = m_cellResults->infoForEachResultIndex(); + const std::vector& resInfo = m_cellResults->infoForEachResultIndex(); bool hasResultsToStore = false; for (size_t rIdx = 0; rIdx < resInfo.size(); ++rIdx) diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index 332a8c46bd..4b77dc480d 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -58,6 +58,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.h ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.h ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.h +${CEE_CURRENT_LIST_DIR}RigResultInfo.h ${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.h @@ -112,6 +113,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.cpp ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.cpp ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.cpp +${CEE_CURRENT_LIST_DIR}RigResultInfo.cpp ${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.cpp ) diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 69daee7d82..f0aaa551bb 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -20,13 +20,15 @@ #include "RigCaseCellResultsData.h" -#include "RigMainGrid.h" -#include "RigStatisticsDataCache.h" -#include "RigStatisticsMath.h" #include "RigEclipseMultiPropertyStatCalc.h" #include "RigEclipseNativeStatCalc.h" +#include "RigMainGrid.h" +#include "RigResultInfo.h" +#include "RigStatisticsDataCache.h" +#include "RigStatisticsMath.h" #include + #include diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index 18c5e11b5c..f965031fe1 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -35,6 +35,7 @@ class RifReaderInterface; class RigMainGrid; class RigActiveCellInfo; class RigStatisticsDataCache; +class ResultInfo; //================================================================================================== /// Class containing the results for the complete number of active cells. Both main grid and LGR's @@ -107,23 +108,6 @@ public: bool updateResultName(RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName); public: - class ResultInfo - { - public: - ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, QString resultName, size_t gridScalarResultIndex) - : m_resultType(resultType), m_needsToBeStored(needsToBeStored), m_resultName(resultName), m_gridScalarResultIndex(gridScalarResultIndex), m_mustBeCalculated(mustBeCalculated) { } - - public: - RiaDefines::ResultCatType m_resultType; - bool m_needsToBeStored; - bool m_mustBeCalculated; - QString m_resultName; - size_t m_gridScalarResultIndex; - std::vector m_timeStepDates; - std::vector m_timeStepReportNumbers; - std::vector m_daysSinceSimulationStart; - }; - const std::vector& infoForEachResultIndex() { return m_resultInfos;} bool mustBeCalculated(size_t scalarResultIndex) const; diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp b/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp new file mode 100644 index 0000000000..3535f5c336 --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RigResultInfo.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +ResultInfo::ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, + QString resultName, size_t gridScalarResultIndex) + : m_resultType(resultType), + m_needsToBeStored(needsToBeStored), + m_mustBeCalculated(mustBeCalculated), + m_resultName(resultName), + m_gridScalarResultIndex(gridScalarResultIndex) +{ +} diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.h b/ApplicationCode/ReservoirDataModel/RigResultInfo.h new file mode 100644 index 0000000000..ccbc0885b2 --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigResultInfo.h @@ -0,0 +1,42 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RiaDefines.h" + +#include + +class QString; + +class ResultInfo +{ +public: + ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, + QString resultName, size_t gridScalarResultIndex); + +public: + RiaDefines::ResultCatType m_resultType; + bool m_needsToBeStored; + bool m_mustBeCalculated; + QString m_resultName; + size_t m_gridScalarResultIndex; + std::vector m_timeStepDates; + std::vector m_timeStepReportNumbers; + std::vector m_daysSinceSimulationStart; +}; From 6b90a944580fcdcf17760c5153be6145ec680f40 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 07:57:55 +0200 Subject: [PATCH 24/36] #1691 Rename to RigResultInfo --- .../ProjectDataModel/RimIdenticalGridCaseGroup.cpp | 2 +- .../RimReservoirCellResultsStorage.cpp | 2 +- .../ReservoirDataModel/RigCaseCellResultsData.cpp | 10 +++++----- .../ReservoirDataModel/RigCaseCellResultsData.h | 9 ++++----- ApplicationCode/ReservoirDataModel/RigResultInfo.cpp | 2 +- ApplicationCode/ReservoirDataModel/RigResultInfo.h | 4 ++-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index bc4aabebb6..73d2c0b401 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -242,7 +242,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() std::vector daysSinceSimulationStart = rigCaseData->results(poroModel)->daysSinceSimulationStart(0); std::vector reportStepNumbers = rigCaseData->results(poroModel)->reportStepNumbers(0); - const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); + const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++) { diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index e138268a9d..0c9b02e39d 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -91,7 +91,7 @@ void RimReservoirCellResultsStorage::setupBeforeSave() if (!m_cellResults) return; - const std::vector& resInfo = m_cellResults->infoForEachResultIndex(); + const std::vector& resInfo = m_cellResults->infoForEachResultIndex(); bool hasResultsToStore = false; for (size_t rIdx = 0; rIdx < resInfo.size(); ++rIdx) diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index f0aaa551bb..a6a2788272 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -207,7 +207,7 @@ std::vector& RigCaseCellResultsData::cellScalarResults(size_t scalarResu //-------------------------------------------------------------------------------------------------- size_t RigCaseCellResultsData::findScalarResultIndex(RiaDefines::ResultCatType type, const QString& resultName) const { - std::vector::const_iterator it; + std::vector::const_iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_resultType == type && it->m_resultName == resultName) @@ -268,7 +268,7 @@ size_t RigCaseCellResultsData::addEmptyScalarResult(RiaDefines::ResultCatType ty scalarResultIndex = this->resultCount(); m_cellScalarResults.push_back(std::vector >()); - ResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex); + RigResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex); m_resultInfos.push_back(resInfo); // Create statistics calculator and add statistics cache object @@ -341,7 +341,7 @@ size_t RigCaseCellResultsData::addEmptyScalarResult(RiaDefines::ResultCatType ty QStringList RigCaseCellResultsData::resultNames(RiaDefines::ResultCatType resType) const { QStringList varList; - std::vector::const_iterator it; + std::vector::const_iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_resultType == resType ) @@ -621,7 +621,7 @@ bool RigCaseCellResultsData::updateResultName(RiaDefines::ResultCatType resultTy //-------------------------------------------------------------------------------------------------- bool RigCaseCellResultsData::mustBeCalculated(size_t scalarResultIndex) const { - std::vector::const_iterator it; + std::vector::const_iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_gridScalarResultIndex == scalarResultIndex) @@ -638,7 +638,7 @@ bool RigCaseCellResultsData::mustBeCalculated(size_t scalarResultIndex) const //-------------------------------------------------------------------------------------------------- void RigCaseCellResultsData::setMustBeCalculated(size_t scalarResultIndex) { - std::vector::iterator it; + std::vector::iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_gridScalarResultIndex == scalarResultIndex) diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index f965031fe1..7627a90125 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -32,10 +32,10 @@ #include class RifReaderInterface; -class RigMainGrid; class RigActiveCellInfo; +class RigMainGrid; +class RigResultInfo; class RigStatisticsDataCache; -class ResultInfo; //================================================================================================== /// Class containing the results for the complete number of active cells. Both main grid and LGR's @@ -108,7 +108,7 @@ public: bool updateResultName(RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName); public: - const std::vector& infoForEachResultIndex() { return m_resultInfos;} + const std::vector& infoForEachResultIndex() { return m_resultInfos;} bool mustBeCalculated(size_t scalarResultIndex) const; void setMustBeCalculated(size_t scalarResultIndex); @@ -127,9 +127,8 @@ private: cvf::Collection m_statisticsDataCache; private: - std::vector m_resultInfos; + std::vector m_resultInfos; RigMainGrid* m_ownerMainGrid; RigActiveCellInfo* m_activeCellInfo; - }; diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp b/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp index 3535f5c336..18848cca46 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp @@ -21,7 +21,7 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -ResultInfo::ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, +RigResultInfo::RigResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, QString resultName, size_t gridScalarResultIndex) : m_resultType(resultType), m_needsToBeStored(needsToBeStored), diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.h b/ApplicationCode/ReservoirDataModel/RigResultInfo.h index ccbc0885b2..78ff56ac99 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultInfo.h +++ b/ApplicationCode/ReservoirDataModel/RigResultInfo.h @@ -24,10 +24,10 @@ class QString; -class ResultInfo +class RigResultInfo { public: - ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, + RigResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, QString resultName, size_t gridScalarResultIndex); public: From ad09441da1568ebf9b6bad289ba029deff51db12 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 09:21:32 +0200 Subject: [PATCH 25/36] #1691 Add RigTimeStepInfo --- .../FileInterface/RifReaderEclipseOutput.cpp | 43 +++------- .../FileInterface/RifReaderMockModel.cpp | 37 ++++----- .../RimEclipseStatisticsCaseEvaluator.cpp | 10 +-- .../RimIdenticalGridCaseGroup.cpp | 8 +- .../RimReservoirCellResultsStorage.cpp | 20 +++-- .../RigCaseCellResultsData.cpp | 40 ++++++---- .../RigCaseCellResultsData.h | 5 +- .../ReservoirDataModel/RigResultInfo.cpp | 78 +++++++++++++++++++ .../ReservoirDataModel/RigResultInfo.h | 33 +++++++- 9 files changed, 184 insertions(+), 90 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index c60ccf7807..a7de33a5e6 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -30,6 +30,7 @@ #include "RigEclipseCaseData.h" #include "RigMainGrid.h" #include "RigSingleWellResultsData.h" +#include "RigResultInfo.h" #include "cafProgressInfo.h" @@ -646,8 +647,7 @@ void RifReaderEclipseOutput::buildMetaData() RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RifReaderInterface::MATRIX_RESULTS); RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS); - std::vector timeSteps; - std::vector daysSinceSimulationStart; + std::vector timeStepInfos; // Create access object for dynamic results m_dynamicResultsAccess = createDynamicResultsAccess(); @@ -657,8 +657,6 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.incrementProgress(); - std::vector reportNumbers; - // Get time steps { std::vector timeStepsOnFile; @@ -672,9 +670,7 @@ void RifReaderEclipseOutput::buildMetaData() { if (this->isTimeStepIncludedByFilter(i)) { - timeSteps.push_back(timeStepsOnFile[i]); - daysSinceSimulationStart.push_back(daysSinceSimulationStartOnFile[i]); - reportNumbers.push_back(reportNumbersOnFile[i]); + timeStepInfos.push_back(RigTimeStepInfo(timeStepsOnFile[i], reportNumbersOnFile[i], daysSinceSimulationStartOnFile[i])); } } } @@ -692,7 +688,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < matrixResultNames.size(); ++i) { size_t resIndex = matrixModelResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, matrixResultNames[i], false); - matrixModelResults->setTimeStepDates(resIndex, timeSteps, daysSinceSimulationStart, reportNumbers); + matrixModelResults->setTimeStepInfos(resIndex, timeStepInfos); } } @@ -705,7 +701,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < fractureResultNames.size(); ++i) { size_t resIndex = fractureModelResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, fractureResultNames[i], false); - fractureModelResults->setTimeStepDates(resIndex, timeSteps, daysSinceSimulationStart, reportNumbers); + fractureModelResults->setTimeStepInfos(resIndex, timeStepInfos); } } @@ -741,29 +737,10 @@ void RifReaderEclipseOutput::buildMetaData() RifEclipseOutputFileTools::findKeywordsAndItemCount(filesUsedToFindAvailableKeywords, &resultNames, &resultNamesDataItemCounts); - std::vector staticDate; - std::vector staticDay; - std::vector staticReportNumber; + std::vector staticTimeStepInfo; + if (!timeStepInfos.empty()) { - if ( timeSteps.size() > 0 ) - { - staticDate.push_back(timeSteps.front()); - } - if (daysSinceSimulationStart.size() > 0) - { - staticDay.push_back(daysSinceSimulationStart.front()); - } - - std::vector reportNumbers; - if (m_dynamicResultsAccess.notNull()) - { - reportNumbers = m_dynamicResultsAccess->reportNumbers(); - } - - if ( reportNumbers.size() > 0 ) - { - staticReportNumber.push_back(reportNumbers.front()); - } + staticTimeStepInfo.push_back(timeStepInfos.front()); } { @@ -778,7 +755,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < matrixResultNames.size(); ++i) { size_t resIndex = matrixModelResults->addEmptyScalarResult(RiaDefines::STATIC_NATIVE, matrixResultNames[i], false); - matrixModelResults->setTimeStepDates(resIndex, staticDate, staticDay, staticReportNumber); + matrixModelResults->setTimeStepInfos(resIndex, staticTimeStepInfo); } } @@ -793,7 +770,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < fractureResultNames.size(); ++i) { size_t resIndex = fractureModelResults->addEmptyScalarResult(RiaDefines::STATIC_NATIVE, fractureResultNames[i], false); - fractureModelResults->setTimeStepDates(resIndex, staticDate, staticDay, staticReportNumber); + fractureModelResults->setTimeStepInfos(resIndex, staticTimeStepInfo); } } } diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index dee15942f5..ef25d6d9a0 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -22,6 +22,7 @@ #include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" +#include "RigResultInfo.h" //-------------------------------------------------------------------------------------------------- /// @@ -34,32 +35,32 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip RigCaseCellResultsData* cellResults = eclipseCase->results(RifReaderInterface::MATRIX_RESULTS); - - std::vector dates; - std::vector days; - std::vector repNumbers; - - for (int i = 0; i < static_cast(m_reservoirBuilder.timeStepCount()); i++) + std::vector timeStepInfos; { - dates.push_back(QDateTime(QDate(2012+i, 6, 1))); - days.push_back(i); - repNumbers.push_back(i); + std::vector dates; + std::vector days; + std::vector repNumbers; + + for (int i = 0; i < static_cast(m_reservoirBuilder.timeStepCount()); i++) + { + dates.push_back(QDateTime(QDate(2012+i, 6, 1))); + days.push_back(i); + repNumbers.push_back(i); + } + + timeStepInfos = RigTimeStepInfo::createTimeStepInfos(dates, repNumbers, days); } for (size_t i = 0; i < m_reservoirBuilder.resultCount(); i++) { size_t resIdx = cellResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, QString("Dynamic_Result_%1").arg(i), false); - cellResults->setTimeStepDates(resIdx, dates, days, repNumbers); + cellResults->setTimeStepInfos(resIdx, timeStepInfos); } if (m_reservoirBuilder.timeStepCount() == 0) return true; - std::vector staticDates; - staticDates.push_back(dates[0]); - std::vector staticDays; - staticDays.push_back(days[0]); - std::vector staticRepNumbers; - staticRepNumbers.push_back(0); + std::vector staticResultTimeStepInfos; + staticResultTimeStepInfos.push_back(timeStepInfos[0]); for (int i = 0; i < static_cast(m_reservoirBuilder.resultCount()); i++) { @@ -70,7 +71,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip if (i > 1) resIndex = i; size_t resIdx = cellResults->addEmptyScalarResult(RiaDefines::STATIC_NATIVE, QString("Static_Result_%1%2").arg(resIndex).arg(varEnd), false); - cellResults->setTimeStepDates(resIdx, staticDates, staticDays, staticRepNumbers); + cellResults->setTimeStepInfos(resIdx, staticResultTimeStepInfos); } @@ -79,7 +80,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip size_t resIdx; \ QString resultName(Name); \ resIdx = cellResults->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, resultName, false); \ - cellResults->setTimeStepDates(resIdx, staticDates, staticDays, staticRepNumbers); \ + cellResults->setTimeStepInfos(resIdx, staticResultTimeStepInfos); \ cellResults->cellScalarResults(resIdx).resize(1); \ std::vector& values = cellResults->cellScalarResults(resIdx)[0]; \ this->inputProperty(resultName, &values); \ diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index 923ed6f9dd..ed5534ec2c 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp @@ -43,20 +43,18 @@ void RimEclipseStatisticsCaseEvaluator::addNamedResult(RigCaseCellResultsData* d // Use time step dates from first result in first source case CVF_ASSERT(m_sourceCases.size() > 0); - std::vector sourceTimeStepDates = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates(0); - std::vector sourceDaysSinceSimulationStart = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->daysSinceSimulationStart(0); - std::vector sourceReportStepNumbers = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->reportStepNumbers(0); + std::vector sourceTimeStepInfos = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepInfos(0); size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true); CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T); - destinationCellResults->setTimeStepDates(destinationScalarResultIndex, sourceTimeStepDates, sourceDaysSinceSimulationStart, sourceReportStepNumbers); + destinationCellResults->setTimeStepInfos(destinationScalarResultIndex, sourceTimeStepInfos); std::vector< std::vector >& dataValues = destinationCellResults->cellScalarResults(destinationScalarResultIndex); - dataValues.resize(sourceTimeStepDates.size()); + dataValues.resize(sourceTimeStepInfos.size()); // Initializes the size of the destination dataset to active union cell count - for (size_t i = 0; i < sourceTimeStepDates.size(); i++) + for (size_t i = 0; i < sourceTimeStepInfos.size(); i++) { dataValues[i].resize(activeUnionCellCount, HUGE_VAL); } diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index 73d2c0b401..a67e319e8d 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -238,9 +238,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() { RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS; - std::vector timeStepDates = rigCaseData->results(poroModel)->timeStepDates(0); - std::vector daysSinceSimulationStart = rigCaseData->results(poroModel)->daysSinceSimulationStart(0); - std::vector reportStepNumbers = rigCaseData->results(poroModel)->reportStepNumbers(0); + std::vector timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0); const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); @@ -265,10 +263,10 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() if (mustBeCalculated) cellResultsStorage->cellResults()->setMustBeCalculated(scalarResultIndex); - cellResultsStorage->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates, daysSinceSimulationStart, reportStepNumbers); + cellResultsStorage->cellResults()->setTimeStepInfos(scalarResultIndex, timeStepInfos); std::vector< std::vector >& dataValues = cellResultsStorage->cellResults()->cellScalarResults(scalarResultIndex); - dataValues.resize(timeStepDates.size()); + dataValues.resize(timeStepInfos.size()); } } diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 0c9b02e39d..051ddd7e66 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -140,15 +140,15 @@ void RimReservoirCellResultsStorage::setupBeforeSave() cacheEntry->m_resultType = resInfo[rIdx].m_resultType; cacheEntry->m_resultName = resInfo[rIdx].m_resultName; - cacheEntry->m_timeStepDates = resInfo[rIdx].m_timeStepDates; - cacheEntry->m_daysSinceSimulationStart = resInfo[rIdx].m_daysSinceSimulationStart; + cacheEntry->m_timeStepDates = resInfo[rIdx].dates(); + cacheEntry->m_daysSinceSimulationStart = resInfo[rIdx].daysSinceSimulationStarts(); // Take note of the file position for fast lookup later cacheEntry->m_filePosition = cacheFile.pos(); // Write all the scalar values for each time step to the stream, // starting with the number of values - for (size_t tsIdx = 0; tsIdx < resInfo[rIdx].m_timeStepDates.size() ; ++tsIdx) + for (size_t tsIdx = 0; tsIdx < resInfo[rIdx].dates().size() ; ++tsIdx) { const std::vector* data = NULL; if (tsIdx < timestepCount) @@ -379,7 +379,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result if (m_readerInterface.notNull()) { // Add one more result to result container - size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepDates.size(); + size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepInfos.size(); bool resultLoadingSucess = true; @@ -461,7 +461,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi if (m_readerInterface.notNull()) { - size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepDates.size(); + size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepInfos.size(); bool resultLoadingSucess = true; @@ -525,7 +525,7 @@ void RimReservoirCellResultsStorage::computeSOILForTimeStep(size_t timeStepIndex if (swatForTimeStep.size() > 0) { soilResultValueCount = swatForTimeStep.size(); - soilTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSWAT].m_timeStepDates.size(); + soilTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSWAT].m_timeStepInfos.size(); } } @@ -536,7 +536,7 @@ void RimReservoirCellResultsStorage::computeSOILForTimeStep(size_t timeStepIndex { soilResultValueCount = qMax(soilResultValueCount, sgasForTimeStep.size()); - size_t sgasTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSGAS].m_timeStepDates.size(); + size_t sgasTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSGAS].m_timeStepInfos.size(); soilTimeStepCount = qMax(soilTimeStepCount, sgasTimeStepCount); } } @@ -1494,7 +1494,11 @@ void RimReservoirCellResultsStorage::setCellResults(RigCaseCellResultsData* cell RimReservoirCellResultsStorageEntryInfo* resInfo = m_resultCacheMetaData[rIdx]; size_t resultIndex = m_cellResults->addEmptyScalarResult(resInfo->m_resultType(), resInfo->m_resultName(), true); - m_cellResults->setTimeStepDates(resultIndex, resInfo->m_timeStepDates(), resInfo->m_daysSinceSimulationStart(), std::vector()); // Hack: Using no report step numbers. Not really used except for Flow Diagnostics... + std::vector reportNumbers; // Hack: Using no report step numbers. Not really used except for Flow Diagnostics... + reportNumbers.resize(resInfo->m_timeStepDates().size()); + std::vector timeStepInfos = RigTimeStepInfo::createTimeStepInfos(resInfo->m_timeStepDates(), reportNumbers, resInfo->m_daysSinceSimulationStart()); + + m_cellResults->setTimeStepInfos(resultIndex, timeStepInfos); progress.setProgressDescription(resInfo->m_resultName); diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index a6a2788272..5a76ad747a 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -394,8 +394,8 @@ bool RigCaseCellResultsData::hasFlowDiagUsableFluxes() const //-------------------------------------------------------------------------------------------------- QDateTime RigCaseCellResultsData::timeStepDate(size_t scalarResultIndex, size_t timeStepIndex) const { - if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepDates.size() > timeStepIndex) - return m_resultInfos[scalarResultIndex].m_timeStepDates[timeStepIndex]; + if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepInfos.size() > timeStepIndex) + return m_resultInfos[scalarResultIndex].m_timeStepInfos[timeStepIndex].m_date; else return QDateTime(); } @@ -406,7 +406,9 @@ QDateTime RigCaseCellResultsData::timeStepDate(size_t scalarResultIndex, size_t std::vector RigCaseCellResultsData::timeStepDates(size_t scalarResultIndex) const { if (scalarResultIndex < m_resultInfos.size()) - return m_resultInfos[scalarResultIndex].m_timeStepDates; + { + return m_resultInfos[scalarResultIndex].dates(); + } else return std::vector(); } @@ -440,7 +442,7 @@ std::vector RigCaseCellResultsData::daysSinceSimulationStart(size_t scal { if (scalarResultIndex < m_resultInfos.size()) { - return m_resultInfos[scalarResultIndex].m_daysSinceSimulationStart; + return m_resultInfos[scalarResultIndex].daysSinceSimulationStarts(); } else { @@ -453,8 +455,8 @@ std::vector RigCaseCellResultsData::daysSinceSimulationStart(size_t scal //-------------------------------------------------------------------------------------------------- int RigCaseCellResultsData::reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const { - if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepReportNumbers.size() > timeStepIndex) - return m_resultInfos[scalarResultIndex].m_timeStepReportNumbers[timeStepIndex]; + if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepInfos.size() > timeStepIndex) + return m_resultInfos[scalarResultIndex].m_timeStepInfos[timeStepIndex].m_reportNumber; else return -1; } @@ -465,25 +467,33 @@ int RigCaseCellResultsData::reportStepNumber(size_t scalarResultIndex, size_t ti std::vector RigCaseCellResultsData::reportStepNumbers(size_t scalarResultIndex) const { if (scalarResultIndex < m_resultInfos.size() ) - return m_resultInfos[scalarResultIndex].m_timeStepReportNumbers; + return m_resultInfos[scalarResultIndex].reportNumbers(); else return std::vector(); - } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigCaseCellResultsData::setTimeStepDates(size_t scalarResultIndex, const std::vector& dates, const std::vector& daysSinceSimulationStart, const std::vector& reportStepNumbers) +std::vector RigCaseCellResultsData::timeStepInfos(size_t scalarResultIndex) const +{ + if (scalarResultIndex < m_resultInfos.size()) + return m_resultInfos[scalarResultIndex].m_timeStepInfos; + else + return std::vector(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigCaseCellResultsData::setTimeStepInfos(size_t scalarResultIndex, const std::vector& timeStepInfos) { CVF_ASSERT(scalarResultIndex < m_resultInfos.size() ); - m_resultInfos[scalarResultIndex].m_timeStepDates = dates; - m_resultInfos[scalarResultIndex].m_daysSinceSimulationStart = daysSinceSimulationStart; - m_resultInfos[scalarResultIndex].m_timeStepReportNumbers = reportStepNumbers; + m_resultInfos[scalarResultIndex].m_timeStepInfos = timeStepInfos; std::vector< std::vector >& dataValues = this->cellScalarResults(scalarResultIndex); - dataValues.resize(dates.size()); + dataValues.resize(timeStepInfos.size()); } //-------------------------------------------------------------------------------------------------- @@ -496,9 +506,9 @@ size_t RigCaseCellResultsData::maxTimeStepCount(size_t* scalarResultIndexWithMos for (size_t i = 0; i < m_resultInfos.size(); i++) { - if (m_resultInfos[i].m_timeStepDates.size() > maxTsCount) + if (m_resultInfos[i].m_timeStepInfos.size() > maxTsCount) { - maxTsCount = m_resultInfos[i].m_timeStepDates.size(); + maxTsCount = m_resultInfos[i].m_timeStepInfos.size(); scalarResultIndexWithMaxTsCount = i; } } diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index 7627a90125..58c7c2621d 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -36,6 +36,7 @@ class RigActiveCellInfo; class RigMainGrid; class RigResultInfo; class RigStatisticsDataCache; +class RigTimeStepInfo; //================================================================================================== /// Class containing the results for the complete number of active cells. Both main grid and LGR's @@ -81,7 +82,9 @@ public: std::vector daysSinceSimulationStart(size_t scalarResultIndex) const; int reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const; std::vector reportStepNumbers(size_t scalarResultIndex) const; - void setTimeStepDates(size_t scalarResultIndex, const std::vector& dates, const std::vector& daysSinceSimulationStart, const std::vector& reportStepNumbers); + + std::vector timeStepInfos(size_t scalarResultIndex) const; + void setTimeStepInfos(size_t scalarResultIndex, const std::vector& timeStepInfos); // Find or create a slot for the results diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp b/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp index 18848cca46..4e5686cd22 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp @@ -18,6 +18,38 @@ #include "RigResultInfo.h" +#include "cvfAssert.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigTimeStepInfo::RigTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart) + : m_date(date), + m_reportNumber(reportNumber), + m_daysSinceSimulationStart(daysSinceSimulationStart) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigTimeStepInfo::createTimeStepInfos(std::vector dates, + std::vector reportNumbers, + std::vector daysSinceSimulationStarts) +{ + CVF_ASSERT(dates.size() == reportNumbers.size()); + CVF_ASSERT(dates.size() == daysSinceSimulationStarts.size()); + + std::vector timeStepInfos; + + for (size_t i = 0; i < dates.size(); i++) + { + timeStepInfos.push_back(RigTimeStepInfo(dates[i], reportNumbers[i], daysSinceSimulationStarts[i])); + } + + return timeStepInfos; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -30,3 +62,49 @@ RigResultInfo::RigResultInfo(RiaDefines::ResultCatType resultType, bool needsToB m_gridScalarResultIndex(gridScalarResultIndex) { } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigResultInfo::dates() const +{ + std::vector values; + + for (auto v : m_timeStepInfos) + { + values.push_back(v.m_date); + } + + return values; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigResultInfo::daysSinceSimulationStarts() const +{ + std::vector values; + + for (auto v : m_timeStepInfos) + { + values.push_back(v.m_daysSinceSimulationStart); + } + + return values; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigResultInfo::reportNumbers() const +{ + std::vector values; + + for (auto v : m_timeStepInfos) + { + values.push_back(v.m_reportNumber); + } + + return values; +} + diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.h b/ApplicationCode/ReservoirDataModel/RigResultInfo.h index 78ff56ac99..4ff0524811 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultInfo.h +++ b/ApplicationCode/ReservoirDataModel/RigResultInfo.h @@ -20,23 +20,48 @@ #include "RiaDefines.h" +#include +#include + #include -class QString; +//================================================================================================== +/// +//================================================================================================== +class RigTimeStepInfo +{ +public: + RigTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart); + static std::vector createTimeStepInfos(std::vector dates, + std::vector reportNumbers, + std::vector daysSinceSimulationStarts); +public: + QDateTime m_date; + int m_reportNumber; + double m_daysSinceSimulationStart; +}; + + +//================================================================================================== +/// +//================================================================================================== class RigResultInfo { public: RigResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, QString resultName, size_t gridScalarResultIndex); + std::vector dates() const; + std::vector daysSinceSimulationStarts() const; + std::vector reportNumbers() const; + public: RiaDefines::ResultCatType m_resultType; bool m_needsToBeStored; bool m_mustBeCalculated; QString m_resultName; size_t m_gridScalarResultIndex; - std::vector m_timeStepDates; - std::vector m_timeStepReportNumbers; - std::vector m_daysSinceSimulationStart; + + std::vector m_timeStepInfos; }; From 88bbea633972be2c5ab3f4840f1c1c03ef4dac16 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 09:59:49 +0200 Subject: [PATCH 26/36] #1755 Remove porosity enum from RifReaderInterface --- ...sTransmissibilityCalculationFeatureImp.cpp | 2 +- ...RicWellPathExportCompletionDataFeature.cpp | 62 +++++++++--------- .../ExportCommands/RicCellRangeUi.cpp | 2 +- .../RifEclipseInputFileTools.cpp | 14 ++-- .../FileInterface/RifReaderEclipseInput.h | 4 +- .../FileInterface/RifReaderEclipseOutput.cpp | 58 ++++++++--------- .../FileInterface/RifReaderEclipseOutput.h | 8 +-- .../FileInterface/RifReaderInterface.h | 13 ++-- .../FileInterface/RifReaderMockModel.cpp | 6 +- .../FileInterface/RifReaderMockModel.h | 4 +- .../RivIntersectionBoxPartMgr.cpp | 1 - .../Intersections/RivIntersectionPartMgr.cpp | 1 - .../RivCellEdgeGeometryUtils.cpp | 3 +- .../ModelVisualization/RivFaultPartMgr.cpp | 1 - .../RivTernaryTextureCoordsCreator.cpp | 4 +- .../Flow/RimFlowDiagSolution.cpp | 4 +- .../Flow/RimWellAllocationPlot.cpp | 2 +- .../Rim3dOverlayInfoConfig.cpp | 4 +- .../ProjectDataModel/RimEclipseCase.cpp | 30 ++++----- .../ProjectDataModel/RimEclipseCase.h | 4 +- .../RimEclipseCaseCollection.cpp | 2 +- .../ProjectDataModel/RimEclipseCellColors.cpp | 3 +- .../ProjectDataModel/RimEclipseInputCase.cpp | 18 +++--- .../RimEclipseInputProperty.cpp | 4 +- .../ProjectDataModel/RimEclipseResultCase.cpp | 10 +-- .../RimEclipseResultDefinition.cpp | 8 +-- .../RimEclipseStatisticsCase.cpp | 64 +++++++++---------- .../RimEclipseStatisticsCaseEvaluator.cpp | 14 ++-- .../RimEclipseStatisticsCaseEvaluator.h | 8 +-- .../ProjectDataModel/RimEclipseView.cpp | 11 +--- .../RimIdenticalGridCaseGroup.cpp | 24 +++---- .../RimIdenticalGridCaseGroup.h | 2 +- .../RimReservoirCellResultsStorage.cpp | 8 +-- .../RimWellLogExtractionCurve.cpp | 4 +- .../RigCaseCellResultsData.cpp | 10 --- .../RigCaseCellResultsData.h | 2 - .../ReservoirDataModel/RigEclipseCaseData.cpp | 20 +++--- .../ReservoirDataModel/RigEclipseCaseData.h | 10 +-- .../ReservoirDataModel/RigFlowDiagResults.cpp | 2 +- .../RigFlowDiagSolverInterface.cpp | 10 +-- .../RigReservoirBuilderMock.cpp | 2 +- .../RigResultAccessorFactory.cpp | 14 ++-- .../RigResultAccessorFactory.h | 8 +-- .../RigResultModifierFactory.cpp | 4 +- .../RigResultModifierFactory.h | 4 +- .../SocketInterface/RiaCaseInfoCommands.cpp | 14 ++-- .../SocketInterface/RiaGeometryCommands.cpp | 8 +-- .../RiaPropertyDataCommands.cpp | 24 +++---- .../UnitTests/RifReaderEclipseOutput-Test.cpp | 10 +-- .../UserInterface/RiuResultTextBuilder.cpp | 8 +-- .../RiuSelectionChangedHandler.cpp | 2 +- 51 files changed, 262 insertions(+), 297 deletions(-) diff --git a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp index c19f05bf7b..dea68d097b 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp @@ -86,7 +86,7 @@ std::vector RicFishbonesTransmissibilityCalculationFeatureImp std::vector completionData; RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); - const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); + const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); for (auto cellAndWellBoreParts : wellBorePartsInCells) { diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index d7bc3d8fd7..0485391835 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -582,7 +582,7 @@ std::vector RicWellPathExportCompletionDataFeature::generateP RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType(); std::vector completionData; - const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); + const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); for (const RimPerforationInterval* interval : wellPath->perforationIntervalCollection()->perforations()) @@ -813,12 +813,12 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); + 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)); double yLengthFraction = abs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex)); @@ -852,19 +852,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); - cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMX"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); - cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMY"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); - cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); + 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); double dy = dyAccessObject->cellScalarGlobIdx(cellIndex); @@ -901,19 +901,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclips { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); - cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMX"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); - cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMY"); - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); - cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); + 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); double dy = dyAccessObject->cellScalarGlobIdx(cellIndex); diff --git a/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp b/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp index fd223e3061..3c74619381 100644 --- a/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp @@ -260,7 +260,7 @@ RigActiveCellInfo* RicCellRangeUi::activeCellInfo() const RimEclipseCase* rimEclipeCase = dynamic_cast(m_case()); if (rimEclipeCase && rimEclipeCase->eclipseCaseData()) { - return rimEclipeCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); + return rimEclipeCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); } return nullptr; diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp index eb8f70a98c..2f12dbf6a7 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp @@ -231,7 +231,7 @@ std::map RifEclipseInputFileTools::readProperties(const QStrin ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ecl_type_create_from_type(ECL_FLOAT_TYPE)); if (eclipseKeywordData) { - QString newResultName = caseData->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeywords[i].keyword); + QString newResultName = caseData->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeywords[i].keyword); if (readDataFromKeyword(eclipseKeywordData, caseData, newResultName)) { newResults[newResultName] = fileKeywords[i].keyword; @@ -290,7 +290,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa { mathingItemCount = true; } - if (itemCount == caseData->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount()) + if (itemCount == caseData->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount()) { mathingItemCount = true; } @@ -301,7 +301,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa size_t resultIndex = RifEclipseInputFileTools::findOrCreateResult(resultName, caseData); if (resultIndex == cvf::UNDEFINED_SIZE_T) return false; - std::vector< std::vector >& newPropertyData = caseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex); + std::vector< std::vector >& newPropertyData = caseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex); newPropertyData.push_back(std::vector()); newPropertyData[0].resize(ecl_kw_get_size(eclipseKeywordData), HUGE_VAL); ecl_kw_get_data_as_double(eclipseKeywordData, newPropertyData[0].data()); @@ -446,7 +446,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, { CVF_ASSERT(eclipseCase); - size_t resultIndex = eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(resultName); + size_t resultIndex = eclipseCase->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(resultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { return false; @@ -458,7 +458,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, return false; } - std::vector< std::vector >& resultData = eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex); + std::vector< std::vector >& resultData = eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex); if (resultData.size() == 0) { return false; @@ -717,10 +717,10 @@ qint64 RifEclipseInputFileTools::findKeyword(const QString& keyword, QFile& file //-------------------------------------------------------------------------------------------------- size_t RifEclipseInputFileTools::findOrCreateResult(const QString& newResultName, RigEclipseCaseData* reservoir) { - size_t resultIndex = reservoir->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(newResultName); + size_t resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(newResultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { - resultIndex = reservoir->results(RifReaderInterface::MATRIX_RESULTS)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false); + resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false); } return resultIndex; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseInput.h b/ApplicationCode/FileInterface/RifReaderEclipseInput.h index 4a608885fb..cb192ba496 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseInput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseInput.h @@ -38,6 +38,6 @@ public: virtual void close() {} - virtual bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector* values ) { return false; } - virtual bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values ) { return false; } + virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values ) { return false; } + virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ) { return false; } }; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index a7de33a5e6..12eeec27a5 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -242,8 +242,8 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid, return false; } - RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); - RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS); + RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); + RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); CVF_ASSERT(activeCellInfo && fractureActiveCellInfo); @@ -580,8 +580,8 @@ bool RifReaderEclipseOutput::readActiveCellInfo() return false; } - RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); - RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS); + RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); + RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); activeCellInfo->setReservoirCellCount(reservoirCellCount); fractureActiveCellInfo->setReservoirCellCount(reservoirCellCount); @@ -644,8 +644,8 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.setNextProgressIncrement(m_filesWithSameBaseName.size()); - RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RifReaderInterface::MATRIX_RESULTS); - RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS); + RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RiaDefines::MATRIX_MODEL); + RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RiaDefines::FRACTURE_MODEL); std::vector timeStepInfos; @@ -681,9 +681,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS), - m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS), - RifReaderInterface::MATRIX_RESULTS, m_dynamicResultsAccess->timeStepCount()); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::MATRIX_MODEL, m_dynamicResultsAccess->timeStepCount()); for (int i = 0; i < matrixResultNames.size(); ++i) { @@ -694,9 +694,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS), - m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS), - RifReaderInterface::FRACTURE_RESULTS, m_dynamicResultsAccess->timeStepCount()); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::FRACTURE_MODEL, m_dynamicResultsAccess->timeStepCount()); for (int i = 0; i < fractureResultNames.size(); ++i) { @@ -745,9 +745,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS), - m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS), - RifReaderInterface::MATRIX_RESULTS, 1); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::MATRIX_MODEL, 1); // Add ACTNUM matrixResultNames += "ACTNUM"; @@ -761,9 +761,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS), - m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS), - RifReaderInterface::FRACTURE_RESULTS, 1); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::FRACTURE_MODEL, 1); // Add ACTNUM fractureResultNames += "ACTNUM"; @@ -807,7 +807,7 @@ RifEclipseRestartDataAccess* RifReaderEclipseOutput::createDynamicResultsAccess( //-------------------------------------------------------------------------------------------------- /// Get all values of a given static result as doubles //-------------------------------------------------------------------------------------------------- -bool RifReaderEclipseOutput::staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector* values) +bool RifReaderEclipseOutput::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) { CVF_ASSERT(values); @@ -843,7 +843,7 @@ bool RifReaderEclipseOutput::staticResult(const QString& result, PorosityModelRe //-------------------------------------------------------------------------------------------------- /// Get dynamic result at given step index. Will concatenate values for the main grid and all sub grids. //-------------------------------------------------------------------------------------------------- -bool RifReaderEclipseOutput::dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values) +bool RifReaderEclipseOutput::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) { if (m_dynamicResultsAccess.isNull()) { @@ -1673,7 +1673,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL const std::vector& keywordDataItemCounts, const RigActiveCellInfo* matrixActiveCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, - PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepCount) const { CVF_ASSERT(matrixActiveCellInfo); @@ -1683,7 +1683,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL return QStringList(); } - if (porosityModel == RifReaderInterface::FRACTURE_RESULTS) + if (porosityModel == RiaDefines::FRACTURE_MODEL) { if (fractureActiveCellInfo->reservoirActiveCellCount() == 0) { @@ -1719,14 +1719,14 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL size_t sumFractureMatrixActiveCellCount = matrixActiveCellInfo->reservoirActiveCellCount() + fractureActiveCellInfo->reservoirActiveCellCount(); size_t timeStepsMatrixAndFractureRest = keywordDataItemCount % sumFractureMatrixActiveCellCount; - if (porosityModel == RifReaderInterface::MATRIX_RESULTS && timeStepsMatrixRest == 0) + if (porosityModel == RiaDefines::MATRIX_MODEL && timeStepsMatrixRest == 0) { if (keywordDataItemCount <= timeStepCount * std::max(matrixActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount)) { validKeyword = true; } } - else if (porosityModel == RifReaderInterface::FRACTURE_RESULTS && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0) + else if (porosityModel == RiaDefines::FRACTURE_MODEL && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0) { if (keywordDataItemCount <= timeStepCount * std::max(fractureActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount)) { @@ -1772,19 +1772,19 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(PorosityModelResultType matrixOrFracture, std::vector* destinationResultValues, const std::vector& sourceResultValues) +void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector* destinationResultValues, const std::vector& sourceResultValues) { if (sourceResultValues.size() == 0) return; - RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS); + RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); - if (matrixOrFracture == RifReaderInterface::MATRIX_RESULTS && fracActCellInfo->reservoirActiveCellCount() == 0) + if (matrixOrFracture == RiaDefines::MATRIX_MODEL && fracActCellInfo->reservoirActiveCellCount() == 0) { destinationResultValues->insert(destinationResultValues->end(), sourceResultValues.begin(), sourceResultValues.end()); } else { - RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); + RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); size_t sourceStartPosition = 0; @@ -1796,7 +1796,7 @@ void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(PorosityMod actCellInfo->gridActiveCellCounts(i, matrixActiveCellCount); fracActCellInfo->gridActiveCellCounts(i, fractureActiveCellCount); - if (matrixOrFracture == RifReaderInterface::MATRIX_RESULTS) + if (matrixOrFracture == RiaDefines::MATRIX_MODEL) { destinationResultValues->insert(destinationResultValues->end(), sourceResultValues.begin() + sourceStartPosition, diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index 846bc0e2c9..3e9e8bf74e 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -53,8 +53,8 @@ public: virtual bool openAndReadActiveCellData(const QString& fileName, const std::vector& mainCaseTimeSteps, RigEclipseCaseData* eclipseCase); void close(); - bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector* values); - bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values); + bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values); + bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values); static bool transferGeometry(const ecl_grid_type* mainEclGrid, RigEclipseCaseData* eclipseCase); static void transferCoarseningInfo(const ecl_grid_type* eclGrid, RigGridBase* grid); @@ -72,13 +72,13 @@ private: void openInitFile(); - void extractResultValuesBasedOnPorosityModel(PorosityModelResultType matrixOrFracture, std::vector* values, const std::vector& fileValues); + void extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector* values, const std::vector& fileValues); void transferNNCData( const ecl_grid_type * mainEclGrid , const ecl_file_type * init_file, RigMainGrid * mainGrid); RifEclipseRestartDataAccess* createDynamicResultsAccess(); - QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, PorosityModelResultType matrixOrFracture, size_t timeStepCount) const; + QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaDefines::PorosityModelType matrixOrFracture, size_t timeStepCount) const; private: QString m_fileName; // Name of file used to start accessing Eclipse output files diff --git a/ApplicationCode/FileInterface/RifReaderInterface.h b/ApplicationCode/FileInterface/RifReaderInterface.h index 4257d00292..1157743aa9 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.h +++ b/ApplicationCode/FileInterface/RifReaderInterface.h @@ -20,6 +20,8 @@ #pragma once +#include "RiaDefines.h" + #include "cvfBase.h" #include "cvfObject.h" @@ -43,13 +45,6 @@ class RifReaderSettings; //================================================================================================== class RifReaderInterface : public cvf::Object { -public: - enum PorosityModelResultType - { - MATRIX_RESULTS, - FRACTURE_RESULTS - }; - public: RifReaderInterface() { } virtual ~RifReaderInterface() { } @@ -64,8 +59,8 @@ public: virtual bool open(const QString& fileName, RigEclipseCaseData* eclipseCase) = 0; virtual void close() = 0; - virtual bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector* values) = 0; - virtual bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values) = 0; + virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) = 0; + virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) = 0; void setFilenamesWithFaults(const std::vector& filenames) { m_filenamesWithFaults = filenames; } std::vector filenamesWithFaults() { return m_filenamesWithFaults; } diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index ef25d6d9a0..a0b115800c 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -33,7 +33,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip m_reservoir = eclipseCase; - RigCaseCellResultsData* cellResults = eclipseCase->results(RifReaderInterface::MATRIX_RESULTS); + RigCaseCellResultsData* cellResults = eclipseCase->results(RiaDefines::MATRIX_MODEL); std::vector timeStepInfos; { @@ -113,7 +113,7 @@ bool RifReaderMockModel::inputProperty(const QString& propertyName, std::vector< //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderMockModel::staticResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, std::vector* values) +bool RifReaderMockModel::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) { m_reservoirBuilder.staticResult(m_reservoir, result, values); @@ -123,7 +123,7 @@ bool RifReaderMockModel::staticResult(const QString& result, RifReaderInterface: //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderMockModel::dynamicResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values) +bool RifReaderMockModel::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) { m_reservoirBuilder.dynamicResult(m_reservoir, result, stepIndex, values); diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.h b/ApplicationCode/FileInterface/RifReaderMockModel.h index 33f5204f5b..068cab7a6d 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.h +++ b/ApplicationCode/FileInterface/RifReaderMockModel.h @@ -39,8 +39,8 @@ public: virtual bool open( const QString& fileName, RigEclipseCaseData* eclipseCase ); virtual void close(); - virtual bool staticResult( const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, std::vector* values ); - virtual bool dynamicResult( const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values ); + virtual bool staticResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values ); + virtual bool dynamicResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ); private: void populateReservoir(RigEclipseCaseData* eclipseCase); diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp index a6051d74e2..bf605cf8a9 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp @@ -94,7 +94,6 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex) RimEclipseCellColors* cellResultColors = eclipseView->cellResult(); CVF_ASSERT(cellResultColors); - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel()); RigEclipseCaseData* eclipseCase = eclipseView->eclipseCase()->eclipseCaseData(); // CrossSections diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp index 0a5b25cf01..24222d837b 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp @@ -102,7 +102,6 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex) RimEclipseCellColors* cellResultColors = eclipseView->cellResult(); CVF_ASSERT(cellResultColors); - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel()); RigEclipseCaseData* eclipseCase = eclipseView->eclipseCase()->eclipseCaseData(); // CrossSections diff --git a/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp b/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp index a60f84bd71..c22cc08877 100644 --- a/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp +++ b/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp @@ -299,8 +299,6 @@ cvf::ref RivCellEdgeGeometryUtils::createCellEdgeResultAccess { cvf::ref cellEdgeResultAccessor = new RigCellEdgeResultAccessor(); - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel()); - if (cellEdgeResultColors->propertyType() == RimCellEdgeColors::ANY_SINGLE_PROPERTY) { cvf::ref daObj = RivCellEdgeGeometryUtils::createCellCenterResultAccessor(cellEdgeResultColors->singleVarEdgeResultColors(), timeStepIndex, eclipseCase, grid); @@ -327,6 +325,7 @@ cvf::ref RivCellEdgeGeometryUtils::createCellEdgeResultAccess adjustedTimeStep = 0; } + RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); cvf::ref daObj = RigResultAccessorFactory::createFromResultIdx(eclipseCase, grid->gridIndex(), porosityModel, adjustedTimeStep, resultIndices[cubeFaceIdx]); cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast(cubeFaceIdx), daObj.p()); } diff --git a/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp b/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp index 4efb3f420d..d6b94ad242 100644 --- a/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp @@ -105,7 +105,6 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell updateNNCColors(cellResultColors); - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel()); RimEclipseView* eclipseView = cellResultColors->reservoirView(); RigEclipseCaseData* eclipseCase = eclipseView->eclipseCase()->eclipseCaseData(); diff --git a/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp b/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp index 6f625ae6ea..b63e4fb155 100644 --- a/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp +++ b/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp @@ -55,7 +55,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0; - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel()); + RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); cvf::ref soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL"); cvf::ref sgas = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SGAS"); @@ -89,7 +89,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0; - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel()); + RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); size_t gridIndex = 0; cvf::ref soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL"); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp index 8b79214dd1..b13e1222dd 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp @@ -107,7 +107,7 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults() CVF_ASSERT(eclCase && eclCase->eclipseCaseData() ); - timeStepCount = eclCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(); + timeStepCount = eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(); } @@ -171,7 +171,7 @@ std::map > RimFlowDiagSolution::allTracerActiveCel { const cvf::Collection& wellResults = eclCase->eclipseCaseData()->wellResults(); RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid(); - RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); //Todo: Must come from the results definition + RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); //Todo: Must come from the results definition for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx ) { diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index e606cbea8d..88d747e6ea 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -209,7 +209,7 @@ void RimWellAllocationPlot::updateFromWell() { bool isProducer = ( wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::PRODUCER || wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ); - RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)); + RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)); wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords, pipeBranchesCellIds, tracerFractionCellValues, diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index f5a4e77742..7d554f61bb 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -346,8 +346,8 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView) { caseName = eclipseView->eclipseCase()->caseUserDescription(); totCellCount = QString::number(eclipseView->mainGrid()->globalCellArray().size()); - size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount(); - size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount(); + size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount(); + size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount(); if (frActCellCount > 0) activeCellCountText += "Matrix : "; activeCellCountText += QString::number(mxActCellCount); if (frActCellCount > 0) activeCellCountText += " Fracture : " + QString::number(frActCellCount); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index 8198713123..4e7cbdd6c2 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -380,7 +380,7 @@ void RimEclipseCase::computeCachedData() pInf.setNextProgressIncrement(17); pInf.setProgressDescription("Calculating faults"); - rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)); + rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)); pInf.incrementProgress(); pInf.setProgressDescription("Calculating Formation Names Result"); @@ -414,8 +414,8 @@ void RimEclipseCase::setReservoirData(RigEclipseCaseData* eclipseCase) m_rigEclipseCase = eclipseCase; if (this->eclipseCaseData()) { - m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)); - m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)); + m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)); + m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)); m_fractureModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid()); m_matrixModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid()); } @@ -478,9 +478,9 @@ void RimEclipseCase::createTimeStepFormatString() //-------------------------------------------------------------------------------------------------- cvf::BoundingBox RimEclipseCase::activeCellsBoundingBox() const { - if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)) + if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)) { - return m_rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->geometryBoundingBox(); + return m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)->geometryBoundingBox(); } else { @@ -521,9 +521,9 @@ cvf::Vec3d RimEclipseCase::displayModelOffset() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::PorosityModelResultType porosityModel) +RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel) { - if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults(); } @@ -534,9 +534,9 @@ RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::Poro //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::PorosityModelResultType porosityModel) const +const RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel) const { - if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults(); } @@ -592,7 +592,7 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->results(RifReaderInterface::MATRIX_RESULTS); + RimReservoirCellResultsStorage* results = this->results(RiaDefines::MATRIX_MODEL); if (results->cellResults()) { results->cellResults()->createPlaceholderResultEntries(); @@ -607,7 +607,7 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->results(RifReaderInterface::FRACTURE_RESULTS); + RimReservoirCellResultsStorage* results = this->results(RiaDefines::FRACTURE_MODEL); if (results->cellResults()) results->cellResults()->createPlaceholderResultEntries(); } @@ -636,7 +636,7 @@ QStringList RimEclipseCase::timeStepStrings() const { QStringList stringList; - int timeStepCount = static_cast(results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->maxTimeStepCount()); + int timeStepCount = static_cast(results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount()); for (int i = 0; i < timeStepCount; i++) { stringList += this->timeStepName(i); @@ -665,13 +665,13 @@ void RimEclipseCase::reloadDataAndUpdate() { if (this->eclipseCaseData()) { - RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS); + RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RiaDefines::MATRIX_MODEL); if (matrixModelResults) { matrixModelResults->clearAllResults(); } - RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS); + RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL); if (fractureModelResults) { fractureModelResults->clearAllResults(); @@ -738,5 +738,5 @@ double RimEclipseCase::characteristicCellSize() const //-------------------------------------------------------------------------------------------------- std::vector RimEclipseCase::timeStepDates() const { - return results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates(); + return results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepDates(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index 92dce6dee4..f0633a4293 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -73,8 +73,8 @@ public: const RigEclipseCaseData* eclipseCaseData() const; cvf::Color3f defaultWellColor(const QString& wellName); - RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel); - const RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel) const; + RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel); + const RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel) const; RimEclipseView* createAndAddReservoirView(); RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp index ae8410b0fc..3a71cb4472 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp @@ -171,7 +171,7 @@ RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection(RigEclipseCa // This is the first insertion of this grid, compute cached data rigEclipseCase->mainGrid()->computeCachedData(); - rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)); + rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)); equalGrid = rigEclipseCase->mainGrid(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp index 731e26c3d7..198eff4117 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp @@ -344,8 +344,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep) CVF_ASSERT(eclipseCase); if (!eclipseCase) return; - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(this->porosityModel()); - RigCaseCellResultsData* cellResultsData = eclipseCase->results(porosityModel); + RigCaseCellResultsData* cellResultsData = eclipseCase->results(this->porosityModel()); CVF_ASSERT(cellResultsData); double globalMin, globalMax; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp index 10e602ee4a..46d0e1ffb7 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp @@ -88,11 +88,11 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames) if (fileNames.contains(RiaDefines::mockModelBasicInputCase())) { cvf::ref readerInterface = this->createMockModel(fileNames[0]); - results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); - results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); - eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->computeDerivedData(); - eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->computeDerivedData(); + eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->computeDerivedData(); + eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->computeDerivedData(); QFileInfo gridFileName(fileNames[0]); QString caseName = gridFileName.completeBaseName(); @@ -206,8 +206,8 @@ bool RimEclipseInputCase::openEclipseGridFile() CVF_ASSERT(this->eclipseCaseData()); CVF_ASSERT(readerInterface.notNull()); - results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); - results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis); @@ -219,8 +219,8 @@ bool RimEclipseInputCase::openEclipseGridFile() RiaApplication* app = RiaApplication::instance(); if (app->preferences()->autocomputeDepthRelatedProperties) { - RimReservoirCellResultsStorage* matrixResults = results(RifReaderInterface::MATRIX_RESULTS); - RimReservoirCellResultsStorage* fractureResults = results(RifReaderInterface::FRACTURE_RESULTS); + RimReservoirCellResultsStorage* matrixResults = results(RiaDefines::MATRIX_MODEL); + RimReservoirCellResultsStorage* fractureResults = results(RiaDefines::FRACTURE_MODEL); matrixResults->computeDepthRelatedResults(); fractureResults->computeDepthRelatedResults(); @@ -318,7 +318,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties() for (const QString fileKeyword : fileKeywordSet) { { - QString resultName = this->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeyword); + QString resultName = this->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeyword); if (RifEclipseInputFileTools::readProperty(filenames[i], this->eclipseCaseData(), fileKeyword, resultName)) { RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp index d51206994b..6d9024ca68 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp @@ -91,7 +91,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change QString oldName = oldValue.toString(); QString newName = newValue.toString(); - RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS); + RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL); if (matrixResults) { if (matrixResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName)) @@ -100,7 +100,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change } } - RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS); + RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL); if (fracResults) { if (fracResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName)) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index 50710214d5..40d0250760 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -128,8 +128,8 @@ bool RimEclipseResultCase::openEclipseGridFile() this->setReservoirData( eclipseCase.p() ); } - results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); - results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); progInfo.incrementProgress(); @@ -188,7 +188,7 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl CVF_ASSERT(mainEclipseCase && mainEclipseCase->mainGrid()); eclipseCase->setMainGrid(mainEclipseCase->mainGrid()); - std::vector timeStepDates = mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(); + std::vector timeStepDates = mainEclipseCase->results(RiaDefines::MATRIX_MODEL)->timeStepDates(); if (timeStepDates.size() == 0) { return false; @@ -207,8 +207,8 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl readerInterface = readerEclipseOutput; } - results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); - results(RifReaderInterface::FRACTURE_RESULTS)->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()); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index aeeb4a6d4f..f64c6f4613 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -153,9 +153,7 @@ RimReservoirCellResultsStorage* RimEclipseResultDefinition::currentGridCellResul { if (!m_eclipseCase ) return nullptr; - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_porosityModel()); - - return m_eclipseCase->results(porosityModel); + return m_eclipseCase->results(m_porosityModel()); } //-------------------------------------------------------------------------------------------------- @@ -993,8 +991,8 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult() { if ( m_eclipseCase && m_eclipseCase->eclipseCaseData() - && m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS) - && m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount() > 0 ) + && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL) + && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 ) { return true; } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp index ed8a9308e5..6d0b188d88 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp @@ -159,8 +159,8 @@ bool RimEclipseStatisticsCase::openEclipseGridFile() eclipseCase->setMainGrid(mainGrid); - eclipseCase->setActiveCellInfo(RifReaderInterface::MATRIX_RESULTS, gridCaseGroup->unionOfActiveCells(RifReaderInterface::MATRIX_RESULTS)); - eclipseCase->setActiveCellInfo(RifReaderInterface::FRACTURE_RESULTS, gridCaseGroup->unionOfActiveCells(RifReaderInterface::FRACTURE_RESULTS)); + eclipseCase->setActiveCellInfo(RiaDefines::MATRIX_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::MATRIX_MODEL)); + eclipseCase->setActiveCellInfo(RiaDefines::FRACTURE_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::FRACTURE_MODEL)); this->setReservoirData( eclipseCase.p() ); @@ -218,15 +218,15 @@ void RimEclipseStatisticsCase::computeStatistics() getSourceCases(sourceCases); if (sourceCases.size() == 0 - || !sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS) - || !sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()) + || !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL) + || !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->cellResults()) { 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)->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->maxTimeStepCount(); + size_t timeStepCount = sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount(); RimStatisticsConfig statisticsConfig; @@ -248,42 +248,42 @@ void RimEclipseStatisticsCase::computeStatistics() for(size_t pIdx = 0; pIdx < m_selectedDynamicProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedStaticProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedGeneratedProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedInputProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureDynamicProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureStaticProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureGeneratedProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureInputProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx])); } RimEclipseStatisticsCaseEvaluator stat(sourceCases, timeStepIndices, statisticsConfig, resultCase, gridCaseGroup); @@ -420,42 +420,42 @@ QList RimEclipseStatisticsCase::calculateValueOptions(co if (&m_selectedDynamicProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); return toOptionList(varList); } else if (&m_selectedStaticProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); return toOptionList(varList); } else if (&m_selectedGeneratedProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::GENERATED); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::GENERATED); return toOptionList(varList); } else if (&m_selectedInputProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::INPUT_PROPERTY); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); return toOptionList(varList); } else if (&m_selectedFractureDynamicProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); return toOptionList(varList); } else if (&m_selectedFractureStaticProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); return toOptionList(varList); } else if (&m_selectedFractureGeneratedProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::GENERATED); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::GENERATED); return toOptionList(varList); } else if (&m_selectedFractureInputProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::INPUT_PROPERTY); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); return toOptionList(varList); } @@ -636,7 +636,7 @@ void RimEclipseStatisticsCase::updateSelectionListVisibilities() { bool isLocked = hasComputedStatistics(); m_resultType.uiCapability()->setUiHidden(isLocked); - m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS)->resultCount() + m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RiaDefines::FRACTURE_MODEL)->resultCount() m_selectedDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); m_selectedStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); @@ -668,8 +668,8 @@ void RimEclipseStatisticsCase::updatePercentileUiVisibility() bool RimEclipseStatisticsCase::hasComputedStatistics() const { if ( eclipseCaseData() - && ( eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->resultCount() - || eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)->resultCount())) + && ( eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->resultCount() + || eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->resultCount())) { return true; } @@ -707,14 +707,14 @@ void RimEclipseStatisticsCase::updateConnectedEditorsAndReservoirViews() //-------------------------------------------------------------------------------------------------- void RimEclipseStatisticsCase::clearComputedStatistics() { - if (eclipseCaseData() && eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)) + if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)) { - eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->clearAllResults(); + eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->clearAllResults(); } - if (eclipseCaseData() && eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)) + if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)) { - eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)->clearAllResults(); + eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->clearAllResults(); } updateConnectedEditorsAndReservoirViews(); @@ -750,28 +750,28 @@ void RimEclipseStatisticsCase::populateResultSelection() if (m_selectedDynamicProperties().size() == 0) { - QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); if (varList.contains("SOIL")) m_selectedDynamicProperties.v().push_back("SOIL"); if (varList.contains("PRESSURE")) m_selectedDynamicProperties.v().push_back("PRESSURE"); } if (m_selectedStaticProperties().size() == 0) { - QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); if (varList.contains("PERMX")) m_selectedStaticProperties.v().push_back("PERMX"); if (varList.contains("PORO")) m_selectedStaticProperties.v().push_back("PORO"); } if (m_selectedFractureDynamicProperties().size() == 0) { - QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); if (varList.contains("SOIL")) m_selectedFractureDynamicProperties.v().push_back("SOIL"); if (varList.contains("PRESSURE")) m_selectedFractureDynamicProperties.v().push_back("PRESSURE"); } if (m_selectedFractureStaticProperties().size() == 0) { - QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); if (varList.contains("PERMX")) m_selectedFractureStaticProperties.v().push_back("PERMX"); if (varList.contains("PORO")) m_selectedFractureStaticProperties.v().push_back("PORO"); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index ed5534ec2c..e7e0fc502b 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp @@ -43,7 +43,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]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepInfos(0); + std::vector sourceTimeStepInfos = m_sourceCases[0]->results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepInfos(0); size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true); CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T); @@ -81,7 +81,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& for (int i = 0; i < resultSpecification.size(); i++) { - RifReaderInterface::PorosityModelResultType poroModel = resultSpecification[i].m_poroModel; + RiaDefines::PorosityModelType poroModel = resultSpecification[i].m_poroModel; RiaDefines::ResultCatType resultType = resultSpecification[i].m_resType; QString resultName = resultSpecification[i].m_resVarName; @@ -132,7 +132,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& for (int resSpecIdx = 0; resSpecIdx < resultSpecification.size(); resSpecIdx++) { - RifReaderInterface::PorosityModelResultType poroModel = resultSpecification[resSpecIdx].m_poroModel; + RiaDefines::PorosityModelType poroModel = resultSpecification[resSpecIdx].m_poroModel; RiaDefines::ResultCatType resultType = resultSpecification[resSpecIdx].m_resType; QString resultName = resultSpecification[resSpecIdx].m_resVarName; @@ -300,13 +300,13 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& if (!eclipseCase->reservoirViews.size()) { - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->freeAllocatedResultsData(); - eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS)->cellResults()->freeAllocatedResultsData(); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->freeAllocatedResultsData(); + eclipseCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->freeAllocatedResultsData(); } // Todo : These calls really do nothing right now the access actually closes automatically in ert i belive ... - eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->readerInterface()->close(); - eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS)->readerInterface()->close(); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->readerInterface()->close(); + eclipseCase->results(RiaDefines::FRACTURE_MODEL)->readerInterface()->close(); } progressInfo.setProgress(timeIndicesIdx); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h index 7d35aee1a4..5241c33898 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h @@ -64,12 +64,12 @@ public: struct ResSpec { - ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RifReaderInterface::MATRIX_RESULTS) {} - ResSpec( RifReaderInterface::PorosityModelResultType poroModel, + ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RiaDefines::MATRIX_MODEL) {} + ResSpec( RiaDefines::PorosityModelType poroModel, RiaDefines::ResultCatType resType, QString resVarName) : m_poroModel(poroModel), m_resType(resType), m_resVarName(resVarName) {} - RifReaderInterface::PorosityModelResultType m_poroModel; + RiaDefines::PorosityModelType m_poroModel; RiaDefines::ResultCatType m_resType; QString m_resVarName; }; @@ -80,7 +80,7 @@ public: private: void addNamedResult(RigCaseCellResultsData* cellResults, RiaDefines::ResultCatType resultType, const QString& resultName, size_t activeCellCount); - void buildSourceMetaData(RifReaderInterface::PorosityModelResultType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName); + void buildSourceMetaData(RiaDefines::PorosityModelType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName); enum StatisticsParamType { MIN, MAX, SUM, RANGE, MEAN, STDEV, PMIN, PMID, PMAX, STAT_PARAM_COUNT }; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 84e0ef44cd..c0c84288a8 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -823,9 +823,7 @@ RimReservoirCellResultsStorage* RimEclipseView::currentGridCellResults() { if (m_eclipseCase) { - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult->porosityModel()); - - return m_eclipseCase->results(porosityModel); + return m_eclipseCase->results(cellResult->porosityModel()); } return NULL; @@ -840,9 +838,7 @@ RigActiveCellInfo* RimEclipseView::currentActiveCellInfo() m_eclipseCase->eclipseCaseData() ) { - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult->porosityModel()); - - return m_eclipseCase->eclipseCaseData()->activeCellInfo(porosityModel); + return m_eclipseCase->eclipseCaseData()->activeCellInfo(cellResult->porosityModel()); } return NULL; @@ -927,8 +923,7 @@ void RimEclipseView::updateLegends() RigEclipseCaseData* eclipseCase = m_eclipseCase->eclipseCaseData(); CVF_ASSERT(eclipseCase); - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel()); - RigCaseCellResultsData* results = eclipseCase->results(porosityModel); + RigCaseCellResultsData* results = eclipseCase->results(cellResult()->porosityModel()); CVF_ASSERT(results); updateMinMaxValuesAndAddLegendToView(QString("Cell Results: \n"), this->cellResult(), results); diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index a67e319e8d..575e19269e 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -184,7 +184,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RigEclipseCaseData* rigCaseData = mainCase->eclipseCaseData(); CVF_ASSERT(rigCaseData); - RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; mainCase->results(poroModel)->cellResults()->createPlaceholderResultEntries(); @@ -217,8 +217,8 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RimEclipseCase* rimReservoir = statisticsCaseCollection()->reservoirs[i]; // Check if any results are stored in cache - if (rimReservoir->results(RifReaderInterface::MATRIX_RESULTS)->storedResultsCount() > 0 || - rimReservoir->results(RifReaderInterface::FRACTURE_RESULTS)->storedResultsCount() > 0) + if (rimReservoir->results(RiaDefines::MATRIX_MODEL)->storedResultsCount() > 0 || + rimReservoir->results(RiaDefines::FRACTURE_MODEL)->storedResultsCount() > 0) { foundResultsInCache = true; break; @@ -236,7 +236,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() // for all cases { - RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; std::vector timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0); @@ -330,7 +330,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells() if (activeM[gridLocalCellIndex] == 0) { - if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->isActive(reservoirCellIndex)) + if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->isActive(reservoirCellIndex)) { activeM[gridLocalCellIndex] = 1; } @@ -338,7 +338,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells() if (activeF[gridLocalCellIndex] == 0) { - if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->isActive(reservoirCellIndex)) + if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->isActive(reservoirCellIndex)) { activeF[gridLocalCellIndex] = 1; } @@ -422,13 +422,13 @@ void RimIdenticalGridCaseGroup::clearStatisticsResults() RimEclipseCase* rimStaticsCase = statisticsCaseCollection->reservoirs[i]; if (!rimStaticsCase) continue; - if (rimStaticsCase->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()) + if (rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults()) { - rimStaticsCase->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->clearAllResults(); } - if (rimStaticsCase->results(RifReaderInterface::FRACTURE_RESULTS)->cellResults()) + if (rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()) { - rimStaticsCase->results(RifReaderInterface::FRACTURE_RESULTS)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->clearAllResults(); } for (size_t j = 0; j < rimStaticsCase->reservoirViews.size(); j++) @@ -472,9 +472,9 @@ bool RimIdenticalGridCaseGroup::contains(RimEclipseCase* reservoir) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RifReaderInterface::PorosityModelResultType porosityType) +RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RiaDefines::PorosityModelType porosityType) { - if (porosityType == RifReaderInterface::MATRIX_RESULTS) + if (porosityType == RiaDefines::MATRIX_MODEL) { return m_unionOfMatrixActiveCells.p(); } diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h index 068ac935de..2486729a64 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h @@ -68,7 +68,7 @@ public: RigMainGrid* mainGrid(); - RigActiveCellInfo* unionOfActiveCells(RifReaderInterface::PorosityModelResultType porosityType); + RigActiveCellInfo* unionOfActiveCells(RiaDefines::PorosityModelType porosityType); void computeUnionOfActiveCells(); static bool isStatisticsCaseCollection(RimCaseCollection* rimCaseCollection); diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 051ddd7e66..5ac2627b90 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -391,7 +391,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result for (i = 0; i < timeStepCount; i++) { std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[i]; - if (!m_readerInterface->dynamicResult(resultName, RifReaderInterface::MATRIX_RESULTS, i, &values)) + if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, i, &values)) { resultLoadingSucess = false; } @@ -402,7 +402,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result m_cellResults->cellScalarResults(scalarResultIndex).resize(1); std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[0]; - if (!m_readerInterface->staticResult(resultName, RifReaderInterface::MATRIX_RESULTS, &values)) + if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) { resultLoadingSucess = false; } @@ -472,7 +472,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[timeStepIndex]; if (values.size() == 0) { - if (!m_readerInterface->dynamicResult(resultName, RifReaderInterface::MATRIX_RESULTS, timeStepIndex, &values)) + if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, timeStepIndex, &values)) { resultLoadingSucess = false; } @@ -483,7 +483,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi m_cellResults->cellScalarResults(scalarResultIndex).resize(1); std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[0]; - if (!m_readerInterface->staticResult(resultName, RifReaderInterface::MATRIX_RESULTS, &values)) + if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) { resultLoadingSucess = false; } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index fd3cdb4ea8..0bf47f0ba3 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -721,10 +721,9 @@ QString RimWellLogExtractionCurve::createCurveAutoName() if (eclipseCase) { - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel()); if (eclipseCase->eclipseCaseData()) { - maxTimeStep = eclipseCase->eclipseCaseData()->results(porosityModel)->maxTimeStepCount(); + maxTimeStep = eclipseCase->eclipseCaseData()->results(m_eclipseResultDefinition->porosityModel())->maxTimeStepCount(); } } else if (geomCase) @@ -826,7 +825,6 @@ QString RimWellLogExtractionCurve::wellDate() const if (eclipseCase) { - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel()); if (eclipseCase->eclipseCaseData()) { timeStepNames = eclipseCase->timeStepStrings(); diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 5a76ad747a..37cea7aecb 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -597,16 +597,6 @@ size_t RigCaseCellResultsData::addStaticScalarResult(RiaDefines::ResultCatType t return resultIdx; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RifReaderInterface::PorosityModelResultType RigCaseCellResultsData::convertFromProjectModelPorosityModel(RiaDefines::PorosityModelType porosityModel) -{ - if (porosityModel == RiaDefines::MATRIX_MODEL) return RifReaderInterface::MATRIX_RESULTS; - - return RifReaderInterface::FRACTURE_RESULTS; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index 58c7c2621d..257efa26b6 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -106,8 +106,6 @@ public: std::vector< std::vector > & cellScalarResults(size_t scalarResultIndex); std::vector& cellScalarResults(size_t scalarResultIndex, size_t timeStepIndex); - static RifReaderInterface::PorosityModelResultType convertFromProjectModelPorosityModel(RiaDefines::PorosityModelType porosityModel); - bool updateResultName(RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName); public: diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp index 909c54b241..6b13d56e89 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp @@ -434,9 +434,9 @@ void RigEclipseCaseData::computeActiveCellBoundingBoxes() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel) +RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) { - if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_activeCellInfo.p(); } @@ -447,9 +447,9 @@ RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface::Porosi //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel) const +const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) const { - if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_activeCellInfo.p(); } @@ -460,9 +460,9 @@ const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface:: //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigEclipseCaseData::setActiveCellInfo(RifReaderInterface::PorosityModelResultType porosityModel, RigActiveCellInfo* activeCellInfo) +void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo) { - if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + if (porosityModel == RiaDefines::MATRIX_MODEL) { m_activeCellInfo = activeCellInfo; m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p()); @@ -604,9 +604,9 @@ RigFormationNames* RigEclipseCaseData::activeFormationNames() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigCaseCellResultsData* RigEclipseCaseData::results(RifReaderInterface::PorosityModelResultType porosityModel) +RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) { - if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults.p(); } @@ -617,9 +617,9 @@ RigCaseCellResultsData* RigEclipseCaseData::results(RifReaderInterface::Porosity //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigCaseCellResultsData* RigEclipseCaseData::results(RifReaderInterface::PorosityModelResultType porosityModel) const +const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) const { - if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults.p(); } diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h index 519985ee6d..3ab5199d2e 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h +++ b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h @@ -64,12 +64,12 @@ public: RigGridBase* grid(size_t index); size_t gridCount() const; - RigCaseCellResultsData* results(RifReaderInterface::PorosityModelResultType porosityModel); - const RigCaseCellResultsData* results(RifReaderInterface::PorosityModelResultType porosityModel) const; + RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel); + const RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel) const; - RigActiveCellInfo* activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel); - const RigActiveCellInfo* activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel) const; - void setActiveCellInfo(RifReaderInterface::PorosityModelResultType porosityModel, RigActiveCellInfo* activeCellInfo); + RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel); + const RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel) const; + void setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo); void setActiveFormationNames(RigFormationNames* activeFormationNames); RigFormationNames* activeFormationNames(); diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index e8f500c436..c212dd2ee1 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -70,7 +70,7 @@ const RigActiveCellInfo * RigFlowDiagResults::activeCellInfo(const RigFlowDiagRe RimEclipseResultCase* eclCase; m_flowDiagSolution->firstAncestorOrThisOfType(eclCase); - return eclCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); // Todo: base on resVarAddr member + return eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); // Todo: base on resVarAddr member } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 3d74d710d6..edff3fc51c 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -158,7 +158,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI { using namespace Opm::FlowDiagnostics; - RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount()); + RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount()); caf::ProgressInfo progressInfo(8, "Calculating Flow Diagnostics"); @@ -206,7 +206,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI QStringList restartFileNames = RifEclipseOutputFileTools::filterFileNamesOfType(m_filesWithSameBaseName, ECL_RESTART_FILE); size_t restartFileCount = static_cast(restartFileNames.size()); - size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(); + size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(); if (restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount ) { @@ -241,9 +241,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI CVF_ASSERT(currentRestartData); size_t resultIndexWithMaxTimeSteps = cvf::UNDEFINED_SIZE_T; - m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&resultIndexWithMaxTimeSteps); + m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&resultIndexWithMaxTimeSteps); - int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex); + int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex); if ( !currentRestartData->selectReportStep(reportStepNumber) ) { @@ -256,7 +256,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI Opm::FlowDiagnostics::CellSetValues sumWellFluxPrCell; { - if (m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes()) + if (m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->hasFlowDiagUsableFluxes()) { Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph), *currentRestartData, diff --git a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp index e928da4c44..1b5808ac81 100644 --- a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp +++ b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp @@ -250,7 +250,7 @@ void RigReservoirBuilderMock::populateReservoir(RigEclipseCaseData* eclipseCase) addFaults(eclipseCase); // Set all cells active - RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); + RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); activeCellInfo->setReservoirCellCount(eclipseCase->mainGrid()->globalCellArray().size()); for (size_t i = 0; i < eclipseCase->mainGrid()->globalCellArray().size(); i++) { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp index fb8ccd79be..eb21009d76 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp @@ -41,7 +41,7 @@ //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName) { @@ -134,7 +134,7 @@ cvf::ref RigResultAccessorFactory::createFromUiResultName(Rig //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromNameAndType(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName, RiaDefines::ResultCatType resultType) @@ -172,8 +172,6 @@ cvf::ref RigResultAccessorFactory::createFromResultDefinition size_t timeStepIndex, RimEclipseResultDefinition* resultDefinition) { - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultDefinition->porosityModel()); - if (resultDefinition->resultType() != RiaDefines::FLOW_DIAGNOSTICS) { @@ -185,7 +183,7 @@ cvf::ref RigResultAccessorFactory::createFromResultDefinition return RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, - porosityModel, + resultDefinition->porosityModel(), adjustedTimeStepIndex, resultDefinition->resultVariable()); } @@ -200,7 +198,7 @@ cvf::ref RigResultAccessorFactory::createFromResultDefinition RigGridBase* grid = eclipseCase->grid(gridIndex); if ( !grid ) return new RigHugeValResultAccessor; - cvf::ref object = new RigActiveCellsResultAccessor(grid, resultValues, eclipseCase->activeCellInfo(porosityModel)); + cvf::ref object = new RigActiveCellsResultAccessor(grid, resultValues, eclipseCase->activeCellInfo(resultDefinition->porosityModel())); return object; } @@ -211,7 +209,7 @@ cvf::ref RigResultAccessorFactory::createFromResultDefinition //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createNativeFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName) { @@ -239,7 +237,7 @@ cvf::ref RigResultAccessorFactory::createNativeFromUiResultNa //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromResultIdx(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t resultIndex) { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h index a0e034bf6c..ec87df1206 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h @@ -41,14 +41,14 @@ public: static cvf::ref createFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName); static cvf::ref createFromNameAndType(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName, RiaDefines::ResultCatType resultType); @@ -56,7 +56,7 @@ public: static cvf::ref createFromResultIdx(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t resultIndex); @@ -64,7 +64,7 @@ private: static cvf::ref createNativeFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& resultName); diff --git a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp index 0515009f7f..ba772a5837 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp @@ -31,7 +31,7 @@ //-------------------------------------------------------------------------------------------------- cvf::ref RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, QString& uiResultName) { @@ -53,7 +53,7 @@ cvf::ref RigResultModifierFactory::createResultModifier(RigEc //-------------------------------------------------------------------------------------------------- cvf::ref RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t scalarResultIndex) { if ( !eclipseCase ) return NULL; diff --git a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h index 61b36d3425..9de9a938c1 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h +++ b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h @@ -30,14 +30,14 @@ public: static cvf::ref createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, QString& uiResultName); static cvf::ref createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RifReaderInterface::PorosityModelResultType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t scalarResultIndex); }; diff --git a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp index 3d998de20c..1dc871fa6f 100644 --- a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp @@ -95,14 +95,14 @@ public: RimEclipseCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args); if (!rimCase) return true; - RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL; if (args.size() > 2) { QString prorosityModelString = args[2]; if (prorosityModelString.toUpper() == "FRACTURE") { - porosityModel = RifReaderInterface::FRACTURE_RESULTS; + porosityModel = RiaDefines::FRACTURE_MODEL; } } @@ -144,7 +144,7 @@ public: return true; } - static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RifReaderInterface::PorosityModelResultType porosityModel, std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK, std::vector& globalCoarseningBoxIdx) + static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RiaDefines::PorosityModelType porosityModel, std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK, std::vector& globalCoarseningBoxIdx) { gridNumber.clear(); cellI.clear(); @@ -412,7 +412,7 @@ public: size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; if (rimCase && rimCase->eclipseCaseData()) { - rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); + rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T) { canFetchData = false; @@ -431,7 +431,7 @@ public: return true; } - std::vector timeStepDates = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(scalarIndexWithMaxTimeStepCount); + std::vector timeStepDates = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->timeStepDates(scalarIndexWithMaxTimeStepCount); quint64 timeStepCount = timeStepDates.size(); quint64 byteCount = sizeof(quint64) + 6 * timeStepCount * sizeof(qint32); @@ -499,7 +499,7 @@ public: size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; if (rimCase && rimCase->eclipseCaseData()) { - rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); + rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T) { canFetchData = false; @@ -518,7 +518,7 @@ public: return true; } - std::vector daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount); + std::vector daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount); quint64 timeStepCount = daysSinceSimulationStart.size(); quint64 byteCount = sizeof(quint64) + timeStepCount * sizeof(qint32); diff --git a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp index 096b41332a..6c25948d58 100644 --- a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp @@ -165,10 +165,10 @@ public: QString porosityModelName; porosityModelName = args[2]; - RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName.toUpper() == "FRACTURE") { - porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } if (!rimCase || !rimCase->eclipseCaseData()) @@ -336,10 +336,10 @@ public: QString porosityModelName; porosityModelName = args[2]; - RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName.toUpper() == "FRACTURE") { - porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } if (!rimCase || !rimCase->eclipseCaseData() ) diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index e3170f6a6b..383013f1c6 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -60,10 +60,10 @@ public: QString propertyName = args[2]; QString porosityModelName = args[3]; - RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } // Find the requested data @@ -233,10 +233,10 @@ public: return true; } - RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; @@ -383,7 +383,7 @@ public: m_bytesPerTimeStepToRead(0), m_currentTimeStepNumberToRead(0), m_invalidActiveCellCountDetected(false), - m_porosityModelEnum(RifReaderInterface::MATRIX_RESULTS) + m_porosityModelEnum(RiaDefines::MATRIX_MODEL) {} static QString commandName () { return QString("SetActiveCellProperty"); } @@ -397,7 +397,7 @@ public: if (porosityModelName == "Fracture") { - m_porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; + m_porosityModelEnum = RiaDefines::FRACTURE_MODEL; } // Find the requested data, Or create a set if we are setting data and it is not found @@ -697,7 +697,7 @@ private: size_t m_currentScalarIndex; QString m_currentPropertyName; std::vector m_requestedTimesteps; - RifReaderInterface::PorosityModelResultType m_porosityModelEnum; + RiaDefines::PorosityModelType m_porosityModelEnum; quint64 m_timeStepCountToRead; quint64 m_bytesPerTimeStepToRead; @@ -724,7 +724,7 @@ public: m_bytesPerTimeStepToRead(0), m_currentTimeStepNumberToRead(0), m_invalidDataDetected(false), - m_porosityModelEnum(RifReaderInterface::MATRIX_RESULTS) + m_porosityModelEnum(RiaDefines::MATRIX_MODEL) {} static QString commandName () { return QString("SetGridProperty"); } @@ -746,7 +746,7 @@ public: if (porosityModelName == "Fracture") { - m_porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; + m_porosityModelEnum = RiaDefines::FRACTURE_MODEL; } RigGridBase* grid = rimCase->eclipseCaseData()->grid(m_currentGridIndex); @@ -1061,7 +1061,7 @@ private: size_t m_currentScalarIndex; QString m_currentPropertyName; std::vector m_requestedTimesteps; - RifReaderInterface::PorosityModelResultType m_porosityModelEnum; + RiaDefines::PorosityModelType m_porosityModelEnum; quint64 m_timeStepCountToRead; quint64 m_bytesPerTimeStepToRead; @@ -1092,11 +1092,11 @@ public: } QString porosityModelName = args[2]; - RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } std::vector propNames; diff --git a/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp b/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp index 7b1a14da6b..3a50dd2172 100644 --- a/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp +++ b/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp @@ -260,7 +260,7 @@ TEST(RigReservoirTest, UnifiedTestFile) -void buildResultInfoString(RigReservoir* reservoir, RifReaderInterface::PorosityModelResultType porosityModel, RiaDefines::ResultCatType resultType) +void buildResultInfoString(RigReservoir* reservoir, RiaDefines::PorosityModelType porosityModel, RiaDefines::ResultCatType resultType) { RigCaseCellResultsData* matrixResults = reservoir->results(porosityModel); { @@ -302,22 +302,22 @@ TEST(RigReservoirTest, DualPorosityTest) qDebug() << "\n\n" << "Matrix porosities, DYNAMIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RifReaderInterface::MATRIX_RESULTS, RiaDefines::DYNAMIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE); qDebug() << "\n\n" << "Matrix porosities, STATIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RifReaderInterface::MATRIX_RESULTS, RiaDefines::STATIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE); qDebug() << "\n\n" << "Fracture porosities, DYNAMIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RifReaderInterface::FRACTURE_RESULTS, RiaDefines::DYNAMIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE); qDebug() << "\n\n" << "Fracture porosities, STATIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RifReaderInterface::FRACTURE_RESULTS, RiaDefines::STATIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE); } diff --git a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp index af72cc90c4..bc8620360b 100644 --- a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp +++ b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp @@ -374,7 +374,7 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigEclipseCaseData* eclips return; } - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultColors->porosityModel()); + RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel(); if (resultColors->isTernarySaturationSelected()) { RimReservoirCellResultsStorage* gridCellResults = resultColors->currentGridCellResults(); @@ -407,8 +407,6 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigEclipseCaseData* eclips } else if (resultColors->hasResult()) { - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultColors->porosityModel()); - if (resultColors->hasStaticResult()) { if (resultColors->resultVariable().compare(RiaDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0) @@ -539,7 +537,7 @@ QString RiuResultTextBuilder::cellEdgeResultDetails() adjustedTimeStep = 0; } - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_reservoirView->cellResult()->porosityModel()); + RiaDefines::PorosityModelType porosityModel = m_reservoirView->cellResult()->porosityModel(); cvf::ref resultAccessor = RigResultAccessorFactory::createFromResultIdx(m_reservoirView->eclipseCase()->eclipseCaseData(), m_gridIndex, porosityModel, adjustedTimeStep, resultIndex); if (resultAccessor.notNull()) { @@ -666,7 +664,7 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors) size_t sgasScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); size_t swatScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultColors->porosityModel()); + RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel(); cvf::ref dataAccessObjectX = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, soilScalarSetIndex); cvf::ref dataAccessObjectY = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, sgasScalarSetIndex); diff --git a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp index 11ad19921e..b1271ccf50 100644 --- a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp +++ b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp @@ -113,7 +113,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData()) { - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(eclipseView->cellResult()->porosityModel()); + RiaDefines::PorosityModelType porosityModel = eclipseView->cellResult()->porosityModel(); std::vector timeStepDates = eclipseView->eclipseCase()->eclipseCaseData()->results(porosityModel)->timeStepDates(); From 56afc497b3ac52382b3d6adbc5461b0c5487b15f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 10:24:35 +0200 Subject: [PATCH 27/36] Add missing includes --- .../ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp | 2 ++ .../ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp | 1 + ApplicationCode/ProjectDataModel/RimView.cpp | 2 ++ 3 files changed, 5 insertions(+) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp index a3fc23a568..1a25c08d6e 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp @@ -28,6 +28,8 @@ #include "cafPdmUiCheckBoxEditor.h" +#include + #include // Needed for HUGE_VAL on Linux diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index e7e0fc502b..ab1560c7fa 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp @@ -24,6 +24,7 @@ #include "RigEclipseCaseData.h" #include "RigMainGrid.h" #include "RigResultAccessorFactory.h" +#include "RigResultInfo.h" #include "RigResultModifier.h" #include "RigResultModifierFactory.h" #include "RigStatisticsMath.h" diff --git a/ApplicationCode/ProjectDataModel/RimView.cpp b/ApplicationCode/ProjectDataModel/RimView.cpp index dcc035e3ed..671f29481c 100644 --- a/ApplicationCode/ProjectDataModel/RimView.cpp +++ b/ApplicationCode/ProjectDataModel/RimView.cpp @@ -51,6 +51,8 @@ #include "cvfScene.h" #include "cvfViewport.h" +#include + #include #include "cvfTransform.h" From c4aa625d33421e277a73f8e66c8db3a1c2e9f89e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 10:25:33 +0200 Subject: [PATCH 28/36] #1755 Move porosity model enum to separate file --- .../Application/CMakeLists_files.cmake | 2 + .../Application/RiaApplication.cpp | 1 - ApplicationCode/Application/RiaDefines.cpp | 9 --- ApplicationCode/Application/RiaDefines.h | 6 -- .../Application/RiaPorosityModel.cpp | 31 +++++++ .../Application/RiaPorosityModel.h | 32 ++++++++ ...sTransmissibilityCalculationFeatureImp.cpp | 2 +- ...RicWellPathExportCompletionDataFeature.cpp | 62 +++++++------- .../ExportCommands/RicCellRangeUi.cpp | 2 +- .../ExportCommands/RicExportFaultsFeature.cpp | 1 - .../RifEclipseInputFileTools.cpp | 14 ++-- .../FileInterface/RifReaderEclipseInput.h | 4 +- .../FileInterface/RifReaderEclipseOutput.cpp | 58 +++++++------- .../FileInterface/RifReaderEclipseOutput.h | 8 +- .../FileInterface/RifReaderInterface.h | 6 +- .../FileInterface/RifReaderMockModel.cpp | 6 +- .../FileInterface/RifReaderMockModel.h | 4 +- .../RivCellEdgeGeometryUtils.cpp | 2 +- .../RivTernaryTextureCoordsCreator.cpp | 4 +- .../Flow/RimFlowDiagSolution.cpp | 4 +- .../Flow/RimWellAllocationPlot.cpp | 2 +- .../Rim3dOverlayInfoConfig.cpp | 4 +- .../ProjectDataModel/RimEclipseCase.cpp | 30 +++---- .../ProjectDataModel/RimEclipseCase.h | 6 +- .../RimEclipseCaseCollection.cpp | 2 +- .../ProjectDataModel/RimEclipseInputCase.cpp | 18 ++--- .../RimEclipseInputProperty.cpp | 4 +- .../ProjectDataModel/RimEclipseResultCase.cpp | 10 +-- .../RimEclipseResultDefinition.cpp | 6 +- .../RimEclipseResultDefinition.h | 9 ++- .../RimEclipseStatisticsCase.cpp | 80 +++++++++---------- .../RimEclipseStatisticsCase.h | 2 +- .../RimEclipseStatisticsCaseEvaluator.cpp | 14 ++-- .../RimEclipseStatisticsCaseEvaluator.h | 8 +- .../RimIdenticalGridCaseGroup.cpp | 24 +++--- .../RimIdenticalGridCaseGroup.h | 2 +- .../RimReservoirCellResultsStorage.cpp | 8 +- .../ReservoirDataModel/RigEclipseCaseData.cpp | 20 ++--- .../ReservoirDataModel/RigEclipseCaseData.h | 10 +-- .../ReservoirDataModel/RigFlowDiagResults.cpp | 2 +- .../RigFlowDiagSolverInterface.cpp | 10 +-- .../RigReservoirBuilderMock.cpp | 2 +- .../RigResultAccessorFactory.cpp | 8 +- .../RigResultAccessorFactory.h | 8 +- .../RigResultModifierFactory.cpp | 4 +- .../RigResultModifierFactory.h | 4 +- .../SocketInterface/RiaCaseInfoCommands.cpp | 14 ++-- .../SocketInterface/RiaGeometryCommands.cpp | 8 +- .../RiaPropertyDataCommands.cpp | 24 +++--- .../UnitTests/RifReaderEclipseOutput-Test.cpp | 10 +-- .../UserInterface/RiuResultTextBuilder.cpp | 6 +- .../RiuSelectionChangedHandler.cpp | 2 +- 52 files changed, 334 insertions(+), 285 deletions(-) create mode 100644 ApplicationCode/Application/RiaPorosityModel.cpp create mode 100644 ApplicationCode/Application/RiaPorosityModel.h diff --git a/ApplicationCode/Application/CMakeLists_files.cmake b/ApplicationCode/Application/CMakeLists_files.cmake index 47cbcb4ec5..9274ba491c 100644 --- a/ApplicationCode/Application/CMakeLists_files.cmake +++ b/ApplicationCode/Application/CMakeLists_files.cmake @@ -8,6 +8,7 @@ set (SOURCE_GROUP_HEADER_FILES ${CEE_CURRENT_LIST_DIR}RiaApplication.h ${CEE_CURRENT_LIST_DIR}RiaDefines.h ${CEE_CURRENT_LIST_DIR}RiaPreferences.h +${CEE_CURRENT_LIST_DIR}RiaPorosityModel.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -15,6 +16,7 @@ ${CEE_CURRENT_LIST_DIR}RiaApplication.cpp ${CEE_CURRENT_LIST_DIR}RiaDefines.cpp ${CEE_CURRENT_LIST_DIR}RiaMain.cpp ${CEE_CURRENT_LIST_DIR}RiaPreferences.cpp +${CEE_CURRENT_LIST_DIR}RiaPorosityModel.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 34f2d99b29..ec43cdc6d3 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -36,7 +36,6 @@ #include "RimCellEdgeColors.h" #include "RimCellRangeFilterCollection.h" #include "RimCommandObject.h" -#include "RiaDefines.h" #include "RimEclipseCaseCollection.h" #include "RimEclipseCellColors.h" #include "RimEclipseFaultColors.h" diff --git a/ApplicationCode/Application/RiaDefines.cpp b/ApplicationCode/Application/RiaDefines.cpp index 65b29bf2af..2b459efac8 100644 --- a/ApplicationCode/Application/RiaDefines.cpp +++ b/ApplicationCode/Application/RiaDefines.cpp @@ -36,15 +36,6 @@ namespace caf setDefault(RiaDefines::DYNAMIC_NATIVE); } - template<> - void caf::AppEnum< RiaDefines::PorosityModelType >::setUp() - { - addItem(RiaDefines::MATRIX_MODEL, "MATRIX_MODEL", "Matrix"); - addItem(RiaDefines::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture"); - - setDefault(RiaDefines::MATRIX_MODEL); - } - template<> void caf::AppEnum< RiaDefines::DepthUnitType >::setUp() { diff --git a/ApplicationCode/Application/RiaDefines.h b/ApplicationCode/Application/RiaDefines.h index 734d09e99b..0b86276ac6 100644 --- a/ApplicationCode/Application/RiaDefines.h +++ b/ApplicationCode/Application/RiaDefines.h @@ -37,12 +37,6 @@ public: REMOVED }; - enum PorosityModelType - { - MATRIX_MODEL, - FRACTURE_MODEL - }; - enum CompletionType { WELL_PATH, PERFORATION_INTERVAL, diff --git a/ApplicationCode/Application/RiaPorosityModel.cpp b/ApplicationCode/Application/RiaPorosityModel.cpp new file mode 100644 index 0000000000..610d02a835 --- /dev/null +++ b/ApplicationCode/Application/RiaPorosityModel.cpp @@ -0,0 +1,31 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RiaPorosityModel.h" + +#include "cafAppEnum.h" + + +template<> +void caf::AppEnum< RiaPorosityModel::PorosityModelType >::setUp() +{ + addItem(RiaPorosityModel::MATRIX_MODEL, "MATRIX_MODEL", "Matrix"); + addItem(RiaPorosityModel::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture"); + + setDefault(RiaPorosityModel::MATRIX_MODEL); +} diff --git a/ApplicationCode/Application/RiaPorosityModel.h b/ApplicationCode/Application/RiaPorosityModel.h new file mode 100644 index 0000000000..8fa306361a --- /dev/null +++ b/ApplicationCode/Application/RiaPorosityModel.h @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +class RiaPorosityModel +{ +public: + enum PorosityModelType + { + MATRIX_MODEL, + FRACTURE_MODEL + }; +}; diff --git a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp index dea68d097b..1c4674e68e 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp @@ -86,7 +86,7 @@ std::vector RicFishbonesTransmissibilityCalculationFeatureImp std::vector completionData; RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); - const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); + const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); for (auto cellAndWellBoreParts : wellBorePartsInCells) { diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index 0485391835..0fcfd33059 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -582,7 +582,7 @@ std::vector RicWellPathExportCompletionDataFeature::generateP RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType(); std::vector completionData; - const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); + const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); for (const RimPerforationInterval* interval : wellPath->perforationIntervalCollection()->perforations()) @@ -813,12 +813,12 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DY"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DZ"); double xLengthFraction = abs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex)); double yLengthFraction = abs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex)); @@ -852,19 +852,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DY"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DZ"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); - cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); - cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); - cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMX"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMY"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); + cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMZ"); double dx = dxAccessObject->cellScalarGlobIdx(cellIndex); double dy = dyAccessObject->cellScalarGlobIdx(cellIndex); @@ -901,19 +901,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclips { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DY"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DZ"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); - cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); - cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); - eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); - cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMX"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMY"); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); + cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMZ"); double dx = dxAccessObject->cellScalarGlobIdx(cellIndex); double dy = dyAccessObject->cellScalarGlobIdx(cellIndex); diff --git a/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp b/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp index 3c74619381..8770ad6a87 100644 --- a/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp @@ -260,7 +260,7 @@ RigActiveCellInfo* RicCellRangeUi::activeCellInfo() const RimEclipseCase* rimEclipeCase = dynamic_cast(m_case()); if (rimEclipeCase && rimEclipeCase->eclipseCaseData()) { - return rimEclipeCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); + return rimEclipeCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); } return nullptr; diff --git a/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp index 80eef8e469..c179a8de3e 100644 --- a/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp @@ -25,7 +25,6 @@ #include "RigFault.h" #include "RigMainGrid.h" -#include "RiaDefines.h" #include "RimEclipseCase.h" #include "RimFault.h" diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp index 2f12dbf6a7..38b22dfbc2 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp @@ -231,7 +231,7 @@ std::map RifEclipseInputFileTools::readProperties(const QStrin ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ecl_type_create_from_type(ECL_FLOAT_TYPE)); if (eclipseKeywordData) { - QString newResultName = caseData->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeywords[i].keyword); + QString newResultName = caseData->results(RiaPorosityModel::MATRIX_MODEL)->makeResultNameUnique(fileKeywords[i].keyword); if (readDataFromKeyword(eclipseKeywordData, caseData, newResultName)) { newResults[newResultName] = fileKeywords[i].keyword; @@ -290,7 +290,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa { mathingItemCount = true; } - if (itemCount == caseData->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount()) + if (itemCount == caseData->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->reservoirActiveCellCount()) { mathingItemCount = true; } @@ -301,7 +301,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa size_t resultIndex = RifEclipseInputFileTools::findOrCreateResult(resultName, caseData); if (resultIndex == cvf::UNDEFINED_SIZE_T) return false; - std::vector< std::vector >& newPropertyData = caseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex); + std::vector< std::vector >& newPropertyData = caseData->results(RiaPorosityModel::MATRIX_MODEL)->cellScalarResults(resultIndex); newPropertyData.push_back(std::vector()); newPropertyData[0].resize(ecl_kw_get_size(eclipseKeywordData), HUGE_VAL); ecl_kw_get_data_as_double(eclipseKeywordData, newPropertyData[0].data()); @@ -446,7 +446,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, { CVF_ASSERT(eclipseCase); - size_t resultIndex = eclipseCase->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(resultName); + size_t resultIndex = eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findScalarResultIndex(resultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { return false; @@ -458,7 +458,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, return false; } - std::vector< std::vector >& resultData = eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex); + std::vector< std::vector >& resultData = eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->cellScalarResults(resultIndex); if (resultData.size() == 0) { return false; @@ -717,10 +717,10 @@ qint64 RifEclipseInputFileTools::findKeyword(const QString& keyword, QFile& file //-------------------------------------------------------------------------------------------------- size_t RifEclipseInputFileTools::findOrCreateResult(const QString& newResultName, RigEclipseCaseData* reservoir) { - size_t resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(newResultName); + size_t resultIndex = reservoir->results(RiaPorosityModel::MATRIX_MODEL)->findScalarResultIndex(newResultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { - resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false); + resultIndex = reservoir->results(RiaPorosityModel::MATRIX_MODEL)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false); } return resultIndex; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseInput.h b/ApplicationCode/FileInterface/RifReaderEclipseInput.h index cb192ba496..db9862b196 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseInput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseInput.h @@ -38,6 +38,6 @@ public: virtual void close() {} - virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values ) { return false; } - virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ) { return false; } + virtual bool staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values ) { return false; } + virtual bool dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ) { return false; } }; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 12eeec27a5..7a96bedd75 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -242,8 +242,8 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid, return false; } - RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); - RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); + RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); + RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL); CVF_ASSERT(activeCellInfo && fractureActiveCellInfo); @@ -580,8 +580,8 @@ bool RifReaderEclipseOutput::readActiveCellInfo() return false; } - RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); - RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); + RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); + RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL); activeCellInfo->setReservoirCellCount(reservoirCellCount); fractureActiveCellInfo->setReservoirCellCount(reservoirCellCount); @@ -644,8 +644,8 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.setNextProgressIncrement(m_filesWithSameBaseName.size()); - RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RiaDefines::MATRIX_MODEL); - RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RiaDefines::FRACTURE_MODEL); + RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RiaPorosityModel::MATRIX_MODEL); + RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RiaPorosityModel::FRACTURE_MODEL); std::vector timeStepInfos; @@ -681,9 +681,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), - RiaDefines::MATRIX_MODEL, m_dynamicResultsAccess->timeStepCount()); + m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), + RiaPorosityModel::MATRIX_MODEL, m_dynamicResultsAccess->timeStepCount()); for (int i = 0; i < matrixResultNames.size(); ++i) { @@ -694,9 +694,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), - RiaDefines::FRACTURE_MODEL, m_dynamicResultsAccess->timeStepCount()); + m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), + RiaPorosityModel::FRACTURE_MODEL, m_dynamicResultsAccess->timeStepCount()); for (int i = 0; i < fractureResultNames.size(); ++i) { @@ -745,9 +745,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), - RiaDefines::MATRIX_MODEL, 1); + m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), + RiaPorosityModel::MATRIX_MODEL, 1); // Add ACTNUM matrixResultNames += "ACTNUM"; @@ -761,9 +761,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), - RiaDefines::FRACTURE_MODEL, 1); + m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), + RiaPorosityModel::FRACTURE_MODEL, 1); // Add ACTNUM fractureResultNames += "ACTNUM"; @@ -807,7 +807,7 @@ RifEclipseRestartDataAccess* RifReaderEclipseOutput::createDynamicResultsAccess( //-------------------------------------------------------------------------------------------------- /// Get all values of a given static result as doubles //-------------------------------------------------------------------------------------------------- -bool RifReaderEclipseOutput::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) +bool RifReaderEclipseOutput::staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values) { CVF_ASSERT(values); @@ -843,7 +843,7 @@ bool RifReaderEclipseOutput::staticResult(const QString& result, RiaDefines::Por //-------------------------------------------------------------------------------------------------- /// Get dynamic result at given step index. Will concatenate values for the main grid and all sub grids. //-------------------------------------------------------------------------------------------------- -bool RifReaderEclipseOutput::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) +bool RifReaderEclipseOutput::dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) { if (m_dynamicResultsAccess.isNull()) { @@ -1673,7 +1673,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL const std::vector& keywordDataItemCounts, const RigActiveCellInfo* matrixActiveCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepCount) const { CVF_ASSERT(matrixActiveCellInfo); @@ -1683,7 +1683,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL return QStringList(); } - if (porosityModel == RiaDefines::FRACTURE_MODEL) + if (porosityModel == RiaPorosityModel::FRACTURE_MODEL) { if (fractureActiveCellInfo->reservoirActiveCellCount() == 0) { @@ -1719,14 +1719,14 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL size_t sumFractureMatrixActiveCellCount = matrixActiveCellInfo->reservoirActiveCellCount() + fractureActiveCellInfo->reservoirActiveCellCount(); size_t timeStepsMatrixAndFractureRest = keywordDataItemCount % sumFractureMatrixActiveCellCount; - if (porosityModel == RiaDefines::MATRIX_MODEL && timeStepsMatrixRest == 0) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL && timeStepsMatrixRest == 0) { if (keywordDataItemCount <= timeStepCount * std::max(matrixActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount)) { validKeyword = true; } } - else if (porosityModel == RiaDefines::FRACTURE_MODEL && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0) + else if (porosityModel == RiaPorosityModel::FRACTURE_MODEL && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0) { if (keywordDataItemCount <= timeStepCount * std::max(fractureActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount)) { @@ -1772,19 +1772,19 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector* destinationResultValues, const std::vector& sourceResultValues) +void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* destinationResultValues, const std::vector& sourceResultValues) { if (sourceResultValues.size() == 0) return; - RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); + RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL); - if (matrixOrFracture == RiaDefines::MATRIX_MODEL && fracActCellInfo->reservoirActiveCellCount() == 0) + if (matrixOrFracture == RiaPorosityModel::MATRIX_MODEL && fracActCellInfo->reservoirActiveCellCount() == 0) { destinationResultValues->insert(destinationResultValues->end(), sourceResultValues.begin(), sourceResultValues.end()); } else { - RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); + RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); size_t sourceStartPosition = 0; @@ -1796,7 +1796,7 @@ void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaDefines: actCellInfo->gridActiveCellCounts(i, matrixActiveCellCount); fracActCellInfo->gridActiveCellCounts(i, fractureActiveCellCount); - if (matrixOrFracture == RiaDefines::MATRIX_MODEL) + if (matrixOrFracture == RiaPorosityModel::MATRIX_MODEL) { destinationResultValues->insert(destinationResultValues->end(), sourceResultValues.begin() + sourceStartPosition, diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index 3e9e8bf74e..e201c0e5dc 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -53,8 +53,8 @@ public: virtual bool openAndReadActiveCellData(const QString& fileName, const std::vector& mainCaseTimeSteps, RigEclipseCaseData* eclipseCase); void close(); - bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values); - bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values); + bool staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values); + bool dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values); static bool transferGeometry(const ecl_grid_type* mainEclGrid, RigEclipseCaseData* eclipseCase); static void transferCoarseningInfo(const ecl_grid_type* eclGrid, RigGridBase* grid); @@ -72,13 +72,13 @@ private: void openInitFile(); - void extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector* values, const std::vector& fileValues); + void extractResultValuesBasedOnPorosityModel(RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values, const std::vector& fileValues); void transferNNCData( const ecl_grid_type * mainEclGrid , const ecl_file_type * init_file, RigMainGrid * mainGrid); RifEclipseRestartDataAccess* createDynamicResultsAccess(); - QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaDefines::PorosityModelType matrixOrFracture, size_t timeStepCount) const; + QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t timeStepCount) const; private: QString m_fileName; // Name of file used to start accessing Eclipse output files diff --git a/ApplicationCode/FileInterface/RifReaderInterface.h b/ApplicationCode/FileInterface/RifReaderInterface.h index 1157743aa9..d5a2261c4d 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.h +++ b/ApplicationCode/FileInterface/RifReaderInterface.h @@ -20,7 +20,7 @@ #pragma once -#include "RiaDefines.h" +#include "RiaPorosityModel.h" #include "cvfBase.h" #include "cvfObject.h" @@ -59,8 +59,8 @@ public: virtual bool open(const QString& fileName, RigEclipseCaseData* eclipseCase) = 0; virtual void close() = 0; - virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) = 0; - virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) = 0; + virtual bool staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values) = 0; + virtual bool dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) = 0; void setFilenamesWithFaults(const std::vector& filenames) { m_filenamesWithFaults = filenames; } std::vector filenamesWithFaults() { return m_filenamesWithFaults; } diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index a0b115800c..1cf9a666a9 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -33,7 +33,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip m_reservoir = eclipseCase; - RigCaseCellResultsData* cellResults = eclipseCase->results(RiaDefines::MATRIX_MODEL); + RigCaseCellResultsData* cellResults = eclipseCase->results(RiaPorosityModel::MATRIX_MODEL); std::vector timeStepInfos; { @@ -113,7 +113,7 @@ bool RifReaderMockModel::inputProperty(const QString& propertyName, std::vector< //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderMockModel::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) +bool RifReaderMockModel::staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values) { m_reservoirBuilder.staticResult(m_reservoir, result, values); @@ -123,7 +123,7 @@ bool RifReaderMockModel::staticResult(const QString& result, RiaDefines::Porosit //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderMockModel::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) +bool RifReaderMockModel::dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) { m_reservoirBuilder.dynamicResult(m_reservoir, result, stepIndex, values); diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.h b/ApplicationCode/FileInterface/RifReaderMockModel.h index 068cab7a6d..417df227d6 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.h +++ b/ApplicationCode/FileInterface/RifReaderMockModel.h @@ -39,8 +39,8 @@ public: virtual bool open( const QString& fileName, RigEclipseCaseData* eclipseCase ); virtual void close(); - virtual bool staticResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values ); - virtual bool dynamicResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ); + virtual bool staticResult( const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values ); + virtual bool dynamicResult( const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ); private: void populateReservoir(RigEclipseCaseData* eclipseCase); diff --git a/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp b/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp index c22cc08877..3e17000242 100644 --- a/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp +++ b/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp @@ -325,7 +325,7 @@ cvf::ref RivCellEdgeGeometryUtils::createCellEdgeResultAccess adjustedTimeStep = 0; } - RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); + RiaPorosityModel::PorosityModelType porosityModel = cellResultColors->porosityModel(); cvf::ref daObj = RigResultAccessorFactory::createFromResultIdx(eclipseCase, grid->gridIndex(), porosityModel, adjustedTimeStep, resultIndices[cubeFaceIdx]); cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast(cubeFaceIdx), daObj.p()); } diff --git a/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp b/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp index b63e4fb155..c735a92684 100644 --- a/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp +++ b/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp @@ -55,7 +55,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0; - RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); + RiaPorosityModel::PorosityModelType porosityModel = cellResultColors->porosityModel(); cvf::ref soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL"); cvf::ref sgas = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SGAS"); @@ -89,7 +89,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0; - RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); + RiaPorosityModel::PorosityModelType porosityModel = cellResultColors->porosityModel(); size_t gridIndex = 0; cvf::ref soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL"); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp index b13e1222dd..fd6117ac3b 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp @@ -107,7 +107,7 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults() CVF_ASSERT(eclCase && eclCase->eclipseCaseData() ); - timeStepCount = eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(); + timeStepCount = eclCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(); } @@ -171,7 +171,7 @@ std::map > RimFlowDiagSolution::allTracerActiveCel { const cvf::Collection& wellResults = eclCase->eclipseCaseData()->wellResults(); RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid(); - RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); //Todo: Must come from the results definition + RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); //Todo: Must come from the results definition for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx ) { diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 88d747e6ea..09961665bc 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -209,7 +209,7 @@ void RimWellAllocationPlot::updateFromWell() { bool isProducer = ( wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::PRODUCER || wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ); - RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)); + RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)); wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords, pipeBranchesCellIds, tracerFractionCellValues, diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index 7d554f61bb..8c15b7318c 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -346,8 +346,8 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView) { caseName = eclipseView->eclipseCase()->caseUserDescription(); totCellCount = QString::number(eclipseView->mainGrid()->globalCellArray().size()); - size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount(); - size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount(); + size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->reservoirActiveCellCount(); + size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->reservoirActiveCellCount(); if (frActCellCount > 0) activeCellCountText += "Matrix : "; activeCellCountText += QString::number(mxActCellCount); if (frActCellCount > 0) activeCellCountText += " Fracture : " + QString::number(frActCellCount); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index 4e7cbdd6c2..220a78949a 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -380,7 +380,7 @@ void RimEclipseCase::computeCachedData() pInf.setNextProgressIncrement(17); pInf.setProgressDescription("Calculating faults"); - rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)); + rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)); pInf.incrementProgress(); pInf.setProgressDescription("Calculating Formation Names Result"); @@ -414,8 +414,8 @@ void RimEclipseCase::setReservoirData(RigEclipseCaseData* eclipseCase) m_rigEclipseCase = eclipseCase; if (this->eclipseCaseData()) { - m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)); - m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)); + m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)); + m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)); m_fractureModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid()); m_matrixModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid()); } @@ -478,9 +478,9 @@ void RimEclipseCase::createTimeStepFormatString() //-------------------------------------------------------------------------------------------------- cvf::BoundingBox RimEclipseCase::activeCellsBoundingBox() const { - if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)) + if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)) { - return m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)->geometryBoundingBox(); + return m_rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->geometryBoundingBox(); } else { @@ -521,9 +521,9 @@ cvf::Vec3d RimEclipseCase::displayModelOffset() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel) +RimReservoirCellResultsStorage* RimEclipseCase::results(RiaPorosityModel::PorosityModelType porosityModel) { - if (porosityModel == RiaDefines::MATRIX_MODEL) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL) { return m_matrixModelResults(); } @@ -534,9 +534,9 @@ RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityMode //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel) const +const RimReservoirCellResultsStorage* RimEclipseCase::results(RiaPorosityModel::PorosityModelType porosityModel) const { - if (porosityModel == RiaDefines::MATRIX_MODEL) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL) { return m_matrixModelResults(); } @@ -592,7 +592,7 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->results(RiaDefines::MATRIX_MODEL); + RimReservoirCellResultsStorage* results = this->results(RiaPorosityModel::MATRIX_MODEL); if (results->cellResults()) { results->cellResults()->createPlaceholderResultEntries(); @@ -607,7 +607,7 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->results(RiaDefines::FRACTURE_MODEL); + RimReservoirCellResultsStorage* results = this->results(RiaPorosityModel::FRACTURE_MODEL); if (results->cellResults()) results->cellResults()->createPlaceholderResultEntries(); } @@ -636,7 +636,7 @@ QStringList RimEclipseCase::timeStepStrings() const { QStringList stringList; - int timeStepCount = static_cast(results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount()); + int timeStepCount = static_cast(results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->maxTimeStepCount()); for (int i = 0; i < timeStepCount; i++) { stringList += this->timeStepName(i); @@ -665,13 +665,13 @@ void RimEclipseCase::reloadDataAndUpdate() { if (this->eclipseCaseData()) { - RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RiaDefines::MATRIX_MODEL); + RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL); if (matrixModelResults) { matrixModelResults->clearAllResults(); } - RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL); + RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL); if (fractureModelResults) { fractureModelResults->clearAllResults(); @@ -738,5 +738,5 @@ double RimEclipseCase::characteristicCellSize() const //-------------------------------------------------------------------------------------------------- std::vector RimEclipseCase::timeStepDates() const { - return results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepDates(); + return results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->timeStepDates(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index f0633a4293..5eaa2d2ca4 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -20,7 +20,7 @@ #pragma once -#include "RifReaderInterface.h" +#include "RiaPorosityModel.h" #include "RimCase.h" #include "RiaDefines.h" @@ -73,8 +73,8 @@ public: const RigEclipseCaseData* eclipseCaseData() const; cvf::Color3f defaultWellColor(const QString& wellName); - RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel); - const RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel) const; + RimReservoirCellResultsStorage* results(RiaPorosityModel::PorosityModelType porosityModel); + const RimReservoirCellResultsStorage* results(RiaPorosityModel::PorosityModelType porosityModel) const; RimEclipseView* createAndAddReservoirView(); RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp index 3a71cb4472..97ecbf869d 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp @@ -171,7 +171,7 @@ RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection(RigEclipseCa // This is the first insertion of this grid, compute cached data rigEclipseCase->mainGrid()->computeCachedData(); - rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)); + rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)); equalGrid = rigEclipseCase->mainGrid(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp index 46d0e1ffb7..288e684f0f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp @@ -88,11 +88,11 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames) if (fileNames.contains(RiaDefines::mockModelBasicInputCase())) { cvf::ref readerInterface = this->createMockModel(fileNames[0]); - results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); - eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->computeDerivedData(); - eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->computeDerivedData(); + eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->computeDerivedData(); + eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->computeDerivedData(); QFileInfo gridFileName(fileNames[0]); QString caseName = gridFileName.completeBaseName(); @@ -206,8 +206,8 @@ bool RimEclipseInputCase::openEclipseGridFile() CVF_ASSERT(this->eclipseCaseData()); CVF_ASSERT(readerInterface.notNull()); - results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis); @@ -219,8 +219,8 @@ bool RimEclipseInputCase::openEclipseGridFile() RiaApplication* app = RiaApplication::instance(); if (app->preferences()->autocomputeDepthRelatedProperties) { - RimReservoirCellResultsStorage* matrixResults = results(RiaDefines::MATRIX_MODEL); - RimReservoirCellResultsStorage* fractureResults = results(RiaDefines::FRACTURE_MODEL); + RimReservoirCellResultsStorage* matrixResults = results(RiaPorosityModel::MATRIX_MODEL); + RimReservoirCellResultsStorage* fractureResults = results(RiaPorosityModel::FRACTURE_MODEL); matrixResults->computeDepthRelatedResults(); fractureResults->computeDepthRelatedResults(); @@ -318,7 +318,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties() for (const QString fileKeyword : fileKeywordSet) { { - QString resultName = this->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeyword); + QString resultName = this->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->makeResultNameUnique(fileKeyword); if (RifEclipseInputFileTools::readProperty(filenames[i], this->eclipseCaseData(), fileKeyword, resultName)) { RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp index 6d9024ca68..b3eb6d9687 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp @@ -91,7 +91,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change QString oldName = oldValue.toString(); QString newName = newValue.toString(); - RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL); + RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL); if (matrixResults) { if (matrixResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName)) @@ -100,7 +100,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change } } - RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL); + RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL); if (fracResults) { if (fracResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName)) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index 40d0250760..23e91c7879 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -128,8 +128,8 @@ bool RimEclipseResultCase::openEclipseGridFile() this->setReservoirData( eclipseCase.p() ); } - results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); progInfo.incrementProgress(); @@ -188,7 +188,7 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl CVF_ASSERT(mainEclipseCase && mainEclipseCase->mainGrid()); eclipseCase->setMainGrid(mainEclipseCase->mainGrid()); - std::vector timeStepDates = mainEclipseCase->results(RiaDefines::MATRIX_MODEL)->timeStepDates(); + std::vector timeStepDates = mainEclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->timeStepDates(); if (timeStepDates.size() == 0) { return false; @@ -207,8 +207,8 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl readerInterface = readerEclipseOutput; } - results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaPorosityModel::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); CVF_ASSERT(this->eclipseCaseData()); CVF_ASSERT(readerInterface.notNull()); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index f64c6f4613..45284bd8c9 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -902,7 +902,7 @@ void RimEclipseResultDefinition::setResultType(RiaDefines::ResultCatType val) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setPorosityModel(RiaDefines::PorosityModelType val) +void RimEclipseResultDefinition::setPorosityModel(RiaPorosityModel::PorosityModelType val) { m_porosityModel = val; m_porosityModelUiField = val; @@ -991,8 +991,8 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult() { if ( m_eclipseCase && m_eclipseCase->eclipseCaseData() - && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL) - && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 ) + && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL) + && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 ) { return true; } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h index dcbb8720a4..3864ec8085 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h @@ -21,6 +21,7 @@ #pragma once #include "RiaDefines.h" +#include "RiaPorosityModel.h" #include "RigFlowDiagResultAddress.h" @@ -65,8 +66,8 @@ public: RiaDefines::ResultCatType resultType() const { return m_resultType(); } void setResultType(RiaDefines::ResultCatType val); - RiaDefines::PorosityModelType porosityModel() const { return m_porosityModel(); } - void setPorosityModel(RiaDefines::PorosityModelType val); + RiaPorosityModel::PorosityModelType porosityModel() const { return m_porosityModel(); } + void setPorosityModel(RiaPorosityModel::PorosityModelType val); QString resultVariable() const { return m_resultVariable(); } virtual void setResultVariable(const QString& val); @@ -107,7 +108,7 @@ protected: protected: caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultType; - caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModel; + caf::PdmField< caf::AppEnum< RiaPorosityModel::PorosityModelType > > m_porosityModel; caf::PdmField m_resultVariable; caf::PdmPtrField m_flowSolution; @@ -120,7 +121,7 @@ protected: // User interface only fields, to support "filtering"-like behaviour etc. caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultTypeUiField; - caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModelUiField; + caf::PdmField< caf::AppEnum< RiaPorosityModel::PorosityModelType > > m_porosityModelUiField; caf::PdmField m_resultVariableUiField; caf::PdmField< caf::AppEnum< FlowTracerSelectionType > > m_flowTracerSelectionMode; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp index 6d0b188d88..0ace1972f4 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp @@ -159,8 +159,8 @@ bool RimEclipseStatisticsCase::openEclipseGridFile() eclipseCase->setMainGrid(mainGrid); - eclipseCase->setActiveCellInfo(RiaDefines::MATRIX_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::MATRIX_MODEL)); - eclipseCase->setActiveCellInfo(RiaDefines::FRACTURE_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::FRACTURE_MODEL)); + eclipseCase->setActiveCellInfo(RiaPorosityModel::MATRIX_MODEL, gridCaseGroup->unionOfActiveCells(RiaPorosityModel::MATRIX_MODEL)); + eclipseCase->setActiveCellInfo(RiaPorosityModel::FRACTURE_MODEL, gridCaseGroup->unionOfActiveCells(RiaPorosityModel::FRACTURE_MODEL)); this->setReservoirData( eclipseCase.p() ); @@ -218,15 +218,15 @@ void RimEclipseStatisticsCase::computeStatistics() getSourceCases(sourceCases); if (sourceCases.size() == 0 - || !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL) - || !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->cellResults()) + || !sourceCases.at(0)->results(RiaPorosityModel::MATRIX_MODEL) + || !sourceCases.at(0)->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()) { 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)->results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount(); + size_t timeStepCount = sourceCases.at(0)->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->maxTimeStepCount(); RimStatisticsConfig statisticsConfig; @@ -248,42 +248,42 @@ void RimEclipseStatisticsCase::computeStatistics() for(size_t pIdx = 0; pIdx < m_selectedDynamicProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedStaticProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedGeneratedProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedInputProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureDynamicProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureStaticProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureGeneratedProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureInputProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx])); } RimEclipseStatisticsCaseEvaluator stat(sourceCases, timeStepIndices, statisticsConfig, resultCase, gridCaseGroup); @@ -420,42 +420,42 @@ QList RimEclipseStatisticsCase::calculateValueOptions(co if (&m_selectedDynamicProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); return toOptionList(varList); } else if (&m_selectedStaticProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); return toOptionList(varList); } else if (&m_selectedGeneratedProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::GENERATED); + QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::GENERATED); return toOptionList(varList); } else if (&m_selectedInputProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); + QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); return toOptionList(varList); } else if (&m_selectedFractureDynamicProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); return toOptionList(varList); } else if (&m_selectedFractureStaticProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); return toOptionList(varList); } else if (&m_selectedFractureGeneratedProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::GENERATED); + QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::GENERATED); return toOptionList(varList); } else if (&m_selectedFractureInputProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); + QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); return toOptionList(varList); } @@ -636,17 +636,17 @@ void RimEclipseStatisticsCase::updateSelectionListVisibilities() { bool isLocked = hasComputedStatistics(); m_resultType.uiCapability()->setUiHidden(isLocked); - m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RiaDefines::FRACTURE_MODEL)->resultCount() + m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RiaPorosityModel::FRACTURE_MODEL)->resultCount() - m_selectedDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); - m_selectedStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); - m_selectedGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::GENERATED)); - m_selectedInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); + m_selectedDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); + m_selectedStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); + m_selectedGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::GENERATED)); + m_selectedInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); - m_selectedFractureDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); - m_selectedFractureStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); - m_selectedFractureGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::GENERATED)); - m_selectedFractureInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); + m_selectedFractureDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); + m_selectedFractureStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); + m_selectedFractureGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::GENERATED)); + m_selectedFractureInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); } //-------------------------------------------------------------------------------------------------- @@ -668,8 +668,8 @@ void RimEclipseStatisticsCase::updatePercentileUiVisibility() bool RimEclipseStatisticsCase::hasComputedStatistics() const { if ( eclipseCaseData() - && ( eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->resultCount() - || eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->resultCount())) + && ( eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->resultCount() + || eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)->resultCount())) { return true; } @@ -707,14 +707,14 @@ void RimEclipseStatisticsCase::updateConnectedEditorsAndReservoirViews() //-------------------------------------------------------------------------------------------------- void RimEclipseStatisticsCase::clearComputedStatistics() { - if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)) + if (eclipseCaseData() && eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)) { - eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->clearAllResults(); + eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->clearAllResults(); } - if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)) + if (eclipseCaseData() && eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)) { - eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->clearAllResults(); + eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)->clearAllResults(); } updateConnectedEditorsAndReservoirViews(); @@ -750,28 +750,28 @@ void RimEclipseStatisticsCase::populateResultSelection() if (m_selectedDynamicProperties().size() == 0) { - QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); if (varList.contains("SOIL")) m_selectedDynamicProperties.v().push_back("SOIL"); if (varList.contains("PRESSURE")) m_selectedDynamicProperties.v().push_back("PRESSURE"); } if (m_selectedStaticProperties().size() == 0) { - QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); if (varList.contains("PERMX")) m_selectedStaticProperties.v().push_back("PERMX"); if (varList.contains("PORO")) m_selectedStaticProperties.v().push_back("PORO"); } if (m_selectedFractureDynamicProperties().size() == 0) { - QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); if (varList.contains("SOIL")) m_selectedFractureDynamicProperties.v().push_back("SOIL"); if (varList.contains("PRESSURE")) m_selectedFractureDynamicProperties.v().push_back("PRESSURE"); } if (m_selectedFractureStaticProperties().size() == 0) { - QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); if (varList.contains("PERMX")) m_selectedFractureStaticProperties.v().push_back("PERMX"); if (varList.contains("PORO")) m_selectedFractureStaticProperties.v().push_back("PORO"); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h index 2df39dcc7a..23f4b7c4e9 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h @@ -102,7 +102,7 @@ private: // Fields caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultType; - caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModel; + caf::PdmField< caf::AppEnum< RiaPorosityModel::PorosityModelType > > m_porosityModel; caf::PdmField m_selectionSummary; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index ab1560c7fa..318bc26445 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]->results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepInfos(0); + std::vector sourceTimeStepInfos = m_sourceCases[0]->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->timeStepInfos(0); size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true); CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T); @@ -82,7 +82,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& for (int i = 0; i < resultSpecification.size(); i++) { - RiaDefines::PorosityModelType poroModel = resultSpecification[i].m_poroModel; + RiaPorosityModel::PorosityModelType poroModel = resultSpecification[i].m_poroModel; RiaDefines::ResultCatType resultType = resultSpecification[i].m_resType; QString resultName = resultSpecification[i].m_resVarName; @@ -133,7 +133,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& for (int resSpecIdx = 0; resSpecIdx < resultSpecification.size(); resSpecIdx++) { - RiaDefines::PorosityModelType poroModel = resultSpecification[resSpecIdx].m_poroModel; + RiaPorosityModel::PorosityModelType poroModel = resultSpecification[resSpecIdx].m_poroModel; RiaDefines::ResultCatType resultType = resultSpecification[resSpecIdx].m_resType; QString resultName = resultSpecification[resSpecIdx].m_resVarName; @@ -301,13 +301,13 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& if (!eclipseCase->reservoirViews.size()) { - eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->freeAllocatedResultsData(); - eclipseCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->freeAllocatedResultsData(); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->freeAllocatedResultsData(); + eclipseCase->results(RiaPorosityModel::FRACTURE_MODEL)->cellResults()->freeAllocatedResultsData(); } // Todo : These calls really do nothing right now the access actually closes automatically in ert i belive ... - eclipseCase->results(RiaDefines::MATRIX_MODEL)->readerInterface()->close(); - eclipseCase->results(RiaDefines::FRACTURE_MODEL)->readerInterface()->close(); + eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->readerInterface()->close(); + eclipseCase->results(RiaPorosityModel::FRACTURE_MODEL)->readerInterface()->close(); } progressInfo.setProgress(timeIndicesIdx); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h index 5241c33898..27f5008a90 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h @@ -64,12 +64,12 @@ public: struct ResSpec { - ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RiaDefines::MATRIX_MODEL) {} - ResSpec( RiaDefines::PorosityModelType poroModel, + ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RiaPorosityModel::MATRIX_MODEL) {} + ResSpec( RiaPorosityModel::PorosityModelType poroModel, RiaDefines::ResultCatType resType, QString resVarName) : m_poroModel(poroModel), m_resType(resType), m_resVarName(resVarName) {} - RiaDefines::PorosityModelType m_poroModel; + RiaPorosityModel::PorosityModelType m_poroModel; RiaDefines::ResultCatType m_resType; QString m_resVarName; }; @@ -80,7 +80,7 @@ public: private: void addNamedResult(RigCaseCellResultsData* cellResults, RiaDefines::ResultCatType resultType, const QString& resultName, size_t activeCellCount); - void buildSourceMetaData(RiaDefines::PorosityModelType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName); + void buildSourceMetaData(RiaPorosityModel::PorosityModelType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName); enum StatisticsParamType { MIN, MAX, SUM, RANGE, MEAN, STDEV, PMIN, PMID, PMAX, STAT_PARAM_COUNT }; diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index 575e19269e..794b9401e4 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -184,7 +184,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RigEclipseCaseData* rigCaseData = mainCase->eclipseCaseData(); CVF_ASSERT(rigCaseData); - RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType poroModel = RiaPorosityModel::MATRIX_MODEL; mainCase->results(poroModel)->cellResults()->createPlaceholderResultEntries(); @@ -217,8 +217,8 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RimEclipseCase* rimReservoir = statisticsCaseCollection()->reservoirs[i]; // Check if any results are stored in cache - if (rimReservoir->results(RiaDefines::MATRIX_MODEL)->storedResultsCount() > 0 || - rimReservoir->results(RiaDefines::FRACTURE_MODEL)->storedResultsCount() > 0) + if (rimReservoir->results(RiaPorosityModel::MATRIX_MODEL)->storedResultsCount() > 0 || + rimReservoir->results(RiaPorosityModel::FRACTURE_MODEL)->storedResultsCount() > 0) { foundResultsInCache = true; break; @@ -236,7 +236,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() // for all cases { - RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType poroModel = RiaPorosityModel::MATRIX_MODEL; std::vector timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0); @@ -330,7 +330,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells() if (activeM[gridLocalCellIndex] == 0) { - if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->isActive(reservoirCellIndex)) + if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->isActive(reservoirCellIndex)) { activeM[gridLocalCellIndex] = 1; } @@ -338,7 +338,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells() if (activeF[gridLocalCellIndex] == 0) { - if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->isActive(reservoirCellIndex)) + if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->isActive(reservoirCellIndex)) { activeF[gridLocalCellIndex] = 1; } @@ -422,13 +422,13 @@ void RimIdenticalGridCaseGroup::clearStatisticsResults() RimEclipseCase* rimStaticsCase = statisticsCaseCollection->reservoirs[i]; if (!rimStaticsCase) continue; - if (rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults()) + if (rimStaticsCase->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()) { - rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->clearAllResults(); } - if (rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()) + if (rimStaticsCase->results(RiaPorosityModel::FRACTURE_MODEL)->cellResults()) { - rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaPorosityModel::FRACTURE_MODEL)->cellResults()->clearAllResults(); } for (size_t j = 0; j < rimStaticsCase->reservoirViews.size(); j++) @@ -472,9 +472,9 @@ bool RimIdenticalGridCaseGroup::contains(RimEclipseCase* reservoir) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RiaDefines::PorosityModelType porosityType) +RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RiaPorosityModel::PorosityModelType porosityType) { - if (porosityType == RiaDefines::MATRIX_MODEL) + if (porosityType == RiaPorosityModel::MATRIX_MODEL) { return m_unionOfMatrixActiveCells.p(); } diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h index 2486729a64..47a86a4b86 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h @@ -68,7 +68,7 @@ public: RigMainGrid* mainGrid(); - RigActiveCellInfo* unionOfActiveCells(RiaDefines::PorosityModelType porosityType); + RigActiveCellInfo* unionOfActiveCells(RiaPorosityModel::PorosityModelType porosityType); void computeUnionOfActiveCells(); static bool isStatisticsCaseCollection(RimCaseCollection* rimCaseCollection); diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 5ac2627b90..ee33bc271b 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -391,7 +391,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result for (i = 0; i < timeStepCount; i++) { std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[i]; - if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, i, &values)) + if (!m_readerInterface->dynamicResult(resultName, RiaPorosityModel::MATRIX_MODEL, i, &values)) { resultLoadingSucess = false; } @@ -402,7 +402,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result m_cellResults->cellScalarResults(scalarResultIndex).resize(1); std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[0]; - if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) + if (!m_readerInterface->staticResult(resultName, RiaPorosityModel::MATRIX_MODEL, &values)) { resultLoadingSucess = false; } @@ -472,7 +472,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[timeStepIndex]; if (values.size() == 0) { - if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, timeStepIndex, &values)) + if (!m_readerInterface->dynamicResult(resultName, RiaPorosityModel::MATRIX_MODEL, timeStepIndex, &values)) { resultLoadingSucess = false; } @@ -483,7 +483,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi m_cellResults->cellScalarResults(scalarResultIndex).resize(1); std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[0]; - if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) + if (!m_readerInterface->staticResult(resultName, RiaPorosityModel::MATRIX_MODEL, &values)) { resultLoadingSucess = false; } diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp index 6b13d56e89..a9fab21d68 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp @@ -434,9 +434,9 @@ void RigEclipseCaseData::computeActiveCellBoundingBoxes() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) +RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel) { - if (porosityModel == RiaDefines::MATRIX_MODEL) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL) { return m_activeCellInfo.p(); } @@ -447,9 +447,9 @@ RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelT //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) const +const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel) const { - if (porosityModel == RiaDefines::MATRIX_MODEL) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL) { return m_activeCellInfo.p(); } @@ -460,9 +460,9 @@ const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::Porosity //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo) +void RigEclipseCaseData::setActiveCellInfo(RiaPorosityModel::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo) { - if (porosityModel == RiaDefines::MATRIX_MODEL) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL) { m_activeCellInfo = activeCellInfo; m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p()); @@ -604,9 +604,9 @@ RigFormationNames* RigEclipseCaseData::activeFormationNames() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) +RigCaseCellResultsData* RigEclipseCaseData::results(RiaPorosityModel::PorosityModelType porosityModel) { - if (porosityModel == RiaDefines::MATRIX_MODEL) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL) { return m_matrixModelResults.p(); } @@ -617,9 +617,9 @@ RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelTyp //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) const +const RigCaseCellResultsData* RigEclipseCaseData::results(RiaPorosityModel::PorosityModelType porosityModel) const { - if (porosityModel == RiaDefines::MATRIX_MODEL) + if (porosityModel == RiaPorosityModel::MATRIX_MODEL) { return m_matrixModelResults.p(); } diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h index 3ab5199d2e..f7d18dd2e4 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h +++ b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h @@ -64,12 +64,12 @@ public: RigGridBase* grid(size_t index); size_t gridCount() const; - RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel); - const RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel) const; + RigCaseCellResultsData* results(RiaPorosityModel::PorosityModelType porosityModel); + const RigCaseCellResultsData* results(RiaPorosityModel::PorosityModelType porosityModel) const; - RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel); - const RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel) const; - void setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo); + RigActiveCellInfo* activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel); + const RigActiveCellInfo* activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel) const; + void setActiveCellInfo(RiaPorosityModel::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo); void setActiveFormationNames(RigFormationNames* activeFormationNames); RigFormationNames* activeFormationNames(); diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index c212dd2ee1..9dc0ae7f48 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -70,7 +70,7 @@ const RigActiveCellInfo * RigFlowDiagResults::activeCellInfo(const RigFlowDiagRe RimEclipseResultCase* eclCase; m_flowDiagSolution->firstAncestorOrThisOfType(eclCase); - return eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); // Todo: base on resVarAddr member + return eclCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); // Todo: base on resVarAddr member } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index edff3fc51c..67afb48838 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -158,7 +158,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI { using namespace Opm::FlowDiagnostics; - RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount()); + RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->reservoirActiveCellCount()); caf::ProgressInfo progressInfo(8, "Calculating Flow Diagnostics"); @@ -206,7 +206,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI QStringList restartFileNames = RifEclipseOutputFileTools::filterFileNamesOfType(m_filesWithSameBaseName, ECL_RESTART_FILE); size_t restartFileCount = static_cast(restartFileNames.size()); - size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(); + size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(); if (restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount ) { @@ -241,9 +241,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI CVF_ASSERT(currentRestartData); size_t resultIndexWithMaxTimeSteps = cvf::UNDEFINED_SIZE_T; - m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&resultIndexWithMaxTimeSteps); + m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(&resultIndexWithMaxTimeSteps); - int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex); + int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex); if ( !currentRestartData->selectReportStep(reportStepNumber) ) { @@ -256,7 +256,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI Opm::FlowDiagnostics::CellSetValues sumWellFluxPrCell; { - if (m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->hasFlowDiagUsableFluxes()) + if (m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->hasFlowDiagUsableFluxes()) { Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph), *currentRestartData, diff --git a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp index 1b5808ac81..6c784b0a99 100644 --- a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp +++ b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp @@ -250,7 +250,7 @@ void RigReservoirBuilderMock::populateReservoir(RigEclipseCaseData* eclipseCase) addFaults(eclipseCase); // Set all cells active - RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); + RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); activeCellInfo->setReservoirCellCount(eclipseCase->mainGrid()->globalCellArray().size()); for (size_t i = 0; i < eclipseCase->mainGrid()->globalCellArray().size(); i++) { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp index eb21009d76..2e4ece31a8 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp @@ -41,7 +41,7 @@ //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName) { @@ -134,7 +134,7 @@ cvf::ref RigResultAccessorFactory::createFromUiResultName(Rig //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromNameAndType(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName, RiaDefines::ResultCatType resultType) @@ -209,7 +209,7 @@ cvf::ref RigResultAccessorFactory::createFromResultDefinition //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createNativeFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName) { @@ -237,7 +237,7 @@ cvf::ref RigResultAccessorFactory::createNativeFromUiResultNa //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromResultIdx(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, size_t resultIndex) { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h index ec87df1206..84f9b1de9f 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h @@ -41,14 +41,14 @@ public: static cvf::ref createFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName); static cvf::ref createFromNameAndType(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName, RiaDefines::ResultCatType resultType); @@ -56,7 +56,7 @@ public: static cvf::ref createFromResultIdx(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, size_t resultIndex); @@ -64,7 +64,7 @@ private: static cvf::ref createNativeFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, const QString& resultName); diff --git a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp index ba772a5837..a8954698f3 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp @@ -31,7 +31,7 @@ //-------------------------------------------------------------------------------------------------- cvf::ref RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, QString& uiResultName) { @@ -53,7 +53,7 @@ cvf::ref RigResultModifierFactory::createResultModifier(RigEc //-------------------------------------------------------------------------------------------------- cvf::ref RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, size_t scalarResultIndex) { if ( !eclipseCase ) return NULL; diff --git a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h index 9de9a938c1..e40062a5d8 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h +++ b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h @@ -30,14 +30,14 @@ public: static cvf::ref createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, QString& uiResultName); static cvf::ref createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaDefines::PorosityModelType porosityModel, + RiaPorosityModel::PorosityModelType porosityModel, size_t timeStepIndex, size_t scalarResultIndex); }; diff --git a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp index 1dc871fa6f..a401813952 100644 --- a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp @@ -95,14 +95,14 @@ public: RimEclipseCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args); if (!rimCase) return true; - RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType porosityModel = RiaPorosityModel::MATRIX_MODEL; if (args.size() > 2) { QString prorosityModelString = args[2]; if (prorosityModelString.toUpper() == "FRACTURE") { - porosityModel = RiaDefines::FRACTURE_MODEL; + porosityModel = RiaPorosityModel::FRACTURE_MODEL; } } @@ -144,7 +144,7 @@ public: return true; } - static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RiaDefines::PorosityModelType porosityModel, std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK, std::vector& globalCoarseningBoxIdx) + static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RiaPorosityModel::PorosityModelType porosityModel, std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK, std::vector& globalCoarseningBoxIdx) { gridNumber.clear(); cellI.clear(); @@ -412,7 +412,7 @@ public: size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; if (rimCase && rimCase->eclipseCaseData()) { - rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); + rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T) { canFetchData = false; @@ -431,7 +431,7 @@ public: return true; } - std::vector timeStepDates = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->timeStepDates(scalarIndexWithMaxTimeStepCount); + std::vector timeStepDates = rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->timeStepDates(scalarIndexWithMaxTimeStepCount); quint64 timeStepCount = timeStepDates.size(); quint64 byteCount = sizeof(quint64) + 6 * timeStepCount * sizeof(qint32); @@ -499,7 +499,7 @@ public: size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; if (rimCase && rimCase->eclipseCaseData()) { - rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); + rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T) { canFetchData = false; @@ -518,7 +518,7 @@ public: return true; } - std::vector daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount); + std::vector daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount); quint64 timeStepCount = daysSinceSimulationStart.size(); quint64 byteCount = sizeof(quint64) + timeStepCount * sizeof(qint32); diff --git a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp index 6c25948d58..f7259f482c 100644 --- a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp @@ -165,10 +165,10 @@ public: QString porosityModelName; porosityModelName = args[2]; - RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; if (porosityModelName.toUpper() == "FRACTURE") { - porosityModelEnum = RiaDefines::FRACTURE_MODEL; + porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; } if (!rimCase || !rimCase->eclipseCaseData()) @@ -336,10 +336,10 @@ public: QString porosityModelName; porosityModelName = args[2]; - RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; if (porosityModelName.toUpper() == "FRACTURE") { - porosityModelEnum = RiaDefines::FRACTURE_MODEL; + porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; } if (!rimCase || !rimCase->eclipseCaseData() ) diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index 383013f1c6..e1f1e8ee4a 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -60,10 +60,10 @@ public: QString propertyName = args[2]; QString porosityModelName = args[3]; - RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RiaDefines::FRACTURE_MODEL; + porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; } // Find the requested data @@ -233,10 +233,10 @@ public: return true; } - RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RiaDefines::FRACTURE_MODEL; + porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; } size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; @@ -383,7 +383,7 @@ public: m_bytesPerTimeStepToRead(0), m_currentTimeStepNumberToRead(0), m_invalidActiveCellCountDetected(false), - m_porosityModelEnum(RiaDefines::MATRIX_MODEL) + m_porosityModelEnum(RiaPorosityModel::MATRIX_MODEL) {} static QString commandName () { return QString("SetActiveCellProperty"); } @@ -397,7 +397,7 @@ public: if (porosityModelName == "Fracture") { - m_porosityModelEnum = RiaDefines::FRACTURE_MODEL; + m_porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; } // Find the requested data, Or create a set if we are setting data and it is not found @@ -697,7 +697,7 @@ private: size_t m_currentScalarIndex; QString m_currentPropertyName; std::vector m_requestedTimesteps; - RiaDefines::PorosityModelType m_porosityModelEnum; + RiaPorosityModel::PorosityModelType m_porosityModelEnum; quint64 m_timeStepCountToRead; quint64 m_bytesPerTimeStepToRead; @@ -724,7 +724,7 @@ public: m_bytesPerTimeStepToRead(0), m_currentTimeStepNumberToRead(0), m_invalidDataDetected(false), - m_porosityModelEnum(RiaDefines::MATRIX_MODEL) + m_porosityModelEnum(RiaPorosityModel::MATRIX_MODEL) {} static QString commandName () { return QString("SetGridProperty"); } @@ -746,7 +746,7 @@ public: if (porosityModelName == "Fracture") { - m_porosityModelEnum = RiaDefines::FRACTURE_MODEL; + m_porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; } RigGridBase* grid = rimCase->eclipseCaseData()->grid(m_currentGridIndex); @@ -1061,7 +1061,7 @@ private: size_t m_currentScalarIndex; QString m_currentPropertyName; std::vector m_requestedTimesteps; - RiaDefines::PorosityModelType m_porosityModelEnum; + RiaPorosityModel::PorosityModelType m_porosityModelEnum; quint64 m_timeStepCountToRead; quint64 m_bytesPerTimeStepToRead; @@ -1092,11 +1092,11 @@ public: } QString porosityModelName = args[2]; - RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; + RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RiaDefines::FRACTURE_MODEL; + porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; } std::vector propNames; diff --git a/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp b/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp index 3a50dd2172..ec0f866e48 100644 --- a/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp +++ b/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp @@ -260,7 +260,7 @@ TEST(RigReservoirTest, UnifiedTestFile) -void buildResultInfoString(RigReservoir* reservoir, RiaDefines::PorosityModelType porosityModel, RiaDefines::ResultCatType resultType) +void buildResultInfoString(RigReservoir* reservoir, RiaPorosityModel::PorosityModelType porosityModel, RiaDefines::ResultCatType resultType) { RigCaseCellResultsData* matrixResults = reservoir->results(porosityModel); { @@ -302,22 +302,22 @@ TEST(RigReservoirTest, DualPorosityTest) qDebug() << "\n\n" << "Matrix porosities, DYNAMIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaPorosityModel::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE); qDebug() << "\n\n" << "Matrix porosities, STATIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaPorosityModel::MATRIX_MODEL, RiaDefines::STATIC_NATIVE); qDebug() << "\n\n" << "Fracture porosities, DYNAMIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaPorosityModel::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE); qDebug() << "\n\n" << "Fracture porosities, STATIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaPorosityModel::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE); } diff --git a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp index bc8620360b..3319c10088 100644 --- a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp +++ b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp @@ -374,7 +374,7 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigEclipseCaseData* eclips return; } - RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel(); + RiaPorosityModel::PorosityModelType porosityModel = resultColors->porosityModel(); if (resultColors->isTernarySaturationSelected()) { RimReservoirCellResultsStorage* gridCellResults = resultColors->currentGridCellResults(); @@ -537,7 +537,7 @@ QString RiuResultTextBuilder::cellEdgeResultDetails() adjustedTimeStep = 0; } - RiaDefines::PorosityModelType porosityModel = m_reservoirView->cellResult()->porosityModel(); + RiaPorosityModel::PorosityModelType porosityModel = m_reservoirView->cellResult()->porosityModel(); cvf::ref resultAccessor = RigResultAccessorFactory::createFromResultIdx(m_reservoirView->eclipseCase()->eclipseCaseData(), m_gridIndex, porosityModel, adjustedTimeStep, resultIndex); if (resultAccessor.notNull()) { @@ -664,7 +664,7 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors) size_t sgasScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); size_t swatScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); - RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel(); + RiaPorosityModel::PorosityModelType porosityModel = resultColors->porosityModel(); cvf::ref dataAccessObjectX = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, soilScalarSetIndex); cvf::ref dataAccessObjectY = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, sgasScalarSetIndex); diff --git a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp index b1271ccf50..58879f03b0 100644 --- a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp +++ b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp @@ -113,7 +113,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData()) { - RiaDefines::PorosityModelType porosityModel = eclipseView->cellResult()->porosityModel(); + RiaPorosityModel::PorosityModelType porosityModel = eclipseView->cellResult()->porosityModel(); std::vector timeStepDates = eclipseView->eclipseCase()->eclipseCaseData()->results(porosityModel)->timeStepDates(); From 68e52e1838add99b902774be60a4a29c278dba70 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 10:34:13 +0200 Subject: [PATCH 29/36] #1755 Cleaned up includes --- ApplicationCode/ProjectDataModel/RimCellEdgeColors.h | 2 -- ApplicationCode/ProjectDataModel/RimEclipseCellColors.h | 1 - ApplicationCode/ProjectDataModel/RimViewLinker.h | 2 -- .../ProjectDataModel/RimViewLinkerCollection.h | 1 - .../ReservoirDataModel/RigSingleWellResultsData.h | 8 ++++---- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h index 4972ff8e9f..409208e767 100644 --- a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h +++ b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h @@ -20,8 +20,6 @@ #pragma once -#include "RiaDefines.h" - #include "cafAppEnum.h" #include "cafFixedArray.h" #include "cafPdmChildField.h" diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCellColors.h b/ApplicationCode/ProjectDataModel/RimEclipseCellColors.h index afba2778ab..184be112e3 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCellColors.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCellColors.h @@ -20,7 +20,6 @@ #pragma once -#include "RiaDefines.h" #include "RimEclipseResultDefinition.h" #include "cafPdmChildArrayField.h" diff --git a/ApplicationCode/ProjectDataModel/RimViewLinker.h b/ApplicationCode/ProjectDataModel/RimViewLinker.h index 779aa03f76..39df28f97b 100644 --- a/ApplicationCode/ProjectDataModel/RimViewLinker.h +++ b/ApplicationCode/ProjectDataModel/RimViewLinker.h @@ -19,8 +19,6 @@ #pragma once -#include "RiaDefines.h" - #include "RivCellSetEnum.h" #include "cafPdmChildArrayField.h" diff --git a/ApplicationCode/ProjectDataModel/RimViewLinkerCollection.h b/ApplicationCode/ProjectDataModel/RimViewLinkerCollection.h index 9503ea0fc6..11fb5c90c4 100644 --- a/ApplicationCode/ProjectDataModel/RimViewLinkerCollection.h +++ b/ApplicationCode/ProjectDataModel/RimViewLinkerCollection.h @@ -19,7 +19,6 @@ #pragma once -#include "RiaDefines.h" #include "cafPdmChildField.h" #include "cafPdmField.h" diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h index 75c253e886..98017a3dea 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h @@ -21,12 +21,12 @@ #include "cvfBase.h" #include "cvfObject.h" #include "cvfMath.h" - -#include "RiaDefines.h" -#include -#include #include "cvfVector3.h" +#include + +#include + //================================================================================================== /// Stores the info on a significant point in the well. Either a well-to-grid connection, or the /// bottom position of a connection less well-segment From 8f3a7a5867cd72c4d377024f53f4aa40f9235730 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 12:33:10 +0200 Subject: [PATCH 30/36] #1691 Map from filtered time step indices to well result indices --- .../FileInterface/RifReaderEclipseOutput.cpp | 57 +++++++++++++------ .../FileInterface/RifReaderEclipseOutput.h | 3 + .../RigSingleWellResultsData.cpp | 28 ++++----- 3 files changed, 53 insertions(+), 35 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 7a96bedd75..b4df26d2d3 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -657,23 +657,7 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.incrementProgress(); - // Get time steps - { - std::vector timeStepsOnFile; - std::vector daysSinceSimulationStartOnFile; - std::vector reportNumbersOnFile; - - m_dynamicResultsAccess->timeSteps(&timeStepsOnFile, &daysSinceSimulationStartOnFile); - reportNumbersOnFile = m_dynamicResultsAccess->reportNumbers(); - - for (size_t i = 0; i < timeStepsOnFile.size(); i++) - { - if (this->isTimeStepIncludedByFilter(i)) - { - timeStepInfos.push_back(RigTimeStepInfo(timeStepsOnFile[i], reportNumbersOnFile[i], daysSinceSimulationStartOnFile[i])); - } - } - } + timeStepInfos = createFilteredTimeStepInfos(); QStringList resultNames; std::vector resultNamesDataItemCounts; @@ -1653,7 +1637,16 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid, boo } - wellResults->computeMappingFromResultTimeIndicesToWellTimeIndices(timeSteps); + std::vector filteredTimeSteps; + { + std::vector filteredTimeStepInfos = createFilteredTimeStepInfos(); + for (auto a : filteredTimeStepInfos) + { + filteredTimeSteps.push_back(a.m_date); + } + } + + wellResults->computeMappingFromResultTimeIndicesToWellTimeIndices(filteredTimeSteps); wells.push_back(wellResults.p()); @@ -1769,6 +1762,34 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RifReaderEclipseOutput::createFilteredTimeStepInfos() +{ + std::vector timeStepInfos; + + if (m_dynamicResultsAccess.notNull()) + { + std::vector timeStepsOnFile; + std::vector daysSinceSimulationStartOnFile; + std::vector reportNumbersOnFile; + + m_dynamicResultsAccess->timeSteps(&timeStepsOnFile, &daysSinceSimulationStartOnFile); + reportNumbersOnFile = m_dynamicResultsAccess->reportNumbers(); + + for (size_t i = 0; i < timeStepsOnFile.size(); i++) + { + if (this->isTimeStepIncludedByFilter(i)) + { + timeStepInfos.push_back(RigTimeStepInfo(timeStepsOnFile[i], reportNumbersOnFile[i], daysSinceSimulationStartOnFile[i])); + } + } + } + + return timeStepInfos; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index e201c0e5dc..0386eb5309 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -30,6 +30,7 @@ class RigGridBase; class RigMainGrid; class RigActiveCellInfo; class RigFault; +class RigTimeStepInfo; struct RigWellResultPoint; @@ -79,6 +80,8 @@ private: RifEclipseRestartDataAccess* createDynamicResultsAccess(); QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t timeStepCount) const; + + std::vector createFilteredTimeStepInfos(); private: QString m_fileName; // Name of file used to start accessing Eclipse output files diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp index 3cb3831d9a..116a9d1e3e 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp @@ -37,12 +37,12 @@ const RigWellResultFrame& RigSingleWellResultsData::wellResultFrame(size_t resul //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector& resultTimes) +void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector& simulationTimeSteps) { m_resultTimeStepIndexToWellTimeStepIndex.clear(); if (m_wellCellsTimeSteps.size() == 0) return; - m_resultTimeStepIndexToWellTimeStepIndex.resize(resultTimes.size(), cvf::UNDEFINED_SIZE_T); + m_resultTimeStepIndexToWellTimeStepIndex.resize(simulationTimeSteps.size(), cvf::UNDEFINED_SIZE_T); if (false) { @@ -54,29 +54,23 @@ void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndi } qDebug() << "Result TimeStamps"; - for (size_t i = 0; i < resultTimes.size(); i++) + for (size_t i = 0; i < simulationTimeSteps.size(); i++) { - qDebug() << resultTimes[i].toString(); + qDebug() << simulationTimeSteps[i].toString(); } - } - int resultIdx = 0; - size_t wellIdx = 0; - size_t activeWellIdx = cvf::UNDEFINED_SIZE_T; - - while (wellIdx <= m_wellCellsTimeSteps.size() && resultIdx < static_cast(resultTimes.size())) + for (size_t resultTimeStepIndex = 0; resultTimeStepIndex< simulationTimeSteps.size(); resultTimeStepIndex++) { - if (wellIdx < m_wellCellsTimeSteps.size() && m_wellCellsTimeSteps[wellIdx].m_timestamp <= resultTimes[resultIdx]) + size_t wellTimeStepIndex = 0; + + while (wellTimeStepIndex < m_wellCellsTimeSteps.size() && + m_wellCellsTimeSteps[wellTimeStepIndex].m_timestamp < simulationTimeSteps[resultTimeStepIndex]) { - activeWellIdx = wellIdx; - wellIdx++; + wellTimeStepIndex++; } - CVF_ASSERT(resultIdx < static_cast(m_resultTimeStepIndexToWellTimeStepIndex.size())); - m_resultTimeStepIndexToWellTimeStepIndex[resultIdx] = activeWellIdx; - - resultIdx++; + m_resultTimeStepIndexToWellTimeStepIndex[resultTimeStepIndex] = wellTimeStepIndex; } } From 89684c243f725c4cae77a56e399f441a5b883352 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 14:05:59 +0200 Subject: [PATCH 31/36] #1755 Use namespace RiaDefines instead of class --- ApplicationCode/Application/RiaDefines.cpp | 208 ++++++++++++++++++ ApplicationCode/Application/RiaDefines.h | 58 +++-- .../Application/RiaPorosityModel.cpp | 8 +- .../Application/RiaPorosityModel.h | 4 +- ...sTransmissibilityCalculationFeatureImp.cpp | 2 +- ...RicWellPathExportCompletionDataFeature.cpp | 62 +++--- .../ExportCommands/RicCellRangeUi.cpp | 2 +- .../RifEclipseInputFileTools.cpp | 14 +- .../FileInterface/RifReaderEclipseInput.h | 4 +- .../FileInterface/RifReaderEclipseOutput.cpp | 58 ++--- .../FileInterface/RifReaderEclipseOutput.h | 8 +- .../FileInterface/RifReaderInterface.h | 4 +- .../FileInterface/RifReaderMockModel.cpp | 6 +- .../FileInterface/RifReaderMockModel.h | 4 +- .../RivCellEdgeGeometryUtils.cpp | 2 +- .../RivTernaryTextureCoordsCreator.cpp | 4 +- .../Flow/RimFlowDiagSolution.cpp | 4 +- .../Flow/RimWellAllocationPlot.cpp | 2 +- .../Rim3dOverlayInfoConfig.cpp | 4 +- .../ProjectDataModel/RimEclipseCase.cpp | 30 +-- .../ProjectDataModel/RimEclipseCase.h | 4 +- .../RimEclipseCaseCollection.cpp | 2 +- .../ProjectDataModel/RimEclipseInputCase.cpp | 18 +- .../RimEclipseInputProperty.cpp | 4 +- .../ProjectDataModel/RimEclipseResultCase.cpp | 10 +- .../RimEclipseResultDefinition.cpp | 6 +- .../RimEclipseResultDefinition.h | 8 +- .../RimEclipseStatisticsCase.cpp | 80 +++---- .../RimEclipseStatisticsCase.h | 2 +- .../RimEclipseStatisticsCaseEvaluator.cpp | 14 +- .../RimEclipseStatisticsCaseEvaluator.h | 8 +- .../RimIdenticalGridCaseGroup.cpp | 24 +- .../RimIdenticalGridCaseGroup.h | 2 +- .../RimReservoirCellResultsStorage.cpp | 8 +- .../ReservoirDataModel/RigEclipseCaseData.cpp | 20 +- .../ReservoirDataModel/RigEclipseCaseData.h | 10 +- .../ReservoirDataModel/RigFlowDiagResults.cpp | 2 +- .../RigFlowDiagSolverInterface.cpp | 10 +- .../RigReservoirBuilderMock.cpp | 2 +- .../RigResultAccessorFactory.cpp | 8 +- .../RigResultAccessorFactory.h | 8 +- .../RigResultModifierFactory.cpp | 4 +- .../RigResultModifierFactory.h | 4 +- .../SocketInterface/RiaCaseInfoCommands.cpp | 14 +- .../SocketInterface/RiaGeometryCommands.cpp | 8 +- .../RiaPropertyDataCommands.cpp | 24 +- .../UnitTests/RifReaderEclipseOutput-Test.cpp | 10 +- .../UserInterface/RiuResultTextBuilder.cpp | 6 +- .../RiuSelectionChangedHandler.cpp | 2 +- 49 files changed, 507 insertions(+), 303 deletions(-) diff --git a/ApplicationCode/Application/RiaDefines.cpp b/ApplicationCode/Application/RiaDefines.cpp index 2b459efac8..11c40806ba 100644 --- a/ApplicationCode/Application/RiaDefines.cpp +++ b/ApplicationCode/Application/RiaDefines.cpp @@ -100,3 +100,211 @@ bool RiaDefines::isPerCellFaceResult(const QString& resultName) return false; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::undefinedResultName() +{ + return "None"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::undefinedGridFaultName() +{ + return "Undefined Grid Faults"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::undefinedGridFaultWithInactiveName() +{ + return "Undefined Grid Faults With Inactive"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::combinedTransmissibilityResultName() +{ + return "TRANXYZ"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::ternarySaturationResultName() +{ + return "TERNARY"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::combinedMultResultName() +{ + return "MULTXYZ"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riTranXResultName() +{ + return "riTRANX"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riTranYResultName() +{ + return "riTRANY"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riTranZResultName() +{ + return "riTRANZ"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::combinedRiTranResultName() +{ + return "riTRANXYZ"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riMultXResultName() +{ + return "riMULTX"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riMultYResultName() +{ + return "riMULTY"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riMultZResultName() +{ + return "riMULTZ"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::combinedRiMultResultName() +{ + return "riMULTXYZ"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riAreaNormTranXResultName() +{ + return "riTRANXbyArea"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riAreaNormTranYResultName() +{ + return "riTRANYbyArea"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::riAreaNormTranZResultName() +{ + return "riTRANZbyArea"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::combinedRiAreaNormTranResultName() +{ + return "riTRANXYZbyArea"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::completionTypeResultName() +{ + return "Completion Type"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::mockModelBasic() +{ + return "Result Mock Debug Model Simple"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::mockModelBasicWithResults() +{ + return "Result Mock Debug Model With Results"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::mockModelLargeWithResults() +{ + return "Result Mock Debug Model Large With Results"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::mockModelCustomized() +{ + return "Result Mock Debug Model Customized"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaDefines::mockModelBasicInputCase() +{ + return "Input Mock Debug Model Simple"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RiaDefines::minimumDefaultValuePlot() +{ + return -10.0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RiaDefines::maximumDefaultValuePlot() +{ + return 100.0; +} diff --git a/ApplicationCode/Application/RiaDefines.h b/ApplicationCode/Application/RiaDefines.h index 0b86276ac6..747ce1ae95 100644 --- a/ApplicationCode/Application/RiaDefines.h +++ b/ApplicationCode/Application/RiaDefines.h @@ -22,10 +22,8 @@ #include -class RiaDefines +namespace RiaDefines { - -public: enum ResultCatType { DYNAMIC_NATIVE, @@ -43,38 +41,38 @@ public: FISHBONES }; - static bool isPerCellFaceResult(const QString& resultName); + bool isPerCellFaceResult(const QString& resultName); - static QString undefinedResultName() { return "None"; } - static QString undefinedGridFaultName() { return "Undefined Grid Faults"; } - static QString undefinedGridFaultWithInactiveName() { return "Undefined Grid Faults With Inactive"; } - static QString combinedTransmissibilityResultName() { return "TRANXYZ"; } - static QString ternarySaturationResultName() { return "TERNARY"; } - static QString combinedMultResultName() { return "MULTXYZ"; } + QString undefinedResultName(); + QString undefinedGridFaultName(); + QString undefinedGridFaultWithInactiveName(); + QString combinedTransmissibilityResultName(); + QString ternarySaturationResultName(); + QString combinedMultResultName(); - static QString riTranXResultName() { return "riTRANX"; } - static QString riTranYResultName() { return "riTRANY"; } - static QString riTranZResultName() { return "riTRANZ"; } - static QString combinedRiTranResultName() { return "riTRANXYZ"; } + QString riTranXResultName(); + QString riTranYResultName(); + QString riTranZResultName(); + QString combinedRiTranResultName(); - static QString riMultXResultName() { return "riMULTX"; } - static QString riMultYResultName() { return "riMULTY"; } - static QString riMultZResultName() { return "riMULTZ"; } - static QString combinedRiMultResultName() { return "riMULTXYZ"; } + QString riMultXResultName(); + QString riMultYResultName(); + QString riMultZResultName(); + QString combinedRiMultResultName(); - static QString riAreaNormTranXResultName() { return "riTRANXbyArea"; } - static QString riAreaNormTranYResultName() { return "riTRANYbyArea"; } - static QString riAreaNormTranZResultName() { return "riTRANZbyArea"; } - static QString combinedRiAreaNormTranResultName() { return "riTRANXYZbyArea"; } + QString riAreaNormTranXResultName(); + QString riAreaNormTranYResultName(); + QString riAreaNormTranZResultName(); + QString combinedRiAreaNormTranResultName(); - static QString completionTypeResultName() { return "Completion Type"; } + QString completionTypeResultName(); // Mock model text identifiers - static QString mockModelBasic() { return "Result Mock Debug Model Simple"; } - static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; } - static QString mockModelLargeWithResults() { return "Result Mock Debug Model Large With Results"; } - static QString mockModelCustomized() { return "Result Mock Debug Model Customized"; } - static QString mockModelBasicInputCase() { return "Input Mock Debug Model Simple"; } + QString mockModelBasic(); + QString mockModelBasicWithResults(); + QString mockModelLargeWithResults(); + QString mockModelCustomized(); + QString mockModelBasicInputCase(); //Units and conversions @@ -94,7 +92,7 @@ public: PLOT_AXIS_RIGHT }; - static double minimumDefaultValuePlot() { return - 10.0; } - static double maximumDefaultValuePlot() { return 100.0; } + double minimumDefaultValuePlot(); + double maximumDefaultValuePlot(); }; diff --git a/ApplicationCode/Application/RiaPorosityModel.cpp b/ApplicationCode/Application/RiaPorosityModel.cpp index 610d02a835..6b93a857bd 100644 --- a/ApplicationCode/Application/RiaPorosityModel.cpp +++ b/ApplicationCode/Application/RiaPorosityModel.cpp @@ -22,10 +22,10 @@ template<> -void caf::AppEnum< RiaPorosityModel::PorosityModelType >::setUp() +void caf::AppEnum< RiaDefines::PorosityModelType >::setUp() { - addItem(RiaPorosityModel::MATRIX_MODEL, "MATRIX_MODEL", "Matrix"); - addItem(RiaPorosityModel::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture"); + addItem(RiaDefines::MATRIX_MODEL, "MATRIX_MODEL", "Matrix"); + addItem(RiaDefines::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture"); - setDefault(RiaPorosityModel::MATRIX_MODEL); + setDefault(RiaDefines::MATRIX_MODEL); } diff --git a/ApplicationCode/Application/RiaPorosityModel.h b/ApplicationCode/Application/RiaPorosityModel.h index 8fa306361a..b6694cb930 100644 --- a/ApplicationCode/Application/RiaPorosityModel.h +++ b/ApplicationCode/Application/RiaPorosityModel.h @@ -21,9 +21,7 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -class RiaPorosityModel -{ -public: +namespace RiaDefines { enum PorosityModelType { MATRIX_MODEL, diff --git a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp index 1c4674e68e..dea68d097b 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp @@ -86,7 +86,7 @@ std::vector RicFishbonesTransmissibilityCalculationFeatureImp std::vector completionData; RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); - const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); + const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); for (auto cellAndWellBoreParts : wellBorePartsInCells) { diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index 0fcfd33059..0485391835 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -582,7 +582,7 @@ std::vector RicWellPathExportCompletionDataFeature::generateP RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType(); std::vector completionData; - const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); + const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); for (const RimPerforationInterval* interval : wellPath->perforationIntervalCollection()->perforations()) @@ -813,12 +813,12 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DX"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DY"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); + 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)); double yLengthFraction = abs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex)); @@ -852,19 +852,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DX"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DY"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); - cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMX"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); - cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMY"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); - cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); + 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); double dy = dyAccessObject->cellScalarGlobIdx(cellIndex); @@ -901,19 +901,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclips { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); - cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DX"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); - cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DY"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); - cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "DZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX"); + cvf::ref dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY"); + cvf::ref dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ"); + cvf::ref dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); - cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMX"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); - cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMY"); - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ"); - cvf::ref permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaPorosityModel::MATRIX_MODEL, 0, "PERMZ"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX"); + cvf::ref permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX"); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY"); + cvf::ref permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY"); + 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); double dy = dyAccessObject->cellScalarGlobIdx(cellIndex); diff --git a/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp b/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp index 8770ad6a87..3c74619381 100644 --- a/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicCellRangeUi.cpp @@ -260,7 +260,7 @@ RigActiveCellInfo* RicCellRangeUi::activeCellInfo() const RimEclipseCase* rimEclipeCase = dynamic_cast(m_case()); if (rimEclipeCase && rimEclipeCase->eclipseCaseData()) { - return rimEclipeCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); + return rimEclipeCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); } return nullptr; diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp index 38b22dfbc2..2f12dbf6a7 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp @@ -231,7 +231,7 @@ std::map RifEclipseInputFileTools::readProperties(const QStrin ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ecl_type_create_from_type(ECL_FLOAT_TYPE)); if (eclipseKeywordData) { - QString newResultName = caseData->results(RiaPorosityModel::MATRIX_MODEL)->makeResultNameUnique(fileKeywords[i].keyword); + QString newResultName = caseData->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeywords[i].keyword); if (readDataFromKeyword(eclipseKeywordData, caseData, newResultName)) { newResults[newResultName] = fileKeywords[i].keyword; @@ -290,7 +290,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa { mathingItemCount = true; } - if (itemCount == caseData->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->reservoirActiveCellCount()) + if (itemCount == caseData->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount()) { mathingItemCount = true; } @@ -301,7 +301,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa size_t resultIndex = RifEclipseInputFileTools::findOrCreateResult(resultName, caseData); if (resultIndex == cvf::UNDEFINED_SIZE_T) return false; - std::vector< std::vector >& newPropertyData = caseData->results(RiaPorosityModel::MATRIX_MODEL)->cellScalarResults(resultIndex); + std::vector< std::vector >& newPropertyData = caseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex); newPropertyData.push_back(std::vector()); newPropertyData[0].resize(ecl_kw_get_size(eclipseKeywordData), HUGE_VAL); ecl_kw_get_data_as_double(eclipseKeywordData, newPropertyData[0].data()); @@ -446,7 +446,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, { CVF_ASSERT(eclipseCase); - size_t resultIndex = eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->findScalarResultIndex(resultName); + size_t resultIndex = eclipseCase->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(resultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { return false; @@ -458,7 +458,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, return false; } - std::vector< std::vector >& resultData = eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->cellScalarResults(resultIndex); + std::vector< std::vector >& resultData = eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex); if (resultData.size() == 0) { return false; @@ -717,10 +717,10 @@ qint64 RifEclipseInputFileTools::findKeyword(const QString& keyword, QFile& file //-------------------------------------------------------------------------------------------------- size_t RifEclipseInputFileTools::findOrCreateResult(const QString& newResultName, RigEclipseCaseData* reservoir) { - size_t resultIndex = reservoir->results(RiaPorosityModel::MATRIX_MODEL)->findScalarResultIndex(newResultName); + size_t resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(newResultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { - resultIndex = reservoir->results(RiaPorosityModel::MATRIX_MODEL)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false); + resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false); } return resultIndex; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseInput.h b/ApplicationCode/FileInterface/RifReaderEclipseInput.h index db9862b196..cb192ba496 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseInput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseInput.h @@ -38,6 +38,6 @@ public: virtual void close() {} - virtual bool staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values ) { return false; } - virtual bool dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ) { return false; } + virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values ) { return false; } + virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ) { return false; } }; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index b4df26d2d3..75d1c1220f 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -242,8 +242,8 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid, return false; } - RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); - RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL); + RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); + RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); CVF_ASSERT(activeCellInfo && fractureActiveCellInfo); @@ -580,8 +580,8 @@ bool RifReaderEclipseOutput::readActiveCellInfo() return false; } - RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); - RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL); + RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); + RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); activeCellInfo->setReservoirCellCount(reservoirCellCount); fractureActiveCellInfo->setReservoirCellCount(reservoirCellCount); @@ -644,8 +644,8 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.setNextProgressIncrement(m_filesWithSameBaseName.size()); - RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RiaPorosityModel::MATRIX_MODEL); - RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RiaPorosityModel::FRACTURE_MODEL); + RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RiaDefines::MATRIX_MODEL); + RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RiaDefines::FRACTURE_MODEL); std::vector timeStepInfos; @@ -665,9 +665,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), - RiaPorosityModel::MATRIX_MODEL, m_dynamicResultsAccess->timeStepCount()); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::MATRIX_MODEL, m_dynamicResultsAccess->timeStepCount()); for (int i = 0; i < matrixResultNames.size(); ++i) { @@ -678,9 +678,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), - RiaPorosityModel::FRACTURE_MODEL, m_dynamicResultsAccess->timeStepCount()); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::FRACTURE_MODEL, m_dynamicResultsAccess->timeStepCount()); for (int i = 0; i < fractureResultNames.size(); ++i) { @@ -729,9 +729,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), - RiaPorosityModel::MATRIX_MODEL, 1); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::MATRIX_MODEL, 1); // Add ACTNUM matrixResultNames += "ACTNUM"; @@ -745,9 +745,9 @@ void RifReaderEclipseOutput::buildMetaData() { QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts, - m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL), - m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL), - RiaPorosityModel::FRACTURE_MODEL, 1); + m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL), + m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL), + RiaDefines::FRACTURE_MODEL, 1); // Add ACTNUM fractureResultNames += "ACTNUM"; @@ -791,7 +791,7 @@ RifEclipseRestartDataAccess* RifReaderEclipseOutput::createDynamicResultsAccess( //-------------------------------------------------------------------------------------------------- /// Get all values of a given static result as doubles //-------------------------------------------------------------------------------------------------- -bool RifReaderEclipseOutput::staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values) +bool RifReaderEclipseOutput::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) { CVF_ASSERT(values); @@ -827,7 +827,7 @@ bool RifReaderEclipseOutput::staticResult(const QString& result, RiaPorosityMode //-------------------------------------------------------------------------------------------------- /// Get dynamic result at given step index. Will concatenate values for the main grid and all sub grids. //-------------------------------------------------------------------------------------------------- -bool RifReaderEclipseOutput::dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) +bool RifReaderEclipseOutput::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) { if (m_dynamicResultsAccess.isNull()) { @@ -1666,7 +1666,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL const std::vector& keywordDataItemCounts, const RigActiveCellInfo* matrixActiveCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepCount) const { CVF_ASSERT(matrixActiveCellInfo); @@ -1676,7 +1676,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL return QStringList(); } - if (porosityModel == RiaPorosityModel::FRACTURE_MODEL) + if (porosityModel == RiaDefines::FRACTURE_MODEL) { if (fractureActiveCellInfo->reservoirActiveCellCount() == 0) { @@ -1712,14 +1712,14 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL size_t sumFractureMatrixActiveCellCount = matrixActiveCellInfo->reservoirActiveCellCount() + fractureActiveCellInfo->reservoirActiveCellCount(); size_t timeStepsMatrixAndFractureRest = keywordDataItemCount % sumFractureMatrixActiveCellCount; - if (porosityModel == RiaPorosityModel::MATRIX_MODEL && timeStepsMatrixRest == 0) + if (porosityModel == RiaDefines::MATRIX_MODEL && timeStepsMatrixRest == 0) { if (keywordDataItemCount <= timeStepCount * std::max(matrixActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount)) { validKeyword = true; } } - else if (porosityModel == RiaPorosityModel::FRACTURE_MODEL && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0) + else if (porosityModel == RiaDefines::FRACTURE_MODEL && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0) { if (keywordDataItemCount <= timeStepCount * std::max(fractureActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount)) { @@ -1793,19 +1793,19 @@ std::vector RifReaderEclipseOutput::createFilteredTimeStepInfos //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* destinationResultValues, const std::vector& sourceResultValues) +void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector* destinationResultValues, const std::vector& sourceResultValues) { if (sourceResultValues.size() == 0) return; - RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL); + RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL); - if (matrixOrFracture == RiaPorosityModel::MATRIX_MODEL && fracActCellInfo->reservoirActiveCellCount() == 0) + if (matrixOrFracture == RiaDefines::MATRIX_MODEL && fracActCellInfo->reservoirActiveCellCount() == 0) { destinationResultValues->insert(destinationResultValues->end(), sourceResultValues.begin(), sourceResultValues.end()); } else { - RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); + RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); size_t sourceStartPosition = 0; @@ -1817,7 +1817,7 @@ void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaPorosity actCellInfo->gridActiveCellCounts(i, matrixActiveCellCount); fracActCellInfo->gridActiveCellCounts(i, fractureActiveCellCount); - if (matrixOrFracture == RiaPorosityModel::MATRIX_MODEL) + if (matrixOrFracture == RiaDefines::MATRIX_MODEL) { destinationResultValues->insert(destinationResultValues->end(), sourceResultValues.begin() + sourceStartPosition, diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index 0386eb5309..08223ef4a1 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -54,8 +54,8 @@ public: virtual bool openAndReadActiveCellData(const QString& fileName, const std::vector& mainCaseTimeSteps, RigEclipseCaseData* eclipseCase); void close(); - bool staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values); - bool dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values); + bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values); + bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values); static bool transferGeometry(const ecl_grid_type* mainEclGrid, RigEclipseCaseData* eclipseCase); static void transferCoarseningInfo(const ecl_grid_type* eclGrid, RigGridBase* grid); @@ -73,13 +73,13 @@ private: void openInitFile(); - void extractResultValuesBasedOnPorosityModel(RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values, const std::vector& fileValues); + void extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector* values, const std::vector& fileValues); void transferNNCData( const ecl_grid_type * mainEclGrid , const ecl_file_type * init_file, RigMainGrid * mainGrid); RifEclipseRestartDataAccess* createDynamicResultsAccess(); - QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t timeStepCount) const; + QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaDefines::PorosityModelType matrixOrFracture, size_t timeStepCount) const; std::vector createFilteredTimeStepInfos(); diff --git a/ApplicationCode/FileInterface/RifReaderInterface.h b/ApplicationCode/FileInterface/RifReaderInterface.h index d5a2261c4d..a9ece3681a 100644 --- a/ApplicationCode/FileInterface/RifReaderInterface.h +++ b/ApplicationCode/FileInterface/RifReaderInterface.h @@ -59,8 +59,8 @@ public: virtual bool open(const QString& fileName, RigEclipseCaseData* eclipseCase) = 0; virtual void close() = 0; - virtual bool staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values) = 0; - virtual bool dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) = 0; + virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) = 0; + virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) = 0; void setFilenamesWithFaults(const std::vector& filenames) { m_filenamesWithFaults = filenames; } std::vector filenamesWithFaults() { return m_filenamesWithFaults; } diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index 1cf9a666a9..a0b115800c 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -33,7 +33,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip m_reservoir = eclipseCase; - RigCaseCellResultsData* cellResults = eclipseCase->results(RiaPorosityModel::MATRIX_MODEL); + RigCaseCellResultsData* cellResults = eclipseCase->results(RiaDefines::MATRIX_MODEL); std::vector timeStepInfos; { @@ -113,7 +113,7 @@ bool RifReaderMockModel::inputProperty(const QString& propertyName, std::vector< //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderMockModel::staticResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values) +bool RifReaderMockModel::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values) { m_reservoirBuilder.staticResult(m_reservoir, result, values); @@ -123,7 +123,7 @@ bool RifReaderMockModel::staticResult(const QString& result, RiaPorosityModel::P //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderMockModel::dynamicResult(const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) +bool RifReaderMockModel::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values) { m_reservoirBuilder.dynamicResult(m_reservoir, result, stepIndex, values); diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.h b/ApplicationCode/FileInterface/RifReaderMockModel.h index 417df227d6..068cab7a6d 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.h +++ b/ApplicationCode/FileInterface/RifReaderMockModel.h @@ -39,8 +39,8 @@ public: virtual bool open( const QString& fileName, RigEclipseCaseData* eclipseCase ); virtual void close(); - virtual bool staticResult( const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, std::vector* values ); - virtual bool dynamicResult( const QString& result, RiaPorosityModel::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ); + virtual bool staticResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector* values ); + virtual bool dynamicResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector* values ); private: void populateReservoir(RigEclipseCaseData* eclipseCase); diff --git a/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp b/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp index 3e17000242..c22cc08877 100644 --- a/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp +++ b/ApplicationCode/ModelVisualization/RivCellEdgeGeometryUtils.cpp @@ -325,7 +325,7 @@ cvf::ref RivCellEdgeGeometryUtils::createCellEdgeResultAccess adjustedTimeStep = 0; } - RiaPorosityModel::PorosityModelType porosityModel = cellResultColors->porosityModel(); + RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); cvf::ref daObj = RigResultAccessorFactory::createFromResultIdx(eclipseCase, grid->gridIndex(), porosityModel, adjustedTimeStep, resultIndices[cubeFaceIdx]); cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast(cubeFaceIdx), daObj.p()); } diff --git a/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp b/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp index c735a92684..b63e4fb155 100644 --- a/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp +++ b/ApplicationCode/ModelVisualization/RivTernaryTextureCoordsCreator.cpp @@ -55,7 +55,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0; - RiaPorosityModel::PorosityModelType porosityModel = cellResultColors->porosityModel(); + RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); cvf::ref soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL"); cvf::ref sgas = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SGAS"); @@ -89,7 +89,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0; - RiaPorosityModel::PorosityModelType porosityModel = cellResultColors->porosityModel(); + RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel(); size_t gridIndex = 0; cvf::ref soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL"); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp index fd6117ac3b..b13e1222dd 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowDiagSolution.cpp @@ -107,7 +107,7 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults() CVF_ASSERT(eclCase && eclCase->eclipseCaseData() ); - timeStepCount = eclCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(); + timeStepCount = eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(); } @@ -171,7 +171,7 @@ std::map > RimFlowDiagSolution::allTracerActiveCel { const cvf::Collection& wellResults = eclCase->eclipseCaseData()->wellResults(); RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid(); - RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); //Todo: Must come from the results definition + RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); //Todo: Must come from the results definition for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx ) { diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 09961665bc..88d747e6ea 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -209,7 +209,7 @@ void RimWellAllocationPlot::updateFromWell() { bool isProducer = ( wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::PRODUCER || wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ); - RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)); + RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)); wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords, pipeBranchesCellIds, tracerFractionCellValues, diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index 8c15b7318c..7d554f61bb 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -346,8 +346,8 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView) { caseName = eclipseView->eclipseCase()->caseUserDescription(); totCellCount = QString::number(eclipseView->mainGrid()->globalCellArray().size()); - size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->reservoirActiveCellCount(); - size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->reservoirActiveCellCount(); + size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount(); + size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount(); if (frActCellCount > 0) activeCellCountText += "Matrix : "; activeCellCountText += QString::number(mxActCellCount); if (frActCellCount > 0) activeCellCountText += " Fracture : " + QString::number(frActCellCount); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index 220a78949a..4e7cbdd6c2 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -380,7 +380,7 @@ void RimEclipseCase::computeCachedData() pInf.setNextProgressIncrement(17); pInf.setProgressDescription("Calculating faults"); - rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)); + rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)); pInf.incrementProgress(); pInf.setProgressDescription("Calculating Formation Names Result"); @@ -414,8 +414,8 @@ void RimEclipseCase::setReservoirData(RigEclipseCaseData* eclipseCase) m_rigEclipseCase = eclipseCase; if (this->eclipseCaseData()) { - m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)); - m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)); + m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)); + m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)); m_fractureModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid()); m_matrixModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid()); } @@ -478,9 +478,9 @@ void RimEclipseCase::createTimeStepFormatString() //-------------------------------------------------------------------------------------------------- cvf::BoundingBox RimEclipseCase::activeCellsBoundingBox() const { - if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)) + if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)) { - return m_rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->geometryBoundingBox(); + return m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)->geometryBoundingBox(); } else { @@ -521,9 +521,9 @@ cvf::Vec3d RimEclipseCase::displayModelOffset() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimReservoirCellResultsStorage* RimEclipseCase::results(RiaPorosityModel::PorosityModelType porosityModel) +RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel) { - if (porosityModel == RiaPorosityModel::MATRIX_MODEL) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults(); } @@ -534,9 +534,9 @@ RimReservoirCellResultsStorage* RimEclipseCase::results(RiaPorosityModel::Porosi //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RimReservoirCellResultsStorage* RimEclipseCase::results(RiaPorosityModel::PorosityModelType porosityModel) const +const RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel) const { - if (porosityModel == RiaPorosityModel::MATRIX_MODEL) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults(); } @@ -592,7 +592,7 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->results(RiaPorosityModel::MATRIX_MODEL); + RimReservoirCellResultsStorage* results = this->results(RiaDefines::MATRIX_MODEL); if (results->cellResults()) { results->cellResults()->createPlaceholderResultEntries(); @@ -607,7 +607,7 @@ bool RimEclipseCase::openReserviorCase() } { - RimReservoirCellResultsStorage* results = this->results(RiaPorosityModel::FRACTURE_MODEL); + RimReservoirCellResultsStorage* results = this->results(RiaDefines::FRACTURE_MODEL); if (results->cellResults()) results->cellResults()->createPlaceholderResultEntries(); } @@ -636,7 +636,7 @@ QStringList RimEclipseCase::timeStepStrings() const { QStringList stringList; - int timeStepCount = static_cast(results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->maxTimeStepCount()); + int timeStepCount = static_cast(results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount()); for (int i = 0; i < timeStepCount; i++) { stringList += this->timeStepName(i); @@ -665,13 +665,13 @@ void RimEclipseCase::reloadDataAndUpdate() { if (this->eclipseCaseData()) { - RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL); + RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RiaDefines::MATRIX_MODEL); if (matrixModelResults) { matrixModelResults->clearAllResults(); } - RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL); + RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL); if (fractureModelResults) { fractureModelResults->clearAllResults(); @@ -738,5 +738,5 @@ double RimEclipseCase::characteristicCellSize() const //-------------------------------------------------------------------------------------------------- std::vector RimEclipseCase::timeStepDates() const { - return results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->timeStepDates(); + return results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepDates(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index 5eaa2d2ca4..c493a10421 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -73,8 +73,8 @@ public: const RigEclipseCaseData* eclipseCaseData() const; cvf::Color3f defaultWellColor(const QString& wellName); - RimReservoirCellResultsStorage* results(RiaPorosityModel::PorosityModelType porosityModel); - const RimReservoirCellResultsStorage* results(RiaPorosityModel::PorosityModelType porosityModel) const; + RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel); + const RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel) const; RimEclipseView* createAndAddReservoirView(); RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp index 97ecbf869d..3a71cb4472 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCaseCollection.cpp @@ -171,7 +171,7 @@ RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection(RigEclipseCa // This is the first insertion of this grid, compute cached data rigEclipseCase->mainGrid()->computeCachedData(); - rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)); + rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)); equalGrid = rigEclipseCase->mainGrid(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp index 288e684f0f..46d0e1ffb7 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp @@ -88,11 +88,11 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames) if (fileNames.contains(RiaDefines::mockModelBasicInputCase())) { cvf::ref readerInterface = this->createMockModel(fileNames[0]); - results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaPorosityModel::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); - eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->computeDerivedData(); - eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->computeDerivedData(); + eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->computeDerivedData(); + eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->computeDerivedData(); QFileInfo gridFileName(fileNames[0]); QString caseName = gridFileName.completeBaseName(); @@ -206,8 +206,8 @@ bool RimEclipseInputCase::openEclipseGridFile() CVF_ASSERT(this->eclipseCaseData()); CVF_ASSERT(readerInterface.notNull()); - results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaPorosityModel::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis); @@ -219,8 +219,8 @@ bool RimEclipseInputCase::openEclipseGridFile() RiaApplication* app = RiaApplication::instance(); if (app->preferences()->autocomputeDepthRelatedProperties) { - RimReservoirCellResultsStorage* matrixResults = results(RiaPorosityModel::MATRIX_MODEL); - RimReservoirCellResultsStorage* fractureResults = results(RiaPorosityModel::FRACTURE_MODEL); + RimReservoirCellResultsStorage* matrixResults = results(RiaDefines::MATRIX_MODEL); + RimReservoirCellResultsStorage* fractureResults = results(RiaDefines::FRACTURE_MODEL); matrixResults->computeDepthRelatedResults(); fractureResults->computeDepthRelatedResults(); @@ -318,7 +318,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties() for (const QString fileKeyword : fileKeywordSet) { { - QString resultName = this->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->makeResultNameUnique(fileKeyword); + QString resultName = this->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeyword); if (RifEclipseInputFileTools::readProperty(filenames[i], this->eclipseCaseData(), fileKeyword, resultName)) { RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp index b3eb6d9687..6d9024ca68 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputProperty.cpp @@ -91,7 +91,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change QString oldName = oldValue.toString(); QString newName = newValue.toString(); - RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL); + RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL); if (matrixResults) { if (matrixResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName)) @@ -100,7 +100,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change } } - RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL); + RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL); if (fracResults) { if (fracResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName)) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index 23e91c7879..40d0250760 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -128,8 +128,8 @@ bool RimEclipseResultCase::openEclipseGridFile() this->setReservoirData( eclipseCase.p() ); } - results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaPorosityModel::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); + results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p()); progInfo.incrementProgress(); @@ -188,7 +188,7 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl CVF_ASSERT(mainEclipseCase && mainEclipseCase->mainGrid()); eclipseCase->setMainGrid(mainEclipseCase->mainGrid()); - std::vector timeStepDates = mainEclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->timeStepDates(); + std::vector timeStepDates = mainEclipseCase->results(RiaDefines::MATRIX_MODEL)->timeStepDates(); if (timeStepDates.size() == 0) { return false; @@ -207,8 +207,8 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl readerInterface = readerEclipseOutput; } - results(RiaPorosityModel::MATRIX_MODEL)->setReaderInterface(readerInterface.p()); - results(RiaPorosityModel::FRACTURE_MODEL)->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()); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index 45284bd8c9..f64c6f4613 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -902,7 +902,7 @@ void RimEclipseResultDefinition::setResultType(RiaDefines::ResultCatType val) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setPorosityModel(RiaPorosityModel::PorosityModelType val) +void RimEclipseResultDefinition::setPorosityModel(RiaDefines::PorosityModelType val) { m_porosityModel = val; m_porosityModelUiField = val; @@ -991,8 +991,8 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult() { if ( m_eclipseCase && m_eclipseCase->eclipseCaseData() - && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL) - && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 ) + && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL) + && m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 ) { return true; } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h index 3864ec8085..843f9a4ed6 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h @@ -66,8 +66,8 @@ public: RiaDefines::ResultCatType resultType() const { return m_resultType(); } void setResultType(RiaDefines::ResultCatType val); - RiaPorosityModel::PorosityModelType porosityModel() const { return m_porosityModel(); } - void setPorosityModel(RiaPorosityModel::PorosityModelType val); + RiaDefines::PorosityModelType porosityModel() const { return m_porosityModel(); } + void setPorosityModel(RiaDefines::PorosityModelType val); QString resultVariable() const { return m_resultVariable(); } virtual void setResultVariable(const QString& val); @@ -108,7 +108,7 @@ protected: protected: caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultType; - caf::PdmField< caf::AppEnum< RiaPorosityModel::PorosityModelType > > m_porosityModel; + caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModel; caf::PdmField m_resultVariable; caf::PdmPtrField m_flowSolution; @@ -121,7 +121,7 @@ protected: // User interface only fields, to support "filtering"-like behaviour etc. caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultTypeUiField; - caf::PdmField< caf::AppEnum< RiaPorosityModel::PorosityModelType > > m_porosityModelUiField; + caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModelUiField; caf::PdmField m_resultVariableUiField; caf::PdmField< caf::AppEnum< FlowTracerSelectionType > > m_flowTracerSelectionMode; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp index 0ace1972f4..6d0b188d88 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp @@ -159,8 +159,8 @@ bool RimEclipseStatisticsCase::openEclipseGridFile() eclipseCase->setMainGrid(mainGrid); - eclipseCase->setActiveCellInfo(RiaPorosityModel::MATRIX_MODEL, gridCaseGroup->unionOfActiveCells(RiaPorosityModel::MATRIX_MODEL)); - eclipseCase->setActiveCellInfo(RiaPorosityModel::FRACTURE_MODEL, gridCaseGroup->unionOfActiveCells(RiaPorosityModel::FRACTURE_MODEL)); + eclipseCase->setActiveCellInfo(RiaDefines::MATRIX_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::MATRIX_MODEL)); + eclipseCase->setActiveCellInfo(RiaDefines::FRACTURE_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::FRACTURE_MODEL)); this->setReservoirData( eclipseCase.p() ); @@ -218,15 +218,15 @@ void RimEclipseStatisticsCase::computeStatistics() getSourceCases(sourceCases); if (sourceCases.size() == 0 - || !sourceCases.at(0)->results(RiaPorosityModel::MATRIX_MODEL) - || !sourceCases.at(0)->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()) + || !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL) + || !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->cellResults()) { 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)->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->maxTimeStepCount(); + size_t timeStepCount = sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount(); RimStatisticsConfig statisticsConfig; @@ -248,42 +248,42 @@ void RimEclipseStatisticsCase::computeStatistics() for(size_t pIdx = 0; pIdx < m_selectedDynamicProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedStaticProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedGeneratedProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedInputProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::MATRIX_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureDynamicProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureStaticProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureGeneratedProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx])); } for(size_t pIdx = 0; pIdx < m_selectedFractureInputProperties().size(); ++pIdx) { - resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaPorosityModel::FRACTURE_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx])); + resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx])); } RimEclipseStatisticsCaseEvaluator stat(sourceCases, timeStepIndices, statisticsConfig, resultCase, gridCaseGroup); @@ -420,42 +420,42 @@ QList RimEclipseStatisticsCase::calculateValueOptions(co if (&m_selectedDynamicProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); return toOptionList(varList); } else if (&m_selectedStaticProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); return toOptionList(varList); } else if (&m_selectedGeneratedProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::GENERATED); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::GENERATED); return toOptionList(varList); } else if (&m_selectedInputProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); return toOptionList(varList); } else if (&m_selectedFractureDynamicProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); return toOptionList(varList); } else if (&m_selectedFractureStaticProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); return toOptionList(varList); } else if (&m_selectedFractureGeneratedProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::GENERATED); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::GENERATED); return toOptionList(varList); } else if (&m_selectedFractureInputProperties == fieldNeedingOptions) { - QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY); return toOptionList(varList); } @@ -636,17 +636,17 @@ void RimEclipseStatisticsCase::updateSelectionListVisibilities() { bool isLocked = hasComputedStatistics(); m_resultType.uiCapability()->setUiHidden(isLocked); - m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RiaPorosityModel::FRACTURE_MODEL)->resultCount() + m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RiaDefines::FRACTURE_MODEL)->resultCount() - m_selectedDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); - m_selectedStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); - m_selectedGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::GENERATED)); - m_selectedInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::MATRIX_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); + m_selectedDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); + m_selectedStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); + m_selectedGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::GENERATED)); + m_selectedInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); - m_selectedFractureDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); - m_selectedFractureStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); - m_selectedFractureGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::GENERATED)); - m_selectedFractureInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaPorosityModel::FRACTURE_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); + m_selectedFractureDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE)); + m_selectedFractureStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE)); + m_selectedFractureGeneratedProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::GENERATED)); + m_selectedFractureInputProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::FRACTURE_MODEL && m_resultType() == RiaDefines::INPUT_PROPERTY)); } //-------------------------------------------------------------------------------------------------- @@ -668,8 +668,8 @@ void RimEclipseStatisticsCase::updatePercentileUiVisibility() bool RimEclipseStatisticsCase::hasComputedStatistics() const { if ( eclipseCaseData() - && ( eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->resultCount() - || eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)->resultCount())) + && ( eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->resultCount() + || eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->resultCount())) { return true; } @@ -707,14 +707,14 @@ void RimEclipseStatisticsCase::updateConnectedEditorsAndReservoirViews() //-------------------------------------------------------------------------------------------------- void RimEclipseStatisticsCase::clearComputedStatistics() { - if (eclipseCaseData() && eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)) + if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)) { - eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->clearAllResults(); + eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->clearAllResults(); } - if (eclipseCaseData() && eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)) + if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)) { - eclipseCaseData()->results(RiaPorosityModel::FRACTURE_MODEL)->clearAllResults(); + eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->clearAllResults(); } updateConnectedEditorsAndReservoirViews(); @@ -750,28 +750,28 @@ void RimEclipseStatisticsCase::populateResultSelection() if (m_selectedDynamicProperties().size() == 0) { - QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); if (varList.contains("SOIL")) m_selectedDynamicProperties.v().push_back("SOIL"); if (varList.contains("PRESSURE")) m_selectedDynamicProperties.v().push_back("PRESSURE"); } if (m_selectedStaticProperties().size() == 0) { - QStringList varList = caseData->results(RiaPorosityModel::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); if (varList.contains("PERMX")) m_selectedStaticProperties.v().push_back("PERMX"); if (varList.contains("PORO")) m_selectedStaticProperties.v().push_back("PORO"); } if (m_selectedFractureDynamicProperties().size() == 0) { - QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE); if (varList.contains("SOIL")) m_selectedFractureDynamicProperties.v().push_back("SOIL"); if (varList.contains("PRESSURE")) m_selectedFractureDynamicProperties.v().push_back("PRESSURE"); } if (m_selectedFractureStaticProperties().size() == 0) { - QStringList varList = caseData->results(RiaPorosityModel::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); + QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE); if (varList.contains("PERMX")) m_selectedFractureStaticProperties.v().push_back("PERMX"); if (varList.contains("PORO")) m_selectedFractureStaticProperties.v().push_back("PORO"); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h index 23f4b7c4e9..2df39dcc7a 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h @@ -102,7 +102,7 @@ private: // Fields caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultType; - caf::PdmField< caf::AppEnum< RiaPorosityModel::PorosityModelType > > m_porosityModel; + caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModel; caf::PdmField m_selectionSummary; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index 318bc26445..ab1560c7fa 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]->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->timeStepInfos(0); + std::vector sourceTimeStepInfos = m_sourceCases[0]->results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepInfos(0); size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true); CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T); @@ -82,7 +82,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& for (int i = 0; i < resultSpecification.size(); i++) { - RiaPorosityModel::PorosityModelType poroModel = resultSpecification[i].m_poroModel; + RiaDefines::PorosityModelType poroModel = resultSpecification[i].m_poroModel; RiaDefines::ResultCatType resultType = resultSpecification[i].m_resType; QString resultName = resultSpecification[i].m_resVarName; @@ -133,7 +133,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& for (int resSpecIdx = 0; resSpecIdx < resultSpecification.size(); resSpecIdx++) { - RiaPorosityModel::PorosityModelType poroModel = resultSpecification[resSpecIdx].m_poroModel; + RiaDefines::PorosityModelType poroModel = resultSpecification[resSpecIdx].m_poroModel; RiaDefines::ResultCatType resultType = resultSpecification[resSpecIdx].m_resType; QString resultName = resultSpecification[resSpecIdx].m_resVarName; @@ -301,13 +301,13 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList& if (!eclipseCase->reservoirViews.size()) { - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->freeAllocatedResultsData(); - eclipseCase->results(RiaPorosityModel::FRACTURE_MODEL)->cellResults()->freeAllocatedResultsData(); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->freeAllocatedResultsData(); + eclipseCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->freeAllocatedResultsData(); } // Todo : These calls really do nothing right now the access actually closes automatically in ert i belive ... - eclipseCase->results(RiaPorosityModel::MATRIX_MODEL)->readerInterface()->close(); - eclipseCase->results(RiaPorosityModel::FRACTURE_MODEL)->readerInterface()->close(); + eclipseCase->results(RiaDefines::MATRIX_MODEL)->readerInterface()->close(); + eclipseCase->results(RiaDefines::FRACTURE_MODEL)->readerInterface()->close(); } progressInfo.setProgress(timeIndicesIdx); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h index 27f5008a90..5241c33898 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.h @@ -64,12 +64,12 @@ public: struct ResSpec { - ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RiaPorosityModel::MATRIX_MODEL) {} - ResSpec( RiaPorosityModel::PorosityModelType poroModel, + ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RiaDefines::MATRIX_MODEL) {} + ResSpec( RiaDefines::PorosityModelType poroModel, RiaDefines::ResultCatType resType, QString resVarName) : m_poroModel(poroModel), m_resType(resType), m_resVarName(resVarName) {} - RiaPorosityModel::PorosityModelType m_poroModel; + RiaDefines::PorosityModelType m_poroModel; RiaDefines::ResultCatType m_resType; QString m_resVarName; }; @@ -80,7 +80,7 @@ public: private: void addNamedResult(RigCaseCellResultsData* cellResults, RiaDefines::ResultCatType resultType, const QString& resultName, size_t activeCellCount); - void buildSourceMetaData(RiaPorosityModel::PorosityModelType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName); + void buildSourceMetaData(RiaDefines::PorosityModelType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName); enum StatisticsParamType { MIN, MAX, SUM, RANGE, MEAN, STDEV, PMIN, PMID, PMAX, STAT_PARAM_COUNT }; diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index 794b9401e4..575e19269e 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -184,7 +184,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RigEclipseCaseData* rigCaseData = mainCase->eclipseCaseData(); CVF_ASSERT(rigCaseData); - RiaPorosityModel::PorosityModelType poroModel = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; mainCase->results(poroModel)->cellResults()->createPlaceholderResultEntries(); @@ -217,8 +217,8 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RimEclipseCase* rimReservoir = statisticsCaseCollection()->reservoirs[i]; // Check if any results are stored in cache - if (rimReservoir->results(RiaPorosityModel::MATRIX_MODEL)->storedResultsCount() > 0 || - rimReservoir->results(RiaPorosityModel::FRACTURE_MODEL)->storedResultsCount() > 0) + if (rimReservoir->results(RiaDefines::MATRIX_MODEL)->storedResultsCount() > 0 || + rimReservoir->results(RiaDefines::FRACTURE_MODEL)->storedResultsCount() > 0) { foundResultsInCache = true; break; @@ -236,7 +236,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() // for all cases { - RiaPorosityModel::PorosityModelType poroModel = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; std::vector timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0); @@ -330,7 +330,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells() if (activeM[gridLocalCellIndex] == 0) { - if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->isActive(reservoirCellIndex)) + if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->isActive(reservoirCellIndex)) { activeM[gridLocalCellIndex] = 1; } @@ -338,7 +338,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells() if (activeF[gridLocalCellIndex] == 0) { - if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaPorosityModel::FRACTURE_MODEL)->isActive(reservoirCellIndex)) + if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->isActive(reservoirCellIndex)) { activeF[gridLocalCellIndex] = 1; } @@ -422,13 +422,13 @@ void RimIdenticalGridCaseGroup::clearStatisticsResults() RimEclipseCase* rimStaticsCase = statisticsCaseCollection->reservoirs[i]; if (!rimStaticsCase) continue; - if (rimStaticsCase->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()) + if (rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults()) { - rimStaticsCase->results(RiaPorosityModel::MATRIX_MODEL)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->clearAllResults(); } - if (rimStaticsCase->results(RiaPorosityModel::FRACTURE_MODEL)->cellResults()) + if (rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()) { - rimStaticsCase->results(RiaPorosityModel::FRACTURE_MODEL)->cellResults()->clearAllResults(); + rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->clearAllResults(); } for (size_t j = 0; j < rimStaticsCase->reservoirViews.size(); j++) @@ -472,9 +472,9 @@ bool RimIdenticalGridCaseGroup::contains(RimEclipseCase* reservoir) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RiaPorosityModel::PorosityModelType porosityType) +RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RiaDefines::PorosityModelType porosityType) { - if (porosityType == RiaPorosityModel::MATRIX_MODEL) + if (porosityType == RiaDefines::MATRIX_MODEL) { return m_unionOfMatrixActiveCells.p(); } diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h index 47a86a4b86..2486729a64 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.h @@ -68,7 +68,7 @@ public: RigMainGrid* mainGrid(); - RigActiveCellInfo* unionOfActiveCells(RiaPorosityModel::PorosityModelType porosityType); + RigActiveCellInfo* unionOfActiveCells(RiaDefines::PorosityModelType porosityType); void computeUnionOfActiveCells(); static bool isStatisticsCaseCollection(RimCaseCollection* rimCaseCollection); diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index ee33bc271b..5ac2627b90 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -391,7 +391,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result for (i = 0; i < timeStepCount; i++) { std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[i]; - if (!m_readerInterface->dynamicResult(resultName, RiaPorosityModel::MATRIX_MODEL, i, &values)) + if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, i, &values)) { resultLoadingSucess = false; } @@ -402,7 +402,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result m_cellResults->cellScalarResults(scalarResultIndex).resize(1); std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[0]; - if (!m_readerInterface->staticResult(resultName, RiaPorosityModel::MATRIX_MODEL, &values)) + if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) { resultLoadingSucess = false; } @@ -472,7 +472,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[timeStepIndex]; if (values.size() == 0) { - if (!m_readerInterface->dynamicResult(resultName, RiaPorosityModel::MATRIX_MODEL, timeStepIndex, &values)) + if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, timeStepIndex, &values)) { resultLoadingSucess = false; } @@ -483,7 +483,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi m_cellResults->cellScalarResults(scalarResultIndex).resize(1); std::vector& values = m_cellResults->cellScalarResults(scalarResultIndex)[0]; - if (!m_readerInterface->staticResult(resultName, RiaPorosityModel::MATRIX_MODEL, &values)) + if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) { resultLoadingSucess = false; } diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp index a9fab21d68..6b13d56e89 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp @@ -434,9 +434,9 @@ void RigEclipseCaseData::computeActiveCellBoundingBoxes() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel) +RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) { - if (porosityModel == RiaPorosityModel::MATRIX_MODEL) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_activeCellInfo.p(); } @@ -447,9 +447,9 @@ RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaPorosityModel::Porosity //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel) const +const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) const { - if (porosityModel == RiaPorosityModel::MATRIX_MODEL) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_activeCellInfo.p(); } @@ -460,9 +460,9 @@ const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaPorosityModel::Po //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigEclipseCaseData::setActiveCellInfo(RiaPorosityModel::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo) +void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo) { - if (porosityModel == RiaPorosityModel::MATRIX_MODEL) + if (porosityModel == RiaDefines::MATRIX_MODEL) { m_activeCellInfo = activeCellInfo; m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p()); @@ -604,9 +604,9 @@ RigFormationNames* RigEclipseCaseData::activeFormationNames() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigCaseCellResultsData* RigEclipseCaseData::results(RiaPorosityModel::PorosityModelType porosityModel) +RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) { - if (porosityModel == RiaPorosityModel::MATRIX_MODEL) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults.p(); } @@ -617,9 +617,9 @@ RigCaseCellResultsData* RigEclipseCaseData::results(RiaPorosityModel::PorosityMo //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigCaseCellResultsData* RigEclipseCaseData::results(RiaPorosityModel::PorosityModelType porosityModel) const +const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) const { - if (porosityModel == RiaPorosityModel::MATRIX_MODEL) + if (porosityModel == RiaDefines::MATRIX_MODEL) { return m_matrixModelResults.p(); } diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h index f7d18dd2e4..3ab5199d2e 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h +++ b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.h @@ -64,12 +64,12 @@ public: RigGridBase* grid(size_t index); size_t gridCount() const; - RigCaseCellResultsData* results(RiaPorosityModel::PorosityModelType porosityModel); - const RigCaseCellResultsData* results(RiaPorosityModel::PorosityModelType porosityModel) const; + RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel); + const RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel) const; - RigActiveCellInfo* activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel); - const RigActiveCellInfo* activeCellInfo(RiaPorosityModel::PorosityModelType porosityModel) const; - void setActiveCellInfo(RiaPorosityModel::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo); + RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel); + const RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel) const; + void setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo); void setActiveFormationNames(RigFormationNames* activeFormationNames); RigFormationNames* activeFormationNames(); diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index 9dc0ae7f48..c212dd2ee1 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -70,7 +70,7 @@ const RigActiveCellInfo * RigFlowDiagResults::activeCellInfo(const RigFlowDiagRe RimEclipseResultCase* eclCase; m_flowDiagSolution->firstAncestorOrThisOfType(eclCase); - return eclCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); // Todo: base on resVarAddr member + return eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); // Todo: base on resVarAddr member } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 67afb48838..edff3fc51c 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -158,7 +158,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI { using namespace Opm::FlowDiagnostics; - RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaPorosityModel::MATRIX_MODEL)->reservoirActiveCellCount()); + RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount()); caf::ProgressInfo progressInfo(8, "Calculating Flow Diagnostics"); @@ -206,7 +206,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI QStringList restartFileNames = RifEclipseOutputFileTools::filterFileNamesOfType(m_filesWithSameBaseName, ECL_RESTART_FILE); size_t restartFileCount = static_cast(restartFileNames.size()); - size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(); + size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(); if (restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount ) { @@ -241,9 +241,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI CVF_ASSERT(currentRestartData); size_t resultIndexWithMaxTimeSteps = cvf::UNDEFINED_SIZE_T; - m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(&resultIndexWithMaxTimeSteps); + m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&resultIndexWithMaxTimeSteps); - int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex); + int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex); if ( !currentRestartData->selectReportStep(reportStepNumber) ) { @@ -256,7 +256,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI Opm::FlowDiagnostics::CellSetValues sumWellFluxPrCell; { - if (m_eclipseCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->hasFlowDiagUsableFluxes()) + if (m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->hasFlowDiagUsableFluxes()) { Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph), *currentRestartData, diff --git a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp index 6c784b0a99..1b5808ac81 100644 --- a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp +++ b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp @@ -250,7 +250,7 @@ void RigReservoirBuilderMock::populateReservoir(RigEclipseCaseData* eclipseCase) addFaults(eclipseCase); // Set all cells active - RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaPorosityModel::MATRIX_MODEL); + RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL); activeCellInfo->setReservoirCellCount(eclipseCase->mainGrid()->globalCellArray().size()); for (size_t i = 0; i < eclipseCase->mainGrid()->globalCellArray().size(); i++) { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp index 2e4ece31a8..eb21009d76 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp @@ -41,7 +41,7 @@ //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName) { @@ -134,7 +134,7 @@ cvf::ref RigResultAccessorFactory::createFromUiResultName(Rig //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromNameAndType(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName, RiaDefines::ResultCatType resultType) @@ -209,7 +209,7 @@ cvf::ref RigResultAccessorFactory::createFromResultDefinition //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createNativeFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName) { @@ -237,7 +237,7 @@ cvf::ref RigResultAccessorFactory::createNativeFromUiResultNa //-------------------------------------------------------------------------------------------------- cvf::ref RigResultAccessorFactory::createFromResultIdx(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t resultIndex) { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h index 84f9b1de9f..ec87df1206 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.h @@ -41,14 +41,14 @@ public: static cvf::ref createFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName); static cvf::ref createFromNameAndType(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& uiResultName, RiaDefines::ResultCatType resultType); @@ -56,7 +56,7 @@ public: static cvf::ref createFromResultIdx(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t resultIndex); @@ -64,7 +64,7 @@ private: static cvf::ref createNativeFromUiResultName(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, const QString& resultName); diff --git a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp index a8954698f3..ba772a5837 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.cpp @@ -31,7 +31,7 @@ //-------------------------------------------------------------------------------------------------- cvf::ref RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, QString& uiResultName) { @@ -53,7 +53,7 @@ cvf::ref RigResultModifierFactory::createResultModifier(RigEc //-------------------------------------------------------------------------------------------------- cvf::ref RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t scalarResultIndex) { if ( !eclipseCase ) return NULL; diff --git a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h index e40062a5d8..9de9a938c1 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h +++ b/ApplicationCode/ReservoirDataModel/RigResultModifierFactory.h @@ -30,14 +30,14 @@ public: static cvf::ref createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, QString& uiResultName); static cvf::ref createResultModifier(RigEclipseCaseData* eclipseCase, size_t gridIndex, - RiaPorosityModel::PorosityModelType porosityModel, + RiaDefines::PorosityModelType porosityModel, size_t timeStepIndex, size_t scalarResultIndex); }; diff --git a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp index a401813952..1dc871fa6f 100644 --- a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp @@ -95,14 +95,14 @@ public: RimEclipseCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args); if (!rimCase) return true; - RiaPorosityModel::PorosityModelType porosityModel = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL; if (args.size() > 2) { QString prorosityModelString = args[2]; if (prorosityModelString.toUpper() == "FRACTURE") { - porosityModel = RiaPorosityModel::FRACTURE_MODEL; + porosityModel = RiaDefines::FRACTURE_MODEL; } } @@ -144,7 +144,7 @@ public: return true; } - static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RiaPorosityModel::PorosityModelType porosityModel, std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK, std::vector& globalCoarseningBoxIdx) + static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RiaDefines::PorosityModelType porosityModel, std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK, std::vector& globalCoarseningBoxIdx) { gridNumber.clear(); cellI.clear(); @@ -412,7 +412,7 @@ public: size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; if (rimCase && rimCase->eclipseCaseData()) { - rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); + rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T) { canFetchData = false; @@ -431,7 +431,7 @@ public: return true; } - std::vector timeStepDates = rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->timeStepDates(scalarIndexWithMaxTimeStepCount); + std::vector timeStepDates = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->timeStepDates(scalarIndexWithMaxTimeStepCount); quint64 timeStepCount = timeStepDates.size(); quint64 byteCount = sizeof(quint64) + 6 * timeStepCount * sizeof(qint32); @@ -499,7 +499,7 @@ public: size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; if (rimCase && rimCase->eclipseCaseData()) { - rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); + rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T) { canFetchData = false; @@ -518,7 +518,7 @@ public: return true; } - std::vector daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RiaPorosityModel::MATRIX_MODEL)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount); + std::vector daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount); quint64 timeStepCount = daysSinceSimulationStart.size(); quint64 byteCount = sizeof(quint64) + timeStepCount * sizeof(qint32); diff --git a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp index f7259f482c..6c25948d58 100644 --- a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp @@ -165,10 +165,10 @@ public: QString porosityModelName; porosityModelName = args[2]; - RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName.toUpper() == "FRACTURE") { - porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } if (!rimCase || !rimCase->eclipseCaseData()) @@ -336,10 +336,10 @@ public: QString porosityModelName; porosityModelName = args[2]; - RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName.toUpper() == "FRACTURE") { - porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } if (!rimCase || !rimCase->eclipseCaseData() ) diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index e1f1e8ee4a..383013f1c6 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -60,10 +60,10 @@ public: QString propertyName = args[2]; QString porosityModelName = args[3]; - RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } // Find the requested data @@ -233,10 +233,10 @@ public: return true; } - RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; @@ -383,7 +383,7 @@ public: m_bytesPerTimeStepToRead(0), m_currentTimeStepNumberToRead(0), m_invalidActiveCellCountDetected(false), - m_porosityModelEnum(RiaPorosityModel::MATRIX_MODEL) + m_porosityModelEnum(RiaDefines::MATRIX_MODEL) {} static QString commandName () { return QString("SetActiveCellProperty"); } @@ -397,7 +397,7 @@ public: if (porosityModelName == "Fracture") { - m_porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; + m_porosityModelEnum = RiaDefines::FRACTURE_MODEL; } // Find the requested data, Or create a set if we are setting data and it is not found @@ -697,7 +697,7 @@ private: size_t m_currentScalarIndex; QString m_currentPropertyName; std::vector m_requestedTimesteps; - RiaPorosityModel::PorosityModelType m_porosityModelEnum; + RiaDefines::PorosityModelType m_porosityModelEnum; quint64 m_timeStepCountToRead; quint64 m_bytesPerTimeStepToRead; @@ -724,7 +724,7 @@ public: m_bytesPerTimeStepToRead(0), m_currentTimeStepNumberToRead(0), m_invalidDataDetected(false), - m_porosityModelEnum(RiaPorosityModel::MATRIX_MODEL) + m_porosityModelEnum(RiaDefines::MATRIX_MODEL) {} static QString commandName () { return QString("SetGridProperty"); } @@ -746,7 +746,7 @@ public: if (porosityModelName == "Fracture") { - m_porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; + m_porosityModelEnum = RiaDefines::FRACTURE_MODEL; } RigGridBase* grid = rimCase->eclipseCaseData()->grid(m_currentGridIndex); @@ -1061,7 +1061,7 @@ private: size_t m_currentScalarIndex; QString m_currentPropertyName; std::vector m_requestedTimesteps; - RiaPorosityModel::PorosityModelType m_porosityModelEnum; + RiaDefines::PorosityModelType m_porosityModelEnum; quint64 m_timeStepCountToRead; quint64 m_bytesPerTimeStepToRead; @@ -1092,11 +1092,11 @@ public: } QString porosityModelName = args[2]; - RiaPorosityModel::PorosityModelType porosityModelEnum = RiaPorosityModel::MATRIX_MODEL; + RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL; if (porosityModelName == "Fracture") { - porosityModelEnum = RiaPorosityModel::FRACTURE_MODEL; + porosityModelEnum = RiaDefines::FRACTURE_MODEL; } std::vector propNames; diff --git a/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp b/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp index ec0f866e48..3a50dd2172 100644 --- a/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp +++ b/ApplicationCode/UnitTests/RifReaderEclipseOutput-Test.cpp @@ -260,7 +260,7 @@ TEST(RigReservoirTest, UnifiedTestFile) -void buildResultInfoString(RigReservoir* reservoir, RiaPorosityModel::PorosityModelType porosityModel, RiaDefines::ResultCatType resultType) +void buildResultInfoString(RigReservoir* reservoir, RiaDefines::PorosityModelType porosityModel, RiaDefines::ResultCatType resultType) { RigCaseCellResultsData* matrixResults = reservoir->results(porosityModel); { @@ -302,22 +302,22 @@ TEST(RigReservoirTest, DualPorosityTest) qDebug() << "\n\n" << "Matrix porosities, DYNAMIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaPorosityModel::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE); qDebug() << "\n\n" << "Matrix porosities, STATIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaPorosityModel::MATRIX_MODEL, RiaDefines::STATIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE); qDebug() << "\n\n" << "Fracture porosities, DYNAMIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaPorosityModel::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE); qDebug() << "\n\n" << "Fracture porosities, STATIC results" << "----------------------------------"; - buildResultInfoString(reservoir.p(), RiaPorosityModel::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE); + buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE); } diff --git a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp index 3319c10088..bc8620360b 100644 --- a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp +++ b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp @@ -374,7 +374,7 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigEclipseCaseData* eclips return; } - RiaPorosityModel::PorosityModelType porosityModel = resultColors->porosityModel(); + RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel(); if (resultColors->isTernarySaturationSelected()) { RimReservoirCellResultsStorage* gridCellResults = resultColors->currentGridCellResults(); @@ -537,7 +537,7 @@ QString RiuResultTextBuilder::cellEdgeResultDetails() adjustedTimeStep = 0; } - RiaPorosityModel::PorosityModelType porosityModel = m_reservoirView->cellResult()->porosityModel(); + RiaDefines::PorosityModelType porosityModel = m_reservoirView->cellResult()->porosityModel(); cvf::ref resultAccessor = RigResultAccessorFactory::createFromResultIdx(m_reservoirView->eclipseCase()->eclipseCaseData(), m_gridIndex, porosityModel, adjustedTimeStep, resultIndex); if (resultAccessor.notNull()) { @@ -664,7 +664,7 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors) size_t sgasScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); size_t swatScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); - RiaPorosityModel::PorosityModelType porosityModel = resultColors->porosityModel(); + RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel(); cvf::ref dataAccessObjectX = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, soilScalarSetIndex); cvf::ref dataAccessObjectY = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, sgasScalarSetIndex); diff --git a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp index 58879f03b0..b1271ccf50 100644 --- a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp +++ b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp @@ -113,7 +113,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData()) { - RiaPorosityModel::PorosityModelType porosityModel = eclipseView->cellResult()->porosityModel(); + RiaDefines::PorosityModelType porosityModel = eclipseView->cellResult()->porosityModel(); std::vector timeStepDates = eclipseView->eclipseCase()->eclipseCaseData()->results(porosityModel)->timeStepDates(); From 839e3e1d00a89cdb51690136e6a5c4e3655c9f67 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 14:24:34 +0200 Subject: [PATCH 32/36] #1755 Use namespace instead of class to encapsulate structures --- ApplicationCode/Application/RiaDefines.cpp | 3 ++- ApplicationCode/Application/RiaPorosityModel.cpp | 13 ++++++++----- ApplicationCode/Application/RiaPorosityModel.h | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ApplicationCode/Application/RiaDefines.cpp b/ApplicationCode/Application/RiaDefines.cpp index 11c40806ba..8fc8a61f86 100644 --- a/ApplicationCode/Application/RiaDefines.cpp +++ b/ApplicationCode/Application/RiaDefines.cpp @@ -19,6 +19,7 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiaDefines.h" + #include "cafAppEnum.h" @@ -306,5 +307,5 @@ double RiaDefines::minimumDefaultValuePlot() //-------------------------------------------------------------------------------------------------- double RiaDefines::maximumDefaultValuePlot() { - return 100.0; + return 100.0; } diff --git a/ApplicationCode/Application/RiaPorosityModel.cpp b/ApplicationCode/Application/RiaPorosityModel.cpp index 6b93a857bd..4ca08690ec 100644 --- a/ApplicationCode/Application/RiaPorosityModel.cpp +++ b/ApplicationCode/Application/RiaPorosityModel.cpp @@ -21,11 +21,14 @@ #include "cafAppEnum.h" -template<> -void caf::AppEnum< RiaDefines::PorosityModelType >::setUp() +namespace caf { - addItem(RiaDefines::MATRIX_MODEL, "MATRIX_MODEL", "Matrix"); - addItem(RiaDefines::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture"); + template<> + void caf::AppEnum< RiaDefines::PorosityModelType >::setUp() + { + addItem(RiaDefines::MATRIX_MODEL, "MATRIX_MODEL", "Matrix"); + addItem(RiaDefines::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture"); - setDefault(RiaDefines::MATRIX_MODEL); + setDefault(RiaDefines::MATRIX_MODEL); + } } diff --git a/ApplicationCode/Application/RiaPorosityModel.h b/ApplicationCode/Application/RiaPorosityModel.h index b6694cb930..1ad3a4a1c3 100644 --- a/ApplicationCode/Application/RiaPorosityModel.h +++ b/ApplicationCode/Application/RiaPorosityModel.h @@ -21,7 +21,8 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -namespace RiaDefines { +namespace RiaDefines +{ enum PorosityModelType { MATRIX_MODEL, From 21fd00389c6f7787225faf7e128dc5cdba4ed688 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 14:55:01 +0200 Subject: [PATCH 33/36] Fixes after merge --- .../RigTofAccumulatedPhaseFractionsCalculator.cpp | 15 +++++++++------ .../RigTofAccumulatedPhaseFractionsCalculator.h | 12 +++--------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 030c0f856f..1c3d0f7575 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -18,6 +18,9 @@ #include "RigTofAccumulatedPhaseFractionsCalculator.h" +#include "RiaDefines.h" +#include "RiaPorosityModel.h" + #include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" #include "RigFlowDiagResultAddress.h" @@ -42,17 +45,17 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalcul size_t timestep) { RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData(); - RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS; + RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL; RimReservoirCellResultsStorage* gridCellResults = caseToApply->results(porosityModel); size_t scalarResultIndexSwat = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); size_t scalarResultIndexSoil = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL"); size_t scalarResultIndexSgas = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); size_t scalarResultIndexPorv = gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORV"); - const std::vector* swatResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, timestep)); - const std::vector* soilResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, timestep)); - const std::vector* sgasResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, timestep)); - const std::vector* porvResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, timestep)); + const std::vector* swatResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexSwat, timestep)); + const std::vector* soilResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexSoil, timestep)); + const std::vector* sgasResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexSgas, timestep)); + const std::vector* porvResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexPorv, timestep)); RimFlowDiagSolution* flowDiagSolution = caseToApply->defaultFlowDiagSolution(); @@ -97,7 +100,7 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract { std::map > tofAndIndexMap; - for (int i = 0; i < tofData->size(); i++) + for (int i = 0; i < static_cast(tofData->size()); i++) { std::vector vectorOfIndexes; vectorOfIndexes.push_back(i); diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index e2abcc6cb8..fd05302fd2 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -18,17 +18,11 @@ #pragma once -#include "cafPdmField.h" -#include "cafPdmObject.h" -#include "cafPdmPtrField.h" - -#include "cvfBase.h" -#include "cvfVector3.h" - -#include -#include "RimFlowDiagSolution.h" +#include +#include class RimEclipseResultCase; +class QString; //================================================================================================== /// From c1fe8a7e6c2ed282d12a4954c0704a1a98b3efa3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 15:10:08 +0200 Subject: [PATCH 34/36] #1691 Rename to RigEclipseResultInfo --- .../FileInterface/RifReaderEclipseOutput.cpp | 14 +++++++------- .../FileInterface/RifReaderEclipseOutput.h | 4 ++-- .../FileInterface/RifReaderMockModel.cpp | 8 ++++---- .../RimEclipseStatisticsCaseEvaluator.cpp | 4 ++-- .../RimIdenticalGridCaseGroup.cpp | 6 +++--- .../RimReservoirCellResultsStorage.cpp | 6 +++--- .../ReservoirDataModel/CMakeLists_files.cmake | 4 ++-- .../RigCaseCellResultsData.cpp | 18 +++++++++--------- .../RigCaseCellResultsData.h | 12 ++++++------ ...ResultInfo.cpp => RigEclipseResultInfo.cpp} | 18 +++++++++--------- ...{RigResultInfo.h => RigEclipseResultInfo.h} | 12 ++++++------ 11 files changed, 53 insertions(+), 53 deletions(-) rename ApplicationCode/ReservoirDataModel/{RigResultInfo.cpp => RigEclipseResultInfo.cpp} (81%) rename ApplicationCode/ReservoirDataModel/{RigResultInfo.h => RigEclipseResultInfo.h} (83%) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 75d1c1220f..06c5880ad0 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -30,7 +30,7 @@ #include "RigEclipseCaseData.h" #include "RigMainGrid.h" #include "RigSingleWellResultsData.h" -#include "RigResultInfo.h" +#include "RigEclipseResultInfo.h" #include "cafProgressInfo.h" @@ -647,7 +647,7 @@ void RifReaderEclipseOutput::buildMetaData() RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RiaDefines::MATRIX_MODEL); RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RiaDefines::FRACTURE_MODEL); - std::vector timeStepInfos; + std::vector timeStepInfos; // Create access object for dynamic results m_dynamicResultsAccess = createDynamicResultsAccess(); @@ -721,7 +721,7 @@ void RifReaderEclipseOutput::buildMetaData() RifEclipseOutputFileTools::findKeywordsAndItemCount(filesUsedToFindAvailableKeywords, &resultNames, &resultNamesDataItemCounts); - std::vector staticTimeStepInfo; + std::vector staticTimeStepInfo; if (!timeStepInfos.empty()) { staticTimeStepInfo.push_back(timeStepInfos.front()); @@ -1639,7 +1639,7 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid, boo std::vector filteredTimeSteps; { - std::vector filteredTimeStepInfos = createFilteredTimeStepInfos(); + std::vector filteredTimeStepInfos = createFilteredTimeStepInfos(); for (auto a : filteredTimeStepInfos) { filteredTimeSteps.push_back(a.m_date); @@ -1765,9 +1765,9 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RifReaderEclipseOutput::createFilteredTimeStepInfos() +std::vector RifReaderEclipseOutput::createFilteredTimeStepInfos() { - std::vector timeStepInfos; + std::vector timeStepInfos; if (m_dynamicResultsAccess.notNull()) { @@ -1782,7 +1782,7 @@ std::vector RifReaderEclipseOutput::createFilteredTimeStepInfos { if (this->isTimeStepIncludedByFilter(i)) { - timeStepInfos.push_back(RigTimeStepInfo(timeStepsOnFile[i], reportNumbersOnFile[i], daysSinceSimulationStartOnFile[i])); + timeStepInfos.push_back(RigEclipseTimeStepInfo(timeStepsOnFile[i], reportNumbersOnFile[i], daysSinceSimulationStartOnFile[i])); } } } diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index 08223ef4a1..9f22e99093 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -30,7 +30,7 @@ class RigGridBase; class RigMainGrid; class RigActiveCellInfo; class RigFault; -class RigTimeStepInfo; +class RigEclipseTimeStepInfo; struct RigWellResultPoint; @@ -81,7 +81,7 @@ private: QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaDefines::PorosityModelType matrixOrFracture, size_t timeStepCount) const; - std::vector createFilteredTimeStepInfos(); + std::vector createFilteredTimeStepInfos(); private: QString m_fileName; // Name of file used to start accessing Eclipse output files diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index a0b115800c..0de98cc6c7 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -22,7 +22,7 @@ #include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" -#include "RigResultInfo.h" +#include "RigEclipseResultInfo.h" //-------------------------------------------------------------------------------------------------- /// @@ -35,7 +35,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip RigCaseCellResultsData* cellResults = eclipseCase->results(RiaDefines::MATRIX_MODEL); - std::vector timeStepInfos; + std::vector timeStepInfos; { std::vector dates; std::vector days; @@ -48,7 +48,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip repNumbers.push_back(i); } - timeStepInfos = RigTimeStepInfo::createTimeStepInfos(dates, repNumbers, days); + timeStepInfos = RigEclipseTimeStepInfo::createTimeStepInfos(dates, repNumbers, days); } for (size_t i = 0; i < m_reservoirBuilder.resultCount(); i++) @@ -59,7 +59,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip if (m_reservoirBuilder.timeStepCount() == 0) return true; - std::vector staticResultTimeStepInfos; + std::vector staticResultTimeStepInfos; staticResultTimeStepInfos.push_back(timeStepInfos[0]); for (int i = 0; i < static_cast(m_reservoirBuilder.resultCount()); i++) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index ab1560c7fa..c7c8ce838b 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp @@ -24,7 +24,7 @@ #include "RigEclipseCaseData.h" #include "RigMainGrid.h" #include "RigResultAccessorFactory.h" -#include "RigResultInfo.h" +#include "RigEclipseResultInfo.h" #include "RigResultModifier.h" #include "RigResultModifierFactory.h" #include "RigStatisticsMath.h" @@ -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]->results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepInfos(0); + std::vector sourceTimeStepInfos = m_sourceCases[0]->results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepInfos(0); size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true); CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T); diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index 575e19269e..da89a633c8 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -25,7 +25,7 @@ #include "RigEclipseCaseData.h" #include "RigGridManager.h" #include "RigMainGrid.h" -#include "RigResultInfo.h" +#include "RigEclipseResultInfo.h" #include "RimCaseCollection.h" #include "RimCellEdgeColors.h" @@ -238,9 +238,9 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() { RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL; - std::vector timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0); + std::vector timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0); - const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); + const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++) { diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 5ac2627b90..c80fb9e7da 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -24,7 +24,7 @@ #include "RigCell.h" #include "RigEclipseCaseData.h" #include "RigMainGrid.h" -#include "RigResultInfo.h" +#include "RigEclipseResultInfo.h" #include "RimEclipseCase.h" #include "RimTools.h" @@ -91,7 +91,7 @@ void RimReservoirCellResultsStorage::setupBeforeSave() if (!m_cellResults) return; - const std::vector& resInfo = m_cellResults->infoForEachResultIndex(); + const std::vector& resInfo = m_cellResults->infoForEachResultIndex(); bool hasResultsToStore = false; for (size_t rIdx = 0; rIdx < resInfo.size(); ++rIdx) @@ -1496,7 +1496,7 @@ void RimReservoirCellResultsStorage::setCellResults(RigCaseCellResultsData* cell std::vector reportNumbers; // Hack: Using no report step numbers. Not really used except for Flow Diagnostics... reportNumbers.resize(resInfo->m_timeStepDates().size()); - std::vector timeStepInfos = RigTimeStepInfo::createTimeStepInfos(resInfo->m_timeStepDates(), reportNumbers, resInfo->m_daysSinceSimulationStart()); + std::vector timeStepInfos = RigEclipseTimeStepInfo::createTimeStepInfos(resInfo->m_timeStepDates(), reportNumbers, resInfo->m_daysSinceSimulationStart()); m_cellResults->setTimeStepInfos(resultIndex, timeStepInfos); diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index 4b77dc480d..26bede9c63 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -58,7 +58,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.h ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.h ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.h -${CEE_CURRENT_LIST_DIR}RigResultInfo.h +${CEE_CURRENT_LIST_DIR}RigEclipseResultInfo.h ${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.h @@ -113,7 +113,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp ${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.cpp ${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.cpp ${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.cpp -${CEE_CURRENT_LIST_DIR}RigResultInfo.cpp +${CEE_CURRENT_LIST_DIR}RigEclipseResultInfo.cpp ${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.cpp ) diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 37cea7aecb..9671e9f3ec 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -23,7 +23,7 @@ #include "RigEclipseMultiPropertyStatCalc.h" #include "RigEclipseNativeStatCalc.h" #include "RigMainGrid.h" -#include "RigResultInfo.h" +#include "RigEclipseResultInfo.h" #include "RigStatisticsDataCache.h" #include "RigStatisticsMath.h" @@ -207,7 +207,7 @@ std::vector& RigCaseCellResultsData::cellScalarResults(size_t scalarResu //-------------------------------------------------------------------------------------------------- size_t RigCaseCellResultsData::findScalarResultIndex(RiaDefines::ResultCatType type, const QString& resultName) const { - std::vector::const_iterator it; + std::vector::const_iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_resultType == type && it->m_resultName == resultName) @@ -268,7 +268,7 @@ size_t RigCaseCellResultsData::addEmptyScalarResult(RiaDefines::ResultCatType ty scalarResultIndex = this->resultCount(); m_cellScalarResults.push_back(std::vector >()); - RigResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex); + RigEclipseResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex); m_resultInfos.push_back(resInfo); // Create statistics calculator and add statistics cache object @@ -341,7 +341,7 @@ size_t RigCaseCellResultsData::addEmptyScalarResult(RiaDefines::ResultCatType ty QStringList RigCaseCellResultsData::resultNames(RiaDefines::ResultCatType resType) const { QStringList varList; - std::vector::const_iterator it; + std::vector::const_iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_resultType == resType ) @@ -475,18 +475,18 @@ std::vector RigCaseCellResultsData::reportStepNumbers(size_t scalarResultIn //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigCaseCellResultsData::timeStepInfos(size_t scalarResultIndex) const +std::vector RigCaseCellResultsData::timeStepInfos(size_t scalarResultIndex) const { if (scalarResultIndex < m_resultInfos.size()) return m_resultInfos[scalarResultIndex].m_timeStepInfos; else - return std::vector(); + return std::vector(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigCaseCellResultsData::setTimeStepInfos(size_t scalarResultIndex, const std::vector& timeStepInfos) +void RigCaseCellResultsData::setTimeStepInfos(size_t scalarResultIndex, const std::vector& timeStepInfos) { CVF_ASSERT(scalarResultIndex < m_resultInfos.size() ); @@ -621,7 +621,7 @@ bool RigCaseCellResultsData::updateResultName(RiaDefines::ResultCatType resultTy //-------------------------------------------------------------------------------------------------- bool RigCaseCellResultsData::mustBeCalculated(size_t scalarResultIndex) const { - std::vector::const_iterator it; + std::vector::const_iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_gridScalarResultIndex == scalarResultIndex) @@ -638,7 +638,7 @@ bool RigCaseCellResultsData::mustBeCalculated(size_t scalarResultIndex) const //-------------------------------------------------------------------------------------------------- void RigCaseCellResultsData::setMustBeCalculated(size_t scalarResultIndex) { - std::vector::iterator it; + std::vector::iterator it; for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it) { if (it->m_gridScalarResultIndex == scalarResultIndex) diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index 257efa26b6..2b36c7d06f 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -34,9 +34,9 @@ class RifReaderInterface; class RigActiveCellInfo; class RigMainGrid; -class RigResultInfo; +class RigEclipseResultInfo; class RigStatisticsDataCache; -class RigTimeStepInfo; +class RigEclipseTimeStepInfo; //================================================================================================== /// Class containing the results for the complete number of active cells. Both main grid and LGR's @@ -83,8 +83,8 @@ public: int reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const; std::vector reportStepNumbers(size_t scalarResultIndex) const; - std::vector timeStepInfos(size_t scalarResultIndex) const; - void setTimeStepInfos(size_t scalarResultIndex, const std::vector& timeStepInfos); + std::vector timeStepInfos(size_t scalarResultIndex) const; + void setTimeStepInfos(size_t scalarResultIndex, const std::vector& timeStepInfos); // Find or create a slot for the results @@ -109,7 +109,7 @@ public: bool updateResultName(RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName); public: - const std::vector& infoForEachResultIndex() { return m_resultInfos;} + const std::vector& infoForEachResultIndex() { return m_resultInfos;} bool mustBeCalculated(size_t scalarResultIndex) const; void setMustBeCalculated(size_t scalarResultIndex); @@ -128,7 +128,7 @@ private: cvf::Collection m_statisticsDataCache; private: - std::vector m_resultInfos; + std::vector m_resultInfos; RigMainGrid* m_ownerMainGrid; RigActiveCellInfo* m_activeCellInfo; diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp b/ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.cpp similarity index 81% rename from ApplicationCode/ReservoirDataModel/RigResultInfo.cpp rename to ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.cpp index 4e5686cd22..249ac41204 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultInfo.cpp +++ b/ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.cpp @@ -16,14 +16,14 @@ // ///////////////////////////////////////////////////////////////////////////////// -#include "RigResultInfo.h" +#include "RigEclipseResultInfo.h" #include "cvfAssert.h" //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigTimeStepInfo::RigTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart) +RigEclipseTimeStepInfo::RigEclipseTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart) : m_date(date), m_reportNumber(reportNumber), m_daysSinceSimulationStart(daysSinceSimulationStart) @@ -33,18 +33,18 @@ RigTimeStepInfo::RigTimeStepInfo(const QDateTime& date, int reportNumber, double //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigTimeStepInfo::createTimeStepInfos(std::vector dates, +std::vector RigEclipseTimeStepInfo::createTimeStepInfos(std::vector dates, std::vector reportNumbers, std::vector daysSinceSimulationStarts) { CVF_ASSERT(dates.size() == reportNumbers.size()); CVF_ASSERT(dates.size() == daysSinceSimulationStarts.size()); - std::vector timeStepInfos; + std::vector timeStepInfos; for (size_t i = 0; i < dates.size(); i++) { - timeStepInfos.push_back(RigTimeStepInfo(dates[i], reportNumbers[i], daysSinceSimulationStarts[i])); + timeStepInfos.push_back(RigEclipseTimeStepInfo(dates[i], reportNumbers[i], daysSinceSimulationStarts[i])); } return timeStepInfos; @@ -53,7 +53,7 @@ std::vector RigTimeStepInfo::createTimeStepInfos(std::vector RigResultInfo::dates() const +std::vector RigEclipseResultInfo::dates() const { std::vector values; @@ -81,7 +81,7 @@ std::vector RigResultInfo::dates() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigResultInfo::daysSinceSimulationStarts() const +std::vector RigEclipseResultInfo::daysSinceSimulationStarts() const { std::vector values; @@ -96,7 +96,7 @@ std::vector RigResultInfo::daysSinceSimulationStarts() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigResultInfo::reportNumbers() const +std::vector RigEclipseResultInfo::reportNumbers() const { std::vector values; diff --git a/ApplicationCode/ReservoirDataModel/RigResultInfo.h b/ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.h similarity index 83% rename from ApplicationCode/ReservoirDataModel/RigResultInfo.h rename to ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.h index 4ff0524811..009442e2eb 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultInfo.h +++ b/ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.h @@ -28,12 +28,12 @@ //================================================================================================== /// //================================================================================================== -class RigTimeStepInfo +class RigEclipseTimeStepInfo { public: - RigTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart); + RigEclipseTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart); - static std::vector createTimeStepInfos(std::vector dates, + static std::vector createTimeStepInfos(std::vector dates, std::vector reportNumbers, std::vector daysSinceSimulationStarts); public: @@ -46,10 +46,10 @@ public: //================================================================================================== /// //================================================================================================== -class RigResultInfo +class RigEclipseResultInfo { public: - RigResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, + RigEclipseResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, QString resultName, size_t gridScalarResultIndex); std::vector dates() const; @@ -63,5 +63,5 @@ public: QString m_resultName; size_t m_gridScalarResultIndex; - std::vector m_timeStepInfos; + std::vector m_timeStepInfos; }; From f096f78a55a69ed8b1a1b32921ff169bcb58bda7 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 15:18:20 +0200 Subject: [PATCH 35/36] Linux : Fix compile issue --- ...sTransmissibilityCalculationFeatureImp.cpp | 20 ++++++++++--------- .../ReservoirDataModel/RigCompletionData.cpp | 3 +++ .../ReservoirDataModel/RigCompletionData.h | 6 ++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp index dea68d097b..4e0a4517a8 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp @@ -18,19 +18,21 @@ #include "RicFishbonesTransmissibilityCalculationFeatureImp.h" -#include "RigEclipseCaseData.h" #include "RicExportCompletionDataSettingsUi.h" #include "RicWellPathExportCompletionDataFeature.h" -#include "RimWellPath.h" -#include "RigWellPath.h" -#include "RimFishboneWellPath.h" -#include "RimFishbonesCollection.h" + #include "RigActiveCellInfo.h" -#include "RigMainGrid.h" -#include "RimFishbonesMultipleSubs.h" -#include "RimFishboneWellPathCollection.h" -#include "RimWellPathCompletions.h" #include "RigCompletionData.h" +#include "RigEclipseCaseData.h" +#include "RigMainGrid.h" +#include "RigWellPath.h" + +#include "RimFishboneWellPath.h" +#include "RimFishboneWellPathCollection.h" +#include "RimFishbonesCollection.h" +#include "RimFishbonesMultipleSubs.h" +#include "RimWellPath.h" +#include "RimWellPathCompletions.h" //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp b/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp index 696c92ac95..ffd4dab613 100644 --- a/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp @@ -20,7 +20,10 @@ #include "RiaLogging.h" +#include "cvfAssert.h" + #include + #include // Needed for HUGE_VAL on Linux diff --git a/ApplicationCode/ReservoirDataModel/RigCompletionData.h b/ApplicationCode/ReservoirDataModel/RigCompletionData.h index 28cc2109f4..975a8f7a0a 100644 --- a/ApplicationCode/ReservoirDataModel/RigCompletionData.h +++ b/ApplicationCode/ReservoirDataModel/RigCompletionData.h @@ -18,10 +18,8 @@ #pragma once -#include "cvfBase.h" -#include "cvfObject.h" - #include + #include //================================================================================================== @@ -88,7 +86,7 @@ struct RigCompletionMetaData { //================================================================================================== /// //================================================================================================== -class RigCompletionData : public cvf::Object +class RigCompletionData { public: enum CompletionType { From a99eae7c2437648f7e21aea2be592ac2aa2abf9e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 11 Aug 2017 15:22:40 +0200 Subject: [PATCH 36/36] Linux : Fix compiler issues --- .../ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp | 4 +++- ApplicationCode/ProjectDataModel/RimView.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp index 498553ac38..5ffc10fb9d 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp @@ -669,7 +669,9 @@ void RimFishbonesMultipleSubs::computeSubLateralIndices() m_subLateralIndices.clear(); for (size_t subIndex = 0; subIndex < m_locationOfSubs().size(); ++subIndex) { - SubLateralIndex subLateralIndex{ subIndex }; + SubLateralIndex subLateralIndex; + subLateralIndex.subIndex = subIndex; + for (size_t lateralIndex = 0; lateralIndex < m_lateralCountPerSub(); ++lateralIndex) { subLateralIndex.lateralIndices.push_back(lateralIndex); diff --git a/ApplicationCode/ProjectDataModel/RimView.cpp b/ApplicationCode/ProjectDataModel/RimView.cpp index 671f29481c..6bf1f3ada9 100644 --- a/ApplicationCode/ProjectDataModel/RimView.cpp +++ b/ApplicationCode/ProjectDataModel/RimView.cpp @@ -740,7 +740,7 @@ void RimView::addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasic QDateTime currentTimeStamp; std::vector timeStamps = ownerCase()->timeStepDates(); - if (currentTimeStep() < timeStamps.size()) + if (currentTimeStep() < static_cast(timeStamps.size())) { currentTimeStamp = timeStamps[currentTimeStep()]; }