From 779ecd2aa13ed46463c6fa766911d8103efe2557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 15 Jun 2017 13:13:25 +0200 Subject: [PATCH 1/8] #1594 #1563 Use selected depth type and unit for well log plot when showing plot data --- ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index 6409efa341..6db5e7711b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -426,7 +426,14 @@ QString RimWellLogPlot::asciiDataForPlotExport() const if (curveNames.size() == 1) { - curveDepths = curveData->measuredDepthPlotValues(RimDefines::UNIT_NONE); + if (depthType() == TRUE_VERTICAL_DEPTH) + { + curveDepths = curveData->trueDepthPlotValues(depthUnit()); + } + else + { + curveDepths = curveData->measuredDepthPlotValues(depthUnit()); + } } std::vector xPlotValues = curveData->xPlotValues(); From 0d85289e7d132b1dd0a904a73885615cfc846337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 15 Jun 2017 13:36:23 +0200 Subject: [PATCH 2/8] #1563 Show plot data in order from top to bottom --- ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index 6db5e7711b..ab8c63680b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -442,9 +442,9 @@ QString RimWellLogPlot::asciiDataForPlotExport() const } - for (int i = static_cast(curveDepths.size()) - 1; i >= 0; i--) + for (size_t i = 0; i < curveDepths.size(); ++i) { - if (i == static_cast(curveDepths.size()) - 1) + if (i == 0) { if (depthType() == CONNECTION_NUMBER) out += "Connection"; else if (depthType() == MEASURED_DEPTH) out += "MD "; @@ -453,7 +453,7 @@ QString RimWellLogPlot::asciiDataForPlotExport() const for (QString name : curveNames) out += " \t" + name; out += "\n"; } - else if (curveDepths[i] == curveDepths[i+1]) + else if (curveDepths[i] == curveDepths[i-1]) { continue; } From 35a61046c32f06455c9435b3a2deadf693b28ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 15 Jun 2017 14:11:58 +0200 Subject: [PATCH 3/8] #1595 Update grid box when reloading case --- ApplicationCode/ProjectDataModel/RimEclipseCase.cpp | 1 + ApplicationCode/ProjectDataModel/RimView.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index b800d32ea3..9422143e65 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -663,6 +663,7 @@ void RimEclipseCase::reloadDataAndUpdate() RimEclipseView* reservoirView = reservoirViews()[i]; CVF_ASSERT(reservoirView); reservoirView->loadDataAndUpdate(); + reservoirView->updateGridBoxData(); } RimProject* project = RiaApplication::instance()->project(); diff --git a/ApplicationCode/ProjectDataModel/RimView.h b/ApplicationCode/ProjectDataModel/RimView.h index 098c4fdabc..cfe0839c62 100644 --- a/ApplicationCode/ProjectDataModel/RimView.h +++ b/ApplicationCode/ProjectDataModel/RimView.h @@ -169,6 +169,7 @@ public: public: virtual void loadDataAndUpdate() = 0; + void updateGridBoxData(); virtual RimCase* ownerCase() = 0; virtual caf::PdmFieldHandle* userDescriptionField() { return &name; } @@ -187,7 +188,6 @@ protected: virtual void createDisplayModel() = 0; void createHighlightAndGridBoxDisplayModel(); - void updateGridBoxData(); virtual void createPartCollectionFromSelection(cvf::Collection* parts) = 0; From bd3d060c96f1fcfa04bd8ff55f14d99a005efe45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Fri, 16 Jun 2017 17:03:25 +0200 Subject: [PATCH 4/8] #1567 Fix on patch branch --- ApplicationCode/Application/RiaApplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 15e26fd1a6..6ddcca5b8c 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -1479,14 +1479,14 @@ bool RiaApplication::parseArguments() foreach (QString caseName, caseNames) { QString caseFileNameWithExt = caseName + ".EGRID"; - if (!caf::Utils::fileExists(caseFileNameWithExt)) + if (caf::Utils::fileExists(caseFileNameWithExt)) { openEclipseCaseFromFile(caseFileNameWithExt); } else { caseFileNameWithExt = caseName + ".GRID"; - if (!caf::Utils::fileExists(caseFileNameWithExt)) + if (caf::Utils::fileExists(caseFileNameWithExt)) { openEclipseCaseFromFile(caseFileNameWithExt); } From 31bde3eb9acf7d097f1aa2dc3774ceb9713d3210 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 19 Jun 2017 10:48:47 +0200 Subject: [PATCH 5/8] #1599 Do not use file extention in getSaveFilename() as this causes issues on KDE desktop --- ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp b/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp index 05b198be5f..d884e8e9dd 100644 --- a/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp +++ b/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp @@ -146,7 +146,7 @@ void RicSnapshotViewToFileFeature::onActionTriggered(bool isChecked) startPath += "/image.png"; - QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export to File"), startPath, tr("Image files (*.bmp *.png * *.jpg)")); + QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export to File"), startPath); if (fileName.isEmpty()) { return; From b2a3116e8ff09dcb2f97470026aa950d5d29623d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Mon, 19 Jun 2017 10:54:05 +0200 Subject: [PATCH 6/8] #1622 Fix problem with space in fault include file names --- .../ProjectDataModel/RimEclipseCase.cpp | 45 +++++++++++++++++-- .../ProjectDataModel/RimEclipseCase.h | 9 +++- .../ProjectDataModel/RimEclipseResultCase.cpp | 7 +-- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index 9422143e65..ce2c15ee2b 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -76,14 +76,20 @@ RimEclipseCase::RimEclipseCase() CAF_PDM_InitField(&flipXAxis, "FlipXAxis", false, "Flip X Axis", "", "", ""); CAF_PDM_InitField(&flipYAxis, "FlipYAxis", false, "Flip Y Axis", "", "", ""); - CAF_PDM_InitFieldNoDefault(&filesContainingFaults, "FilesContainingFaults", "", "", "", ""); - filesContainingFaults.uiCapability()->setUiHidden(true); + CAF_PDM_InitFieldNoDefault(&m_filesContainingFaultsSemColSeparated, "CachedFileNamesContainingFaults", "", "", "", ""); + m_filesContainingFaultsSemColSeparated.uiCapability()->setUiHidden(true); + + // Obsolete fields + CAF_PDM_InitFieldNoDefault(&m_filesContainingFaults_OBSOLETE, "FilesContainingFaults", "", "", "", ""); + m_filesContainingFaults_OBSOLETE.xmlCapability()->setIOWritable(false); + m_filesContainingFaults_OBSOLETE.uiCapability()->setUiHidden(true); - // Obsolete field CAF_PDM_InitField(&caseName, "CaseName", QString(), "Obsolete", "", "" ,""); caseName.xmlCapability()->setIOWritable(false); caseName.uiCapability()->setUiHidden(true); + // Init + m_matrixModelResults = new RimReservoirCellResultsStorage; m_matrixModelResults.uiCapability()->setUiHidden(true); m_matrixModelResults.uiCapability()->setUiTreeChildrenHidden(true); @@ -519,6 +525,39 @@ RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::Poro +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEclipseCase::filesContainingFaults() const +{ + QString separatedPaths = m_filesContainingFaultsSemColSeparated; + QStringList pathList = separatedPaths.split(";", QString::SkipEmptyParts); + std::vector stdPathList; + + for (auto& path: pathList) stdPathList.push_back(path); + + return stdPathList; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseCase::setFilesContainingFaults(const std::vector& val) +{ + QString separatedPaths; + + for (size_t i = 0; i < val.size(); ++i) + { + const auto& path = val[i]; + separatedPaths += path; + if (!(i+1 >= val.size()) ) + { + separatedPaths += ";"; + } + } + m_filesContainingFaultsSemColSeparated = separatedPaths; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index 81cf3f1b46..cc43a21ded 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -62,8 +62,8 @@ public: caf::PdmField flipXAxis; caf::PdmField flipYAxis; - caf::PdmField > filesContainingFaults; - + std::vector filesContainingFaults() const; + void setFilesContainingFaults(const std::vector& val); bool openReserviorCase(); virtual bool openEclipseGridFile() = 0; @@ -121,8 +121,13 @@ private: QString m_timeStepFormatString; std::map m_wellToColorMap; + caf::PdmField m_filesContainingFaultsSemColSeparated; + // Obsolete fields protected: caf::PdmField caseName; +private: + caf::PdmField > m_filesContainingFaults_OBSOLETE; + }; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index 35a552fa18..89864ef12c 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -117,7 +117,7 @@ bool RimEclipseResultCase::openEclipseGridFile() return false; } - this->filesContainingFaults = readerInterface->filenamesWithFaults(); + this->setFilesContainingFaults(readerInterface->filenamesWithFaults()); this->setReservoirData( eclipseCase.p() ); } @@ -359,13 +359,14 @@ void RimEclipseResultCase::updateFilePathsFromProjectPath(const QString& newProj caseFileName = RimTools::relocateFile(caseFileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths); std::vector relocatedFaultFiles; - for (auto faultFileName : filesContainingFaults()) + const std::vector& orgFilesContainingFaults = filesContainingFaults(); + for (auto faultFileName : orgFilesContainingFaults) { QString relocatedFaultFile = RimTools::relocateFile(faultFileName, newProjectPath, oldProjectPath, &foundFile, &searchedPaths); relocatedFaultFiles.push_back(relocatedFaultFile); } - filesContainingFaults = relocatedFaultFiles; + setFilesContainingFaults(relocatedFaultFiles); #if 0 // Output the search path for debugging for (size_t i = 0; i < searchedPaths.size(); ++i) From 690d86b87604d94b6d8205b3356dd2a763b7c1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 20 Jun 2017 09:07:57 +0200 Subject: [PATCH 7/8] #1624 Update opm-flowdiagnostics-applications to c78f50897cea10ed56c7eadd1a1b23aa5ffbc56e that handles none-unified restart files --- ResInsightVersion.cmake | 2 +- .../opm/utility/ECLResultData.cpp | 31 ++++++++++++++----- .../opm/utility/ECLResultData.hpp | 4 +++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 82a02e7903..503d8d1985 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -14,7 +14,7 @@ set(ERT_GITHUB_SHA "06a39878636af0bc52582430ad0431450e51139c") set(OPM_FLOWDIAGNOSTICS_SHA "b6e59ddcd2feba450c8612a7402c9239e442c0d4") # https://github.com/OPM/opm-flowdiagnostics-applications -set(OPM_FLOWDIAGNOSTICS_APPLICATIONS_SHA "ccaaa4dd1b553e131a3051687fd615fe728b76ee") +set(OPM_FLOWDIAGNOSTICS_APPLICATIONS_SHA "c78f50897cea10ed56c7eadd1a1b23aa5ffbc56e") # https://github.com/OPM/opm-parser/blob/master/opm/parser/eclipse/Units/Units.hpp # This file was moved from opm-core to opm-parser october 2016 diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp index 8d2cff11bb..8520734519 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp @@ -992,6 +992,10 @@ private: /// of main grid's section within a view. std::string firstKeyword_; + /// True if path (or pointer) to unified restart file was passed + /// as constructor argument. + bool isUnified_; + /// Map LGR names to integral grid IDs. std::unique_ptr gridIDCache_; @@ -1021,44 +1025,55 @@ Opm::ECLRestartData::Impl::Impl(Path prefix) : prefix_ (std::move(prefix)) , result_ (openResultSet(deriveRestartPath(prefix_))) , firstKeyword_(firstFileKeyword(result_.get())) + , isUnified_ (firstKeyword_ == "SEQNUM") {} Opm::ECLRestartData::Impl::Impl(std::shared_ptr rstrt) : prefix_ (ecl_file_get_src_file(rstrt.get())) , result_ (std::move(rstrt)) , firstKeyword_(firstFileKeyword(result_.get())) + , isUnified_ (firstKeyword_ == "SEQNUM") {} Opm::ECLRestartData::Impl::Impl(const Impl& rhs) : prefix_ (rhs.prefix_) , result_ (openResultSet(deriveRestartPath(prefix_))) , firstKeyword_(firstFileKeyword(result_.get())) + , isUnified_ (rhs.isUnified_) {} Opm::ECLRestartData::Impl::Impl(Impl&& rhs) : prefix_ (std::move(rhs.prefix_)) , result_ (std::move(rhs.result_)) , firstKeyword_(std::move(rhs.firstKeyword_)) + , isUnified_ (rhs.isUnified_) {} bool Opm::ECLRestartData::Impl::selectReportStep(const int step) { - if (! ecl_file_has_report_step(*this, step)) { + if (isUnified_ && ! ecl_file_has_report_step(*this, step)) { return false; } this->gridIDCache_.reset(); if (auto* globView = ecl_file_get_global_view(*this)) { - // Ignore sequence numbers, dates, and simulation time. - const auto seqnum = -1; - const auto dates = static_cast(-1); - const auto simdays = -1.0; + if (isUnified_) { + // Set active block view to particular report step. + // Ignore sequence numbers, dates, and simulation time. + const auto seqnum = -1; + const auto dates = static_cast(-1); + const auto simdays = -1.0; - this->activeBlock_ = - ecl_file_view_add_restart_view(globView, seqnum, - step, dates, simdays); + this->activeBlock_ = + ecl_file_view_add_restart_view(globView, seqnum, + step, dates, simdays); + } else { + // Set active block view to global. + this->activeBlock_ = globView; + } + // Update grid id cache from active view. if (this->activeBlock_ != nullptr) { this->gridIDCache_ .reset(new ECLImpl::GridIDCache(this->activeBlock_)); diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp index c48b6a4645..aa101932e9 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp @@ -109,6 +109,10 @@ namespace Opm { /// step. /// /// This is needed when working with dynamic restart data. + /// If constructed from a unified restart file, this function + /// will check that the requested step is available in the + /// file. If constructed from a non-unified restart file, no + /// such check is performed. /// /// \param[in] step Report step number. /// From 9f76f851b81e116d0eb03b10805ffc51c72add90 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 21 Jun 2017 13:48:08 +0200 Subject: [PATCH 8/8] Set version number to 2017.05.2 --- ResInsightVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 503d8d1985..6305eb054d 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -1,7 +1,7 @@ set(RESINSIGHT_MAJOR_VERSION 2017) set(RESINSIGHT_MINOR_VERSION 05) -set(RESINSIGHT_INCREMENT_VERSION "1") +set(RESINSIGHT_INCREMENT_VERSION "2") # https://github.com/CRAVA/crava/tree/master/libs/nrlib