From da37687c772cc756561ce0cc074fb8acc91b38b2 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 1 Oct 2024 12:08:26 +0200 Subject: [PATCH 01/21] #11731 Detect when a group box have the same name as an existing group box Detect when a group box have the same name as an existing group box. This is not currently supported, and leads to dangling group boxes in the Property Editor. Trigger assert and crash when the situation appears. --- .../cafPdmUiFormLayoutObjectEditor.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp index 67748340a1..02731853f1 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp @@ -348,6 +348,17 @@ QMinimizePanel* caf::PdmUiFormLayoutObjectEditor::findOrCreateGroupBox( QWidget* if ( it == m_groupBoxes.end() ) { + auto newBoxIt = m_newGroupBoxes.find( groupBoxKey ); + if ( newBoxIt != m_newGroupBoxes.end() ) + { + // This error happens when the same group is added to the same parent multiple times + // https://github.com/OPM/ResInsight/issues/11731 + // Suggested approach: Make sure that all objects and groups in PdmUiOrdering have unique names. + + auto message = "Detected duplicate group box with keyword: " + groupBoxKey; + CAF_ASSERT( false && message.toStdString().data() ); + } + groupBox = new QMinimizePanel( parent ); groupBox->enableFrame( group->enableFrame() ); groupBox->setTitle( group->uiName( uiConfigName ) ); From f8ce59a4b4e22dedfad591b2b6bd2d6b74ed1774 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 1 Oct 2024 12:09:36 +0200 Subject: [PATCH 02/21] #11731 Remove creation of same groups twice in RimWellLogExtractionCurve --- .../ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp index a6e65d7221..0a74cd7e78 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp @@ -1044,7 +1044,6 @@ void RimWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::Pdm { curveDataGroup->add( &m_wellPath ); curveDataGroup->add( &m_refWellPath ); - RimWellLogCurve::defineUiOrdering( uiConfigName, uiOrdering ); } else { @@ -1062,7 +1061,6 @@ void RimWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::Pdm curveDataGroup->add( &m_geomPartId ); curveDataGroup->add( &m_wellPath ); curveDataGroup->add( &m_refWellPath ); - RimWellLogCurve::defineUiOrdering( uiConfigName, uiOrdering ); m_geomResultDefinition->uiOrdering( uiConfigName, *curveDataGroup ); } From 7d84c1190d5c86182b318e6f275ab91d69addaeb Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 1 Oct 2024 14:11:56 +0200 Subject: [PATCH 03/21] Regression Test: Find relevant objects and show them in Property Editor --- .../Application/Tools/RiaRegressionTest.cpp | 2 + .../Application/Tools/RiaRegressionTest.h | 1 + .../Tools/RiaRegressionTestRunner.cpp | 84 +++++++++++++++++++ .../Tools/RiaRegressionTestRunner.h | 2 + 4 files changed, 89 insertions(+) diff --git a/ApplicationLibCode/Application/Tools/RiaRegressionTest.cpp b/ApplicationLibCode/Application/Tools/RiaRegressionTest.cpp index 230786ac79..b5259dccbf 100644 --- a/ApplicationLibCode/Application/Tools/RiaRegressionTest.cpp +++ b/ApplicationLibCode/Application/Tools/RiaRegressionTest.cpp @@ -82,6 +82,8 @@ RiaRegressionTest::RiaRegressionTest() CAF_PDM_InitField( &appendTestsAfterTestFilter, "appendTestsAfterTestFilter", false, "Append All Tests After Test Filter" ); CAF_PDM_InitField( &invalidateExternalFilePaths, "invalidateExternalFilePaths", false, "Invalidate External File Paths" ); + CAF_PDM_InitField( &activateObjectsInPropertyEditor, "activateObjectsInPropertyEditor", false, "Activate Objects In Property Editor" ); + CAF_PDM_InitFieldNoDefault( &overridePlotEngine, "forcePlotEngine", "Force Plot Engine" ); CAF_PDM_InitField( &exportSnapshots3dViews, "exportSnapshots3dViews", true, "Export Snapshots 3D Views" ); diff --git a/ApplicationLibCode/Application/Tools/RiaRegressionTest.h b/ApplicationLibCode/Application/Tools/RiaRegressionTest.h index 4b70fa397a..f16593ef4c 100644 --- a/ApplicationLibCode/Application/Tools/RiaRegressionTest.h +++ b/ApplicationLibCode/Application/Tools/RiaRegressionTest.h @@ -52,6 +52,7 @@ class RiaRegressionTest : public caf::PdmObject caf::PdmField openReportInBrowser; caf::PdmField appendTestsAfterTestFilter; caf::PdmField invalidateExternalFilePaths; + caf::PdmField activateObjectsInPropertyEditor; caf::PdmField exportSnapshots3dViews; caf::PdmField exportSnapshotsPlots; diff --git a/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.cpp b/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.cpp index a90982ae88..13a2581a26 100644 --- a/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.cpp +++ b/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.cpp @@ -32,8 +32,14 @@ #include "Rim3dView.h" #include "RimCase.h" +#include "RimEclipseCaseCollection.h" +#include "RimEclipseResultAddress.h" +#include "RimFaultInView.h" #include "RimMainPlotCollection.h" +#include "RimOilField.h" #include "RimProject.h" +#include "RimSimWellInView.h" +#include "RimSummaryCaseMainCollection.h" #include "RiuDockWidgetTools.h" #include "RiuMainWindow.h" @@ -47,6 +53,7 @@ #include "DockManager.h" #include "cafMemoryInspector.h" +#include "cafPdmUiTreeView.h" #include "cafUtils.h" #include @@ -255,6 +262,11 @@ void RiaRegressionTestRunner::runRegressionTest() uint64_t usedMemoryBeforeClose = caf::MemoryInspector::getApplicationPhysicalMemoryUsageMiB(); + if ( regressionTestConfig.activateObjectsInPropertyEditor ) + { + RiaRegressionTestRunner::selectObjectsInProject(); + } + app->closeProject(); QApplication::processEvents(); @@ -632,6 +644,78 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution( const QDi return foldersMatchingTestFilter; } +//-------------------------------------------------------------------------------------------------- +/// Find relevant object to show in property editor. Loop through all objects in project and select them, this will activate the Property +/// Editor. Avoid RimSummaryCaseMainCollection, as this container contains all the summary addresses, and can potentially contain extremely +/// many objects +//-------------------------------------------------------------------------------------------------- +void RiaRegressionTestRunner::selectObjectsInProject() +{ + auto project = RimProject::current(); + if ( !project ) return; + + std::vector baseObjects; + + auto oilField = project->activeOilField(); + + std::vector fields = oilField->fields(); + for ( auto f : fields ) + { + std::vector childObjects = f->children(); + for ( auto childObject : childObjects ) + { + // Skip RimSummaryCaseMainCollection, as this container contains all the summary addresses, and can potentially contain extemely + // many objects + if ( dynamic_cast( childObject ) != nullptr ) + { + continue; + } + + caf::PdmObject* pdmObjectChild = dynamic_cast( childObject ); + if ( pdmObjectChild ) + { + baseObjects.push_back( pdmObjectChild ); + } + } + } + + baseObjects.push_back( project->mainPlotCollection() ); + + std::vector allObjects; + for ( auto baseObj : baseObjects ) + { + auto objectsForSelection = baseObj->descendantsIncludingThisOfType(); + + allObjects.insert( allObjects.end(), objectsForSelection.begin(), objectsForSelection.end() ); + } + + QApplication::processEvents( QEventLoop::ExcludeUserInputEvents ); + + auto mainWindow = RiuMainWindow::instance(); + auto plotMainWindow = RiuPlotMainWindow::instance(); + + for ( auto obj : allObjects ) + { + if ( dynamic_cast( obj ) ) continue; + if ( dynamic_cast( obj ) ) continue; + if ( dynamic_cast( obj ) ) continue; + + if ( auto treeView = mainWindow->getTreeViewWithItem( obj ) ) + { + treeView->selectItems( { obj } ); + + QApplication::processEvents( QEventLoop::ExcludeUserInputEvents ); + } + + if ( auto treeView = plotMainWindow->getTreeViewWithItem( obj ) ) + { + treeView->selectItems( { obj } ); + + QApplication::processEvents( QEventLoop::ExcludeUserInputEvents ); + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.h b/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.h index cf10faa09b..7ae23b2ec7 100644 --- a/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.h +++ b/ApplicationLibCode/Application/Tools/RiaRegressionTestRunner.h @@ -70,6 +70,8 @@ class RiaRegressionTestRunner static QString diff2htmlHeaderText( const QString& testRootPath ); QFileInfoList subDirectoriesForTestExecution( const QDir& directory ); + static void selectObjectsInProject(); + private: QString m_rootPath; QStringList m_testFilter; From 2bad8e89ce6f9597a527767d05ba6aecb86370be Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 2 Oct 2024 09:35:21 +0200 Subject: [PATCH 04/21] #11737 Set Unknown as the default type for CONFAC RFT segment results are accessed using a category, either Annulus, Device, Tubing or Unknown. Set the category for CONFAC to Unknown. --- .../WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp index a63a82e1ce..44088e39f7 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp @@ -261,7 +261,7 @@ void RicNewRftSegmentWellLogPlotFeature::appendConnectionFactorTrack( RimWellLog // Connection factor data can be found in the tubing, device and annulus branches. // Search for data ordered by annulus, device and tubing. - RiaDefines::RftBranchType branchType = RiaDefines::RftBranchType::RFT_ANNULUS; + RiaDefines::RftBranchType branchType = RiaDefines::RftBranchType::RFT_UNKNOWN; bool foundData = false; if ( RicWellLogTools::hasData( resultName, wellName, branchType, summaryCase ) ) { From ea85dca234053ea3fee6b33ed988d67068126a60 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 2 Oct 2024 09:37:33 +0200 Subject: [PATCH 05/21] #11735 Use static well path geometry if no simulation well data is available Crash when creating intersection on a simulation well no well data is present at time step --- .../ReservoirDataModel/RigMswCenterLineCalculator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/ReservoirDataModel/RigMswCenterLineCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/RigMswCenterLineCalculator.cpp index b5bc81933c..e1f2dde911 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigMswCenterLineCalculator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigMswCenterLineCalculator.cpp @@ -74,7 +74,7 @@ std::vector { const RigWellResultFrame* wellFramePtr = nullptr; - if ( timeStepIndex < 0 ) + if ( timeStepIndex < 0 || !wellResults->hasWellResult( timeStepIndex ) ) { wellFramePtr = wellResults->staticWellResultFrame(); } From 0a44f0f6aec55eec240a0f4879cce674b66854d7 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 2 Oct 2024 09:55:14 +0200 Subject: [PATCH 06/21] Bump to 2024.09.1 --- ResInsightVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index e965c61016..988789e127 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -1,7 +1,7 @@ set(RESINSIGHT_MAJOR_VERSION 2024) set(RESINSIGHT_MINOR_VERSION 09) -set(RESINSIGHT_PATCH_VERSION 0) +set(RESINSIGHT_PATCH_VERSION 1) # Opional text with no restrictions #set(RESINSIGHT_VERSION_TEXT "-dev") From f6ab2f92d344b7e5b695df649a38061eb0d784e4 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 14 Oct 2024 15:05:06 +0200 Subject: [PATCH 07/21] Python: Adjust pinning to be compatible with ortools ortools is used in the Komodo environment. This environment is not compatible with libprotoc 27 and newer. Use pinning to limit version of libprotoc<27. Add dependency on typing_extensions --- .github/workflows/ResInsightWithCache.yml | 2 +- GrpcInterface/Python/build-requirements.txt | 8 ++++++++ GrpcInterface/Python/setup.py.cmake | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 GrpcInterface/Python/build-requirements.txt diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index 81de5064ad..711407d292 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -91,7 +91,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r GrpcInterface/Python/dev-requirements.txt + pip install -r GrpcInterface/Python/build-requirements.txt - name: Use CMake uses: lukka/get-cmake@latest diff --git a/GrpcInterface/Python/build-requirements.txt b/GrpcInterface/Python/build-requirements.txt new file mode 100644 index 0000000000..6f830264f8 --- /dev/null +++ b/GrpcInterface/Python/build-requirements.txt @@ -0,0 +1,8 @@ +grpcio +grpcio-tools<1.64 # to make sure we use libprotoc 26.1, to display version info use 'python -m grpc_tools.protoc --version' +protobuf>=5.26.1,<5.27 # use same requirements as ortools https://github.com/google/or-tools/blob/stable/ortools/python/setup.py.in +wheel +typing-extensions +pytest +setuptools>=70.0.0 # not directly required, pinned by Snyk to avoid a vulnerability +packaging>=22.0 # https://github.com/pypa/setuptools/issues/4483 \ No newline at end of file diff --git a/GrpcInterface/Python/setup.py.cmake b/GrpcInterface/Python/setup.py.cmake index a82135abbb..bd5f49adf5 100644 --- a/GrpcInterface/Python/setup.py.cmake +++ b/GrpcInterface/Python/setup.py.cmake @@ -6,7 +6,7 @@ with open('README.md') as f: with open('LICENSE') as f: license = f.read() -RIPS_DIST_VERSION = '2' +RIPS_DIST_VERSION = '3' setup( name='rips', @@ -19,6 +19,6 @@ setup( license=license, packages=['rips'], package_data={'rips': ['py.typed', '*.py', 'generated/*.py', 'PythonExamples/*.py', 'tests/*.py']}, - install_requires=['grpcio', 'protobuf', 'wheel'], + install_requires=['grpcio', 'protobuf', 'wheel', 'typing_extensions'], python_requires='>=3.8', ) From 4f8619d38cd1db530e40481f93fd89769121a6d1 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 21 Oct 2024 13:50:17 +0200 Subject: [PATCH 08/21] #11798 Use type definition from ClipperLib to avoid overflow When converting a cvf::Vec3d to an integer vector, the platform int type was used as an intermediate variable. This caused overflow for large double values. --- .../ReservoirDataModel/RigCellGeometryTools.cpp | 7 ++++--- ApplicationLibCode/UnitTests/RigCellGeometryTools-Test.cpp | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ApplicationLibCode/ReservoirDataModel/RigCellGeometryTools.cpp b/ApplicationLibCode/ReservoirDataModel/RigCellGeometryTools.cpp index 3c078d9188..0f36b5cbb8 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCellGeometryTools.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCellGeometryTools.cpp @@ -407,9 +407,10 @@ double clipperConversionFactor = 10000; // For transform to clipper int ClipperLib::IntPoint toClipperPoint( const cvf::Vec3d& cvfPoint ) { - int xInt = cvfPoint.x() * clipperConversionFactor; - int yInt = cvfPoint.y() * clipperConversionFactor; - int zInt = cvfPoint.z() * clipperConversionFactor; + ClipperLib::cInt xInt = cvfPoint.x() * clipperConversionFactor; + ClipperLib::cInt yInt = cvfPoint.y() * clipperConversionFactor; + ClipperLib::cInt zInt = cvfPoint.z() * clipperConversionFactor; + return ClipperLib::IntPoint( xInt, yInt, zInt ); } diff --git a/ApplicationLibCode/UnitTests/RigCellGeometryTools-Test.cpp b/ApplicationLibCode/UnitTests/RigCellGeometryTools-Test.cpp index 9a88034e67..67c5789bb7 100644 --- a/ApplicationLibCode/UnitTests/RigCellGeometryTools-Test.cpp +++ b/ApplicationLibCode/UnitTests/RigCellGeometryTools-Test.cpp @@ -566,9 +566,9 @@ double clipperConversionFactor2 = 10000; // For transform to clipper int ClipperLib::IntPoint toClipperEdgePoint( const cvf::Vec3d& cvfPoint ) { - int xInt = cvfPoint.x() * clipperConversionFactor2; - int yInt = cvfPoint.y() * clipperConversionFactor2; - int zInt = cvfPoint.z(); + ClipperLib::cInt xInt = cvfPoint.x() * clipperConversionFactor2; + ClipperLib::cInt yInt = cvfPoint.y() * clipperConversionFactor2; + ClipperLib::cInt zInt = cvfPoint.z(); return ClipperLib::IntPoint( xInt, yInt, zInt ); } From d10cce4ead92dfbe488350f980b1d47b70245a0a Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 23 Oct 2024 13:24:35 +0200 Subject: [PATCH 09/21] Use hash of input do control if calculation is required Add hash functions Add serial number to SummaryReaderInterface Add hash for RimSummaryCase Use hash based on input parameters to control caching of data in RimEnsembleStatisticsCase::calculate and RimEnsembleCurveSet::appendOptionItemsForSummaryAddresses --- .../Application/Tools/CMakeLists_files.cmake | 1 + .../Application/Tools/RiaHashTools.h | 90 +++++++++++++++++++ .../RifSummaryReaderInterface.cpp | 19 ++++ .../FileInterface/RifSummaryReaderInterface.h | 8 ++ .../Summary/RimEnsembleCurveSet.cpp | 40 ++++++--- .../Summary/RimEnsembleCurveSet.h | 5 +- .../Summary/RimEnsembleStatisticsCase.cpp | 6 ++ .../Summary/RimEnsembleStatisticsCase.h | 1 + .../Summary/RimSummaryCase.cpp | 9 ++ .../ProjectDataModel/Summary/RimSummaryCase.h | 25 ++++++ 10 files changed, 190 insertions(+), 14 deletions(-) create mode 100644 ApplicationLibCode/Application/Tools/RiaHashTools.h diff --git a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake index 94101bebfe..1b7234dedb 100644 --- a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake @@ -55,6 +55,7 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTextTools.h ${CMAKE_CURRENT_LIST_DIR}/RiaFileLogger.h ${CMAKE_CURRENT_LIST_DIR}/RiaProjectBackupTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaHashTools.h ) set(SOURCE_GROUP_SOURCE_FILES diff --git a/ApplicationLibCode/Application/Tools/RiaHashTools.h b/ApplicationLibCode/Application/Tools/RiaHashTools.h new file mode 100644 index 0000000000..8a50f80ed3 --- /dev/null +++ b/ApplicationLibCode/Application/Tools/RiaHashTools.h @@ -0,0 +1,90 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2024- Equinor 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 +#include +#include + +//================================================================================================== +// +// +// +//================================================================================================== +namespace RiaHashTools +{ +//-------------------------------------------------------------------------------------------------- +/// Variadic template function to combine multiple parameters into a single hash +//-------------------------------------------------------------------------------------------------- +template +void combineHash( size_t& seed, const T& value ) +{ + // Based on https://www.boost.org/doc/libs/1_84_0/libs/container_hash/doc/html/hash.html#notes_hash_combine + seed ^= std::hash()( value ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +template +void combineHash( size_t& seed, const T& value, const Rest&... rest ) +{ + combineHash( seed, value ); + ( combineHash( seed, rest ), ... ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +template +void combineHash( size_t& seed, const Range& range, const Rest&... rest ) +{ + for ( const auto& elem : range ) + { + combineHash( seed, elem ); + } + ( combineHash( seed, rest ), ... ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +template +size_t hash( const Args&... args ) +{ + size_t seed = 0; + combineHash( seed, args... ); + return seed; +} + +//-------------------------------------------------------------------------------------------------- +/// Generic hash function for any range +//-------------------------------------------------------------------------------------------------- +template +size_t hash( const Range& range ) +{ + size_t seed = 0; + for ( const auto& elem : range ) + { + combineHash( seed, elem ); + } + return seed; +} + +}; // namespace RiaHashTools diff --git a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp index 01ee289adb..51c9be4541 100644 --- a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp +++ b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp @@ -22,6 +22,8 @@ #include +int RifSummaryReaderInterface::m_nextSerialNumber = 0; + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -56,6 +58,23 @@ void RifSummaryReaderInterface::buildMetaData() { } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RifSummaryReaderInterface::serialNumber() const +{ + return m_serialNumber; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifSummaryReaderInterface::RifSummaryReaderInterface() +{ +#pragma omp critical + m_serialNumber = m_nextSerialNumber++; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h index efdd2973c6..2f86ae86af 100644 --- a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h +++ b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h @@ -37,6 +37,8 @@ class QDateTime; class RifSummaryReaderInterface : public cvf::Object { public: + RifSummaryReaderInterface(); + bool hasAddress( const RifEclipseSummaryAddress& resultAddress ) const; const std::set& allResultAddresses() const; @@ -53,7 +55,13 @@ class RifSummaryReaderInterface : public cvf::Object virtual void buildMetaData(); + int serialNumber() const; + protected: std::set m_allResultAddresses; // Result and error addresses std::set m_allErrorAddresses; // Error addresses + +private: + static int m_nextSerialNumber; + int m_serialNumber; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 43b11fb23e..bc87307834 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -20,6 +20,7 @@ #include "RiaColorTools.h" #include "RiaGuiApplication.h" +#include "RiaHashTools.h" #include "RiaPreferences.h" #include "RiaQDateTimeTools.h" #include "RiaResultNames.h" @@ -116,6 +117,7 @@ CAF_PDM_SOURCE_INIT( RimEnsembleCurveSet, "RimEnsembleCurveSet" ); //-------------------------------------------------------------------------------------------------- RimEnsembleCurveSet::RimEnsembleCurveSet() : filterChanged( this ) + , m_hash( 0 ) { CAF_PDM_InitObject( "Ensemble Curve Set", ":/EnsembleCurveSet16x16.png" ); @@ -1664,26 +1666,38 @@ void RimEnsembleCurveSet::appendOptionItemsForSummaryAddresses( QList addrSet; - for ( RimSummaryCase* summaryCase : summaryCaseGroup->allSummaryCases() ) + auto allSummaryCases = summaryCaseGroup->allSummaryCases(); + auto hash = RiaHashTools::hash( allSummaryCases ); + if ( hash != m_hash ) { - RifSummaryReaderInterface* reader = summaryCase->summaryReader(); - const std::set& addrs = reader ? reader->allResultAddresses() : std::set(); + m_hash = hash; - for ( auto& addr : addrs ) + std::set addressesForEnsemble; + for ( RimSummaryCase* summaryCase : allSummaryCases ) { - addrSet.insert( addr ); + if ( !summaryCase ) continue; + + if ( auto reader = summaryCase->summaryReader() ) + { + const auto& addrs = reader->allResultAddresses(); + addressesForEnsemble.insert( addrs.begin(), addrs.end() ); + } } - } - for ( auto& addr : addrSet ) - { - std::string name = addr.uiText(); - QString s = QString::fromStdString( name ); - options->push_back( caf::PdmOptionItemInfo( s, QVariant::fromValue( addr ) ) ); + m_cachedAddressOptions.clear(); + + for ( const auto& addr : addressesForEnsemble ) + { + std::string name = addr.uiText(); + QString s = QString::fromStdString( name ); + m_cachedAddressOptions.push_back( caf::PdmOptionItemInfo( s, QVariant::fromValue( addr ) ) ); + } + + m_cachedAddressOptions.push_front( + caf::PdmOptionItemInfo( RiaResultNames::undefinedResultName(), QVariant::fromValue( RifEclipseSummaryAddress() ) ) ); } - options->push_front( caf::PdmOptionItemInfo( RiaResultNames::undefinedResultName(), QVariant::fromValue( RifEclipseSummaryAddress() ) ) ); + options->append( m_cachedAddressOptions ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index fc6639a258..39bf60e198 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -180,7 +180,7 @@ class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInt void appendColorGroup( caf::PdmUiOrdering& uiOrdering ); - static void appendOptionItemsForSummaryAddresses( QList* options, RimSummaryEnsemble* summaryCaseGroup ); + void appendOptionItemsForSummaryAddresses( QList* options, RimSummaryEnsemble* summaryCaseGroup ); const RimEnsembleCurveFilterCollection* curveFilters() const; @@ -317,4 +317,7 @@ class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInt bool m_disableStatisticCurves; bool m_isCurveSetFiltered; + + QList m_cachedAddressOptions; + size_t m_hash; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp index ee8416675a..2bf2bba6e6 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp @@ -20,6 +20,7 @@ #include "RiaCurveMerger.h" #include "RiaSummaryTools.h" +#include "RiaHashTools.h" #include "RiaTimeHistoryCurveResampler.h" #include "RigStatisticsMath.h" @@ -129,6 +130,11 @@ void RimEnsembleStatisticsCase::calculate( const std::vector& s const RifEclipseSummaryAddress& inputAddress, bool includeIncompleteCurves ) { + auto hash = RiaHashTools::hash( summaryCases, inputAddress.toEclipseTextAddress(), includeIncompleteCurves ); + if ( hash == m_hash ) return; + + m_hash = hash; + clearData(); if ( !inputAddress.isValid() ) return; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.h index 9b3fcc518f..ba819986cb 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.h @@ -64,4 +64,5 @@ class RimEnsembleStatisticsCase : public RimSummaryCase, public RifSummaryReader std::vector m_meanData; caf::PdmPointer m_firstSummaryCase; + size_t m_hash = 0; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp index a933d94079..ee6dff4086 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp @@ -224,6 +224,15 @@ void RimSummaryCase::buildChildNodes() m_dataVectorFolders->updateFolderStructure( addresses, m_caseId ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimSummaryCase::serialNumber() +{ + auto reader = summaryReader(); + return reader ? reader->serialNumber() : -1; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.h index a01a47b24c..278ca33392 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.h @@ -18,6 +18,9 @@ #pragma once #include "RiaDefines.h" + +#include "RiaHashTools.h" + #include "RigCaseRealizationParameters.h" #include "RimCaseDisplayNameTools.h" @@ -103,6 +106,7 @@ class RimSummaryCase : public caf::PdmObject private: void buildChildNodes(); + int serialNumber(); protected: caf::PdmField m_displayName; @@ -121,4 +125,25 @@ class RimSummaryCase : public caf::PdmObject caf::PdmField m_useAutoShortName_OBSOLETE; static const QString DEFAULT_DISPLAY_NAME; + + friend struct std::hash; +}; + +// Custom specialization of std::hash injected in namespace std +// NB! Note that this is a specialization of std::hash for a pointer type +template <> +struct std::hash +{ + std::size_t operator()( RimSummaryCase* s ) const noexcept + { + if ( !s ) return 0; + + auto serialNumber = s->serialNumber(); + if ( serialNumber != -1 ) + { + return RiaHashTools::hash( serialNumber ); + } + + return RiaHashTools::hash( s->summaryHeaderFilename().toStdString() ); + } }; From 417acc9d0593b9dd82a2ec0eee0759abf6940e3d Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 23 Oct 2024 09:18:21 +0200 Subject: [PATCH 10/21] Improve performance when computing interpolated values Use OpenMP when computing interpolated values for a curve. Use std::lower_bound to quickly find a relevant start index, avoids starting from 0 each time. --- .../Application/Tools/RiaCurveMerger.inl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaCurveMerger.inl b/ApplicationLibCode/Application/Tools/RiaCurveMerger.inl index d15ef00e57..d0e9fe06fd 100644 --- a/ApplicationLibCode/Application/Tools/RiaCurveMerger.inl +++ b/ApplicationLibCode/Application/Tools/RiaCurveMerger.inl @@ -154,12 +154,14 @@ void RiaCurveMerger::computeInterpolatedValues( bool includeValuesFr std::vector& curveValues = m_interpolatedValuesForAllCurves[curveIdx]; curveValues.resize( dataValueCount ); - for ( size_t valueIndex = 0; valueIndex < dataValueCount; valueIndex++ ) +#pragma omp parallel for + for ( int valueIndex = 0; valueIndex < static_cast( dataValueCount ); valueIndex++ ) { double interpolValue = interpolatedYValue( m_allXValues[valueIndex], m_originalValues[curveIdx].first, m_originalValues[curveIdx].second ); if ( !RiaCurveDataTools::isValidValue( interpolValue, false ) ) { +#pragma omp critical accumulatedValidValues[valueIndex] = HUGE_VAL; } @@ -235,11 +237,21 @@ double RiaCurveMerger::interpolatedYValue( const XValueType& const std::vector& xValues, const std::vector& yValues ) { + if ( xValues.empty() ) return HUGE_VAL; if ( yValues.size() != xValues.size() ) return HUGE_VAL; const bool removeInterpolatedValues = false; - for ( size_t firstI = 0; firstI < xValues.size(); firstI++ ) + // Use lower_bound to find the first element that is not less than the interpolation value using a threshold that is larger than the + // threshold used in XComparator::equals + XValueType threshold = 1.0e-6 * xValues.back(); + auto it = std::lower_bound( xValues.begin(), xValues.end(), interpolationXValue - threshold ); + if ( it == xValues.end() ) return HUGE_VAL; + + size_t startIndex = it - xValues.begin(); + if ( startIndex > 0 ) startIndex--; + + for ( size_t firstI = startIndex; firstI < xValues.size(); firstI++ ) { if ( XComparator::equals( xValues.at( firstI ), interpolationXValue ) ) { From e476c1c0c5ad660a07bc2225ab6fb6004dc56e38 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 23 Oct 2024 13:29:05 +0200 Subject: [PATCH 11/21] Bump version --- ResInsightVersion.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 988789e127..487aec949a 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -1,11 +1,11 @@ set(RESINSIGHT_MAJOR_VERSION 2024) set(RESINSIGHT_MINOR_VERSION 09) -set(RESINSIGHT_PATCH_VERSION 1) +set(RESINSIGHT_PATCH_VERSION 2) # Opional text with no restrictions #set(RESINSIGHT_VERSION_TEXT "-dev") -#set(RESINSIGHT_VERSION_TEXT "-RC") +set(RESINSIGHT_VERSION_TEXT "-RC-01") # Optional text # Must be unique and increasing within one combination of major/minor/patch version From c0532cb96cbe882f04afa29403ef089a9bac90c7 Mon Sep 17 00:00:00 2001 From: magnesj <1793152+magnesj@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:30:47 +0000 Subject: [PATCH 12/21] Fixes by clang-format --- .../ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp index 2bf2bba6e6..b3659bc082 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatisticsCase.cpp @@ -19,8 +19,8 @@ #include "RimEnsembleStatisticsCase.h" #include "RiaCurveMerger.h" -#include "RiaSummaryTools.h" #include "RiaHashTools.h" +#include "RiaSummaryTools.h" #include "RiaTimeHistoryCurveResampler.h" #include "RigStatisticsMath.h" From 275a8b728433fd32c8f280d38c43e3386b48808c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 21 Oct 2024 09:29:18 +0200 Subject: [PATCH 13/21] Align the search expression with sumo explorer --- .../Tools/Cloud/RiaSumoConnector.cpp | 201 +++++++++++------- 1 file changed, 123 insertions(+), 78 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/Cloud/RiaSumoConnector.cpp b/ApplicationLibCode/Application/Tools/Cloud/RiaSumoConnector.cpp index 278d5ba6af..1749252556 100644 --- a/ApplicationLibCode/Application/Tools/Cloud/RiaSumoConnector.cpp +++ b/ApplicationLibCode/Application/Tools/Cloud/RiaSumoConnector.cpp @@ -172,27 +172,68 @@ void RiaSumoConnector::requestEnsembleByCasesId( const SumoCaseId& caseId ) { requestTokenBlocking(); - QString payloadTemplate = R"( + // See the following file for query definition + // https://github.com/equinor/fmu-sumo/blob/main/src/fmu/sumo/explorer/objects/case.py -{ - "query": { - "bool": { - "filter": [ - {"term":{"_sumo.parent_object.keyword":"%1"}} - ] - } - }, - "aggs": { - "aggs_columns": { - "terms": { "field": "fmu.iteration.name.keyword", "size": 5 } - } - }, - "track_total_hits":true, - "size":20, - "from":0, - "_source": false -} + QString payloadTemplate = R"( + { + "query": { + "term": { + "fmu.case.uuid.keyword": "%1" + } + }, + "aggs": { + "iteration_uuids": { + "terms": { + "field": "fmu.iteration.uuid.keyword", + "size": 100 + } + }, + "iteration_names": { + "terms": { + "field": "fmu.iteration.name.keyword", + "size": 100 + } + }, + "data_types": { + "terms": { + "field": "class.keyword", + "size": 100 + } + }, + "iterations": { + "terms": { + "field": "fmu.iteration.uuid.keyword", + "size": 100 + }, + "aggs": { + "iteration_name": { + "terms": { + "field": "fmu.iteration.name.keyword", + "size": 100 + } + }, + "numreal": { + "cardinality": { + "field": "fmu.realization.id" + } + }, + "maxreal": { + "max": { + "field": "fmu.realization.id" + } + }, + "minreal": { + "min": { + "field": "fmu.realization.id" + } + } + } + } + }, + "size": 0 + } )"; QNetworkRequest m_networkRequest; @@ -214,6 +255,45 @@ void RiaSumoConnector::requestEnsembleByCasesId( const SumoCaseId& caseId ) } ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSumoConnector::parseEnsembleNames( QNetworkReply* reply, const SumoCaseId& caseId ) +{ + // See the following file for parsing of the reply + // https://github.com/equinor/fmu-sumo/blob/main/src/fmu/sumo/explorer/objects/case.py + + QByteArray result = reply->readAll(); + reply->deleteLater(); + + if ( reply->error() == QNetworkReply::NoError ) + { + m_ensembleNames.clear(); + + QJsonDocument doc = QJsonDocument::fromJson( result ); + QJsonObject jsonObj = doc.object(); + QJsonObject aggregationsObject = jsonObj["aggregations"].toObject(); + QJsonObject aggregationColumnsObject = aggregationsObject["iteration_names"].toObject(); + + QJsonArray bucketsArray = aggregationColumnsObject["buckets"].toArray(); + foreach ( const QJsonValue& bucket, bucketsArray ) + { + QJsonObject bucketObj = bucket.toObject(); + auto ensembleName = bucketObj["key"].toString(); + + m_ensembleNames.push_back( { caseId, ensembleName } ); + } + + RiaLogging::debug( QString( "Ensemble count : %1" ).arg( m_ensembleNames.size() ) ); + } + else + { + RiaLogging::error( QString( "Request ensemble names failed: : '%s'" ).arg( reply->errorString() ) ); + } + + emit ensembleNamesFinished(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -720,42 +800,12 @@ void RiaSumoConnector::parseAssets( QNetworkReply* reply ) RiaLogging::info( QString( "Asset: %1" ).arg( a.name ) ); } } - emit assetsFinished(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiaSumoConnector::parseEnsembleNames( QNetworkReply* reply, const SumoCaseId& caseId ) -{ - QByteArray result = reply->readAll(); - reply->deleteLater(); - - if ( reply->error() == QNetworkReply::NoError ) + else { - m_ensembleNames.clear(); - - QJsonDocument doc = QJsonDocument::fromJson( result ); - QJsonObject jsonObj = doc.object(); - auto keys_1 = jsonObj.keys(); - - auto aggregationsObject = jsonObj["aggregations"].toObject(); - - QJsonObject aggregationColumnsObject = aggregationsObject["aggs_columns"].toObject(); - auto keys_2 = aggregationColumnsObject.keys(); - - QJsonArray bucketsArray = aggregationColumnsObject["buckets"].toArray(); - foreach ( const QJsonValue& bucket, bucketsArray ) - { - QJsonObject bucketObj = bucket.toObject(); - auto keys_3 = bucketObj.keys(); - - auto ensembleName = bucketObj["key"].toString(); - m_ensembleNames.push_back( { caseId, ensembleName } ); - } + RiaLogging::error( QString( "Request assets failed: : '%s'" ).arg( reply->errorString() ) ); } - emit ensembleNamesFinished(); + emit assetsFinished(); } //-------------------------------------------------------------------------------------------------- @@ -768,33 +818,31 @@ void RiaSumoConnector::parseCases( QNetworkReply* reply ) if ( reply->error() == QNetworkReply::NoError ) { - QJsonDocument doc = QJsonDocument::fromJson( result ); - QJsonObject jsonObj = doc.object(); - QJsonObject rootHits = jsonObj["hits"].toObject(); - - QJsonArray hitsObjects = rootHits["hits"].toArray(); + QJsonDocument doc = QJsonDocument::fromJson( result ); + QJsonObject jsonObj = doc.object(); + QJsonObject rootHits = jsonObj["hits"].toObject(); + QJsonArray hitsObjects = rootHits["hits"].toArray(); m_cases.clear(); foreach ( const QJsonValue& value, hitsObjects ) { QJsonObject resultObj = value.toObject(); - auto keys_1 = resultObj.keys(); - - QJsonObject sourceObj = resultObj["_source"].toObject(); - auto sourceKeys = sourceObj.keys(); - - QJsonObject fmuObj = sourceObj["fmu"].toObject(); - auto fmuObjKeys = fmuObj.keys(); - - QJsonObject fmuCase = fmuObj["case"].toObject(); - auto fmuCaseKeys = fmuCase.keys(); + QJsonObject sourceObj = resultObj["_source"].toObject(); + QJsonObject fmuObj = sourceObj["fmu"].toObject(); + QJsonObject fmuCase = fmuObj["case"].toObject(); QString id = resultObj["_id"].toString(); QString kind = ""; QString fieldName = fmuCase["name"].toString(); m_cases.push_back( SumoCase{ SumoCaseId( id ), kind, fieldName } ); } + + RiaLogging::debug( QString( "Case count : %1" ).arg( m_cases.size() ) ); + } + else + { + RiaLogging::error( QString( "Request cases failed: : '%s'" ).arg( reply->errorString() ) ); } emit casesFinished(); @@ -825,6 +873,10 @@ void RiaSumoConnector::parseVectorNames( QNetworkReply* reply, const SumoCaseId& } } } + else + { + RiaLogging::error( QString( "Request vector names failed: : '%s'" ).arg( reply->errorString() ) ); + } emit vectorNamesFinished(); } @@ -846,10 +898,8 @@ void RiaSumoConnector::parseRealizationNumbers( QNetworkReply* reply, const Sumo for ( const auto& hit : hits ) { QJsonObject resultObj = hit.toObject(); - auto keys_1 = resultObj.keys(); - - auto val = resultObj.value( "key" ); - auto intValue = val.toInt(); + auto val = resultObj.value( "key" ); + auto intValue = val.toInt(); auto realizationId = QString::number( intValue ); m_realizationIds.push_back( realizationId ); @@ -884,13 +934,8 @@ void RiaSumoConnector::parseBlobIds( QNetworkReply* reply, foreach ( const QJsonValue& value, hitsObjects ) { QJsonObject resultObj = value.toObject(); - auto keys_1 = resultObj.keys(); - - QJsonObject sourceObj = resultObj["_source"].toObject(); - auto sourceKeys = sourceObj.keys(); - - QJsonObject fmuObj = sourceObj["_sumo"].toObject(); - auto fmuObjKeys = fmuObj.keys(); + QJsonObject sourceObj = resultObj["_source"].toObject(); + QJsonObject fmuObj = sourceObj["_sumo"].toObject(); auto blobName = fmuObj["blob_name"].toString(); m_blobUrl.push_back( blobName ); From cf7f00880a9595b59d361e3e1c061f896713004e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 23 Oct 2024 15:45:33 +0200 Subject: [PATCH 14/21] Add support for increase of serial number when data is assigned to a SUMO case --- .../FileInterface/RifSummaryReaderInterface.cpp | 10 +++++++++- .../FileInterface/RifSummaryReaderInterface.h | 2 ++ .../Summary/Sumo/RimSummaryCaseSumo.cpp | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp index 51c9be4541..5abb2280e1 100644 --- a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp +++ b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp @@ -69,12 +69,20 @@ int RifSummaryReaderInterface::serialNumber() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifSummaryReaderInterface::RifSummaryReaderInterface() +void RifSummaryReaderInterface::increaseSerialNumber() { #pragma omp critical m_serialNumber = m_nextSerialNumber++; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifSummaryReaderInterface::RifSummaryReaderInterface() +{ + increaseSerialNumber(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h index 2f86ae86af..cee40c9d22 100644 --- a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h +++ b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h @@ -58,6 +58,8 @@ class RifSummaryReaderInterface : public cvf::Object int serialNumber() const; protected: + void increaseSerialNumber(); + std::set m_allResultAddresses; // Result and error addresses std::set m_allErrorAddresses; // Error addresses diff --git a/ApplicationLibCode/ProjectDataModel/Summary/Sumo/RimSummaryCaseSumo.cpp b/ApplicationLibCode/ProjectDataModel/Summary/Sumo/RimSummaryCaseSumo.cpp index 9676dbacb0..6220ea82db 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/Sumo/RimSummaryCaseSumo.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/Sumo/RimSummaryCaseSumo.cpp @@ -124,6 +124,8 @@ void RimSummaryCaseSumo::setValues( const std::vector& timeSteps, { m_timeSteps = timeSteps; m_values[resultAddress] = values; + + increaseSerialNumber(); } //-------------------------------------------------------------------------------------------------- From 317c737a2291c40ff0eb4b51b7212bb578df3c9d Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 20 Oct 2024 14:24:22 +0200 Subject: [PATCH 15/21] Improve performance when creating multiple plots --- .../RiaPlotWindowRedrawScheduler.cpp | 22 ++++++++++++++ .../RiaPlotWindowRedrawScheduler.h | 4 +++ ...RicAppendSummaryPlotsForObjectsFeature.cpp | 29 +++++++++++++++++-- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp index 1f4e955dba..5133e6f579 100644 --- a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp +++ b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp @@ -146,11 +146,33 @@ void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaPlotWindowRedrawScheduler::blockScheduledUpdatesAndReplots() +{ + m_blockScheduledUpdatesAndReplots = true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaPlotWindowRedrawScheduler::unblockScheduledUpdatesAndReplots() +{ + m_blockScheduledUpdatesAndReplots = false; + startTimer( 0 ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RiaPlotWindowRedrawScheduler::slotUpdateAndReplotScheduledItemsWhenReady() { + if ( m_blockScheduledUpdatesAndReplots ) + { + return; + } + if ( caf::ProgressState::isActive() ) { startTimer( 100 ); diff --git a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.h b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.h index e07a6c8d2d..0b540c261f 100644 --- a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.h +++ b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.h @@ -48,6 +48,9 @@ class RiaPlotWindowRedrawScheduler : public QObject void clearAllScheduledUpdates(); void performScheduledUpdatesAndReplots(); + void blockScheduledUpdatesAndReplots(); + void unblockScheduledUpdatesAndReplots(); + private slots: void slotUpdateAndReplotScheduledItemsWhenReady(); @@ -64,4 +67,5 @@ private slots: std::set> m_plotWidgetsToReplot; QScopedPointer m_plotWindowUpdateTimer; + bool m_blockScheduledUpdatesAndReplots = false; }; diff --git a/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp b/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp index 6baa1de7bd..9139b82ca0 100644 --- a/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp +++ b/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp @@ -20,6 +20,7 @@ #include "RiaGuiApplication.h" #include "RiaLogging.h" +#include "RiaPlotWindowRedrawScheduler.h" #include "RiaStdStringTools.h" #include "RiaSummaryAddressAnalyzer.h" #include "RiaSummaryTools.h" @@ -68,6 +69,9 @@ void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* caf::ProgressInfo info( sumAddressCollections.size(), "Appending plots..." ); + summaryMultiPlot->startBatchAddOperation(); + RiaPlotWindowRedrawScheduler::instance()->blockScheduledUpdatesAndReplots(); + for ( auto summaryAdrCollection : sumAddressCollections ) { auto duplicatedPlots = RicSummaryPlotBuilder::duplicateSummaryPlots( plotsForOneInstance ); @@ -108,11 +112,16 @@ void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* summaryMultiPlot->addPlot( duplicatedPlot ); duplicatedPlot->resolveReferencesRecursively(); } - - duplicatedPlot->loadDataAndUpdate(); } + info.incrementProgress(); } + summaryMultiPlot->endBatchAddOperation(); + + RiaPlotWindowRedrawScheduler::instance()->clearAllScheduledUpdates(); + RiaPlotWindowRedrawScheduler::instance()->unblockScheduledUpdatesAndReplots(); + + summaryMultiPlot->loadDataAndUpdate(); summaryMultiPlot->updatePlotTitles(); } @@ -273,6 +282,13 @@ bool RicAppendSummaryPlotsForObjectsFeature::isSelectionCompatibleWithPlot( cons errorText = "Source plot must contain at least one region to be able to duplicate a selection of regions"; } } + else if ( selectionType == RimSummaryAddressCollection::CollectionContentType::NETWORK ) + { + if ( analyzer.networkNames().empty() ) + { + errorText = "Source plot must contain at least one network to be able to duplicate a selection of networks"; + } + } if ( !errorText.isEmpty() ) { @@ -294,6 +310,7 @@ std::vector std::string wellNameToMatch; std::string groupNameToMatch; + std::string networkNameToMatch; int regionToMatch = -1; int caseIdToMatch = -1; int ensembleIdToMatch = -1; @@ -317,6 +334,10 @@ std::vector { if ( !myAnalyser.regionNumbers().empty() ) regionToMatch = *( myAnalyser.regionNumbers().begin() ); } + else if ( objectType == RimSummaryAddressCollection::CollectionContentType::NETWORK ) + { + if ( !myAnalyser.networkNames().empty() ) networkNameToMatch = *( myAnalyser.networkNames().begin() ); + } else if ( objectType == RimSummaryAddressCollection::CollectionContentType::SUMMARY_CASE ) { if ( !sourcePlots.empty() ) @@ -368,6 +389,10 @@ std::vector { isMatching = true; } + else if ( !networkNameToMatch.empty() && a.networkName() == networkNameToMatch ) + { + isMatching = true; + } else if ( regionToMatch != -1 && a.regionNumber() == regionToMatch ) { isMatching = true; From cfb120ce2e382c0f50ccf6737446ba2cb47d9681 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 20 Oct 2024 14:25:00 +0200 Subject: [PATCH 16/21] Fix crash when curve data is missing --- .../ProjectDataModel/Summary/RimSummaryMultiPlot.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index 8006475053..92afd9b93c 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -1172,10 +1172,11 @@ void RimSummaryMultiPlot::updatePlotVisibility() { for ( auto curve : plot->summaryAndEnsembleCurves() ) { - auto address = curve->valuesY(); - auto maxValue = std::max_element( address.begin(), address.end() ); + auto values = curve->valuesY(); + if ( values.empty() ) continue; - if ( *maxValue > limit ) return true; + auto maxValue = std::max_element( values.begin(), values.end() ); + if ( maxValue != values.end() && ( *maxValue > limit ) ) return true; } return false; From be759a6e7eee6c1a122245a9233b3beef3239d83 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 20 Oct 2024 14:26:54 +0200 Subject: [PATCH 17/21] Improve support for network vectors Show all text if summary address contains multiple : for network addresses Consolidate replace of tokens in summary address --- .../Application/RiaSummaryCurveDefinition.cpp | 33 ++++------ .../RifEclipseSummaryAddress.cpp | 15 ++++- .../Summary/RimSummaryAddressCollection.cpp | 49 ++++++++++++++ .../Summary/RimSummaryAddressCollection.h | 4 ++ .../Summary/RimSummaryAddressModifier.cpp | 66 +++++++++++++++---- .../Summary/RimSummaryAddressModifier.h | 15 +++-- 6 files changed, 138 insertions(+), 44 deletions(-) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp index 274c2973d7..bceae459e1 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp +++ b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp @@ -22,6 +22,7 @@ #include "RifSummaryReaderInterface.h" +#include "RimSummaryAddressModifier.h" #include "RimSummaryCase.h" #include "RimSummaryEnsemble.h" @@ -175,29 +176,19 @@ void RiaSummaryCurveDefinition::setIdentifierText( SummaryCategory category, con { if ( RifEclipseSummaryAddress::isDependentOnWellName( category ) ) { - m_summaryAddressY.setWellName( name ); - m_summaryAddressX.setWellName( name ); + m_summaryAddressX = + RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressX, + name, + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ); + m_summaryAddressY = + RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressY, + name, + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ); } - - int id = RiaStdStringTools::toInt( name ); - - switch ( category ) + else { - case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: - m_summaryAddressY.setAquiferNumber( id ); - m_summaryAddressX.setAquiferNumber( id ); - break; - case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: - case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: - m_summaryAddressY.setRegion( id ); - m_summaryAddressX.setRegion( id ); - break; - case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: - m_summaryAddressY.setGroupName( name ); - m_summaryAddressX.setGroupName( name ); - break; - default: - break; + m_summaryAddressX = RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressX, name, m_summaryAddressX.category() ); + m_summaryAddressY = RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressY, name, m_summaryAddressY.category() ); } } diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp index 1de9f37e2c..7f188fd818 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -1032,8 +1032,19 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector break; case SummaryCategory::SUMMARY_NETWORK: - return networkAddress( vectorName, token1 ); - break; + { + auto aggregated = token1; + if ( !token2.empty() ) + { + // Network name can contain more than one token. Concatenate tokens using : as separator + // https://github.com/OPM/ResInsight/issues/11785 + aggregated += ":"; + aggregated += token2; + } + + return networkAddress( vectorName, aggregated ); + } + break; case SummaryCategory::SUMMARY_MISC: return miscAddress( vectorName ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp index b35beca11e..3ee7a48258 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp @@ -59,6 +59,55 @@ void caf::AppEnum::setUp() CAF_PDM_SOURCE_INIT( RimSummaryAddressCollection, "RimSummaryAddressCollection" ); +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddressDefines::SummaryCategory RimSummaryAddressCollection::contentTypeToSummaryCategory( CollectionContentType contentType ) +{ + switch ( contentType ) + { + case CollectionContentType::WELL: + return SummaryCategory::SUMMARY_WELL; + case CollectionContentType::GROUP: + return SummaryCategory::SUMMARY_GROUP; + case CollectionContentType::REGION: + return SummaryCategory::SUMMARY_REGION; + case CollectionContentType::FIELD: + return SummaryCategory::SUMMARY_FIELD; + case CollectionContentType::MISC: + return SummaryCategory::SUMMARY_MISC; + case CollectionContentType::AQUIFER: + return SummaryCategory::SUMMARY_AQUIFER; + case CollectionContentType::NETWORK: + return SummaryCategory::SUMMARY_NETWORK; + case CollectionContentType::REGION_2_REGION: + return SummaryCategory::SUMMARY_REGION_2_REGION; + case CollectionContentType::WELL_COMPLETION: + return SummaryCategory::SUMMARY_WELL_COMPLETION; + case CollectionContentType::WELL_LGR: + return SummaryCategory::SUMMARY_WELL_LGR; + case CollectionContentType::WELL_COMPLETION_LGR: + return SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; + case CollectionContentType::WELL_SEGMENT: + return SummaryCategory::SUMMARY_WELL_SEGMENT; + case CollectionContentType::BLOCK: + return SummaryCategory::SUMMARY_BLOCK; + case CollectionContentType::BLOCK_LGR: + return SummaryCategory::SUMMARY_BLOCK_LGR; + case CollectionContentType::IMPORTED: + return SummaryCategory::SUMMARY_IMPORTED; + case CollectionContentType::CALCULATED: + case CollectionContentType::NOT_DEFINED: + case CollectionContentType::WELL_FOLDER: + case CollectionContentType::GROUP_FOLDER: + case CollectionContentType::REGION_FOLDER: + case CollectionContentType::NETWORK_FOLDER: + case CollectionContentType::SUMMARY_CASE: + default: + return SummaryCategory::SUMMARY_INVALID; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.h index 274b923dda..ee54ad5301 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.h @@ -19,6 +19,8 @@ #include "RimNamedObject.h" +#include "RifEclipseSummaryAddressDefines.h" + #include "cafPdmChildArrayField.h" #include @@ -59,6 +61,8 @@ class RimSummaryAddressCollection : public RimNamedObject IMPORTED }; + static RifEclipseSummaryAddressDefines::SummaryCategory contentTypeToSummaryCategory( CollectionContentType contentType ); + public: RimSummaryAddressCollection(); ~RimSummaryAddressCollection() override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressModifier.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressModifier.cpp index 039f807072..235e16314c 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressModifier.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressModifier.cpp @@ -30,28 +30,32 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress RimSummaryAddressModifier::replaceObjectName( const RifEclipseSummaryAddress& sourceAdr, - std::string objectName, - RimSummaryAddressCollection::CollectionContentType contentType ) +RifEclipseSummaryAddress RimSummaryAddressModifier::replaceTokenForCategory( const RifEclipseSummaryAddress& sourceAdr, + const std::string& token, + RifEclipseSummaryAddressDefines::SummaryCategory contentType ) { auto adr = sourceAdr; - if ( contentType == RimSummaryAddressCollection::CollectionContentType::WELL ) + if ( contentType == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { - adr.setWellName( objectName ); + adr.setWellName( token ); } - else if ( contentType == RimSummaryAddressCollection::CollectionContentType::GROUP ) + else if ( contentType == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { - adr.setGroupName( objectName ); + adr.setGroupName( token ); } - else if ( contentType == RimSummaryAddressCollection::CollectionContentType::REGION ) + else if ( contentType == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) { - int intValue = RiaStdStringTools::toInt( objectName ); - if ( intValue == -1 ) + adr.setNetworkName( token ); + } + else if ( contentType == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) + { + int intValue = -1; + if ( !RiaStdStringTools::toInt( token, intValue ) ) { QString errorText = QString( "Failed to convert region text to region integer value " "for region text : %1" ) - .arg( QString::fromStdString( objectName ) ); + .arg( QString::fromStdString( token ) ); RiaLogging::error( errorText ); } @@ -60,6 +64,38 @@ RifEclipseSummaryAddress RimSummaryAddressModifier::replaceObjectName( const Rif adr.setRegion( intValue ); } } + else if ( contentType == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION ) + { + int intValue = -1; + if ( !RiaStdStringTools::toInt( token, intValue ) ) + { + QString errorText = QString( "Failed to convert region text to region integer value " + "for region text : %1" ) + .arg( QString::fromStdString( token ) ); + + RiaLogging::error( errorText ); + } + else + { + adr.setRegion2( intValue ); + } + } + else if ( contentType == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER ) + { + int intValue = -1; + if ( !RiaStdStringTools::toInt( token, intValue ) ) + { + QString errorText = QString( "Failed to convert aquifer text to aquifer integer value " + "for aquifer text : %1" ) + .arg( QString::fromStdString( token ) ); + + RiaLogging::error( errorText ); + } + else + { + adr.setAquiferNumber( intValue ); + } + } return adr; } @@ -151,18 +187,20 @@ void RimSummaryAddressModifier::updateAddressesByObjectName( const std::vector Date: Thu, 24 Oct 2024 10:42:40 +0200 Subject: [PATCH 18/21] Bump version --- ResInsightVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 487aec949a..8ae5f5159e 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -5,7 +5,7 @@ set(RESINSIGHT_PATCH_VERSION 2) # Opional text with no restrictions #set(RESINSIGHT_VERSION_TEXT "-dev") -set(RESINSIGHT_VERSION_TEXT "-RC-01") +set(RESINSIGHT_VERSION_TEXT "-RC-02") # Optional text # Must be unique and increasing within one combination of major/minor/patch version From 26ed0e50d7be3253c417015e000a8d252fa50007 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 24 Oct 2024 11:40:17 +0200 Subject: [PATCH 19/21] #11812 Multi-segment RFT plot: Make sure reservoir Pressure is plotted --- .../WellLog/RimWellLogRftCurve.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp index 1f0144a0fd..397a990fd3 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp @@ -1130,12 +1130,12 @@ std::vector RimWellLogRftCurve::tvDepthValues() if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA ) { - if ( RiaDefines::isSegmentConnectionResult( m_segmentResultName ) ) + if ( RiaDefines::isSegmentResult( m_segmentResultName ) ) { depthAddress = RifEclipseRftAddress::createBranchSegmentAddress( m_wellName(), m_timeStep, - RiaDefines::segmentConnectionTvdDepthResultName(), + RiaDefines::segmentTvdDepthResultName(), segmentBranchIndex(), m_segmentBranchType() ); } @@ -1143,7 +1143,7 @@ std::vector RimWellLogRftCurve::tvDepthValues() { depthAddress = RifEclipseRftAddress::createBranchSegmentAddress( m_wellName(), m_timeStep, - RiaDefines::segmentTvdDepthResultName(), + RiaDefines::segmentConnectionTvdDepthResultName(), segmentBranchIndex(), m_segmentBranchType() ); } @@ -1165,13 +1165,13 @@ std::vector RimWellLogRftCurve::measuredDepthValues( QString& prefixText { prefixText = "SEGMENT/"; - if ( RiaDefines::isSegmentConnectionResult( m_segmentResultName() ) ) + if ( RiaDefines::isSegmentResult( m_segmentResultName() ) ) { - return RimRftTools::segmentConnectionMdValues( opmRftReader, m_wellName(), m_timeStep, segmentBranchIndex(), m_segmentBranchType() ); + // Always use segment end MD values for segment data, as the curve is plotted as step left + return RimRftTools::segmentEndMdValues( opmRftReader, m_wellName(), m_timeStep, segmentBranchIndex(), m_segmentBranchType() ); } - // Always use segment end MD values for segment data, as the curve is plotted as step left - return RimRftTools::segmentEndMdValues( opmRftReader, m_wellName(), m_timeStep, segmentBranchIndex(), m_segmentBranchType() ); + return RimRftTools::segmentConnectionMdValues( opmRftReader, m_wellName(), m_timeStep, segmentBranchIndex(), m_segmentBranchType() ); } return {}; From cf8d84e56a5e2511591e285fcfdc5619e78f9dbb Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 24 Oct 2024 12:21:09 +0200 Subject: [PATCH 20/21] Bump version to RC-03 --- ResInsightVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 8ae5f5159e..c4ddfd806e 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -5,7 +5,7 @@ set(RESINSIGHT_PATCH_VERSION 2) # Opional text with no restrictions #set(RESINSIGHT_VERSION_TEXT "-dev") -set(RESINSIGHT_VERSION_TEXT "-RC-02") +set(RESINSIGHT_VERSION_TEXT "-RC-03") # Optional text # Must be unique and increasing within one combination of major/minor/patch version From e49c82c4e0d8c419537582776e38b34731d518c9 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 24 Oct 2024 14:05:09 +0200 Subject: [PATCH 21/21] Bump version to 2024.09.2 --- ResInsightVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index c4ddfd806e..411670d2c5 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -5,7 +5,7 @@ set(RESINSIGHT_PATCH_VERSION 2) # Opional text with no restrictions #set(RESINSIGHT_VERSION_TEXT "-dev") -set(RESINSIGHT_VERSION_TEXT "-RC-03") +#set(RESINSIGHT_VERSION_TEXT "-RC-03") # Optional text # Must be unique and increasing within one combination of major/minor/patch version