Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b135c5b
Handle infinity TVD values in interpolateMdFromTvd with linear fallback
magnesj Apr 10, 2026
a75ab0b
Guard against null plot widgets before calling isChecked in RiuMultiP…
magnesj Apr 10, 2026
aa59559
Add RiuQwtCurveSelectorFilter for click-to-select realization in Qwt …
magnesj Apr 10, 2026
9c61799
Guard against null eclCase in RimDataSourceForRftPlt::address
magnesj Apr 10, 2026
fe02408
Migrate CurveSelectorFilter to RiuQwtCurveSelectorFilter in CrossPlot…
magnesj Apr 10, 2026
e8bd2ee
Guard against out-of-bounds IJK and invalid cells in RifReaderRftInte…
magnesj Apr 10, 2026
e9034ab
Add RFT correlation report plot with cross-plot and context menu feature
magnesj Apr 10, 2026
14577ae
Initialize cross plot with first numeric ensemble parameter on creation
magnesj Apr 10, 2026
6a69a50
Add depth range enable checkbox to RimParameterRftCrossPlot
magnesj Apr 10, 2026
54b5d01
Add RFT tornado plot with click-to-select and correlation-sorted para…
magnesj Apr 10, 2026
59e2a16
Extract computeMeanPressurePerCase as shared static helper
magnesj Apr 10, 2026
3307af7
Fix code review issues in RFT correlation report plot
magnesj Apr 10, 2026
0a24579
Extract minRangeEpsilon as named variable in RiuQwtCurveSelectorFilter
magnesj Apr 10, 2026
380dc7d
Replace ±infinity sentinels with std::optional for axis value ranges
magnesj Apr 10, 2026
97c9e10
Replace caf::Signal with std::function callback in RimRftTornadoPlot
magnesj Apr 10, 2026
602c55b
Avoid mutable m_lastCorrelations by returning correlations from addDa…
magnesj Apr 10, 2026
a4b6ac1
Fixes by clang-format
magnesj Apr 10, 2026
b3d338e
Highlight selected realization in RimWellRftPlot using contrast color…
magnesj Apr 10, 2026
09cc591
Fixes by clang-format
magnesj Apr 10, 2026
52ef011
Fix interpolateMdFromTvd corrupting valid entries after infinity TVD …
magnesj Apr 10, 2026
1b2d2e2
RftCorrelationReportPlot: fix title bar visibility and editor update …
magnesj Apr 14, 2026
85a4067
RftTornadoPlot: remove m_contrastBarColor
magnesj Apr 16, 2026
a22ea07
RimParameterRftCrossPlot: highlight selected realization with XCROSS …
magnesj Apr 16, 2026
7f4bc77
RimWellRftPlot: highlight selected realization with red/orange color …
magnesj Apr 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogCalculatedCurveFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateRftPlotsFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateRftPlotsFeatureUi.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateRftCorrelationReportFeature.h
)

set(SOURCE_GROUP_SOURCE_FILES
Expand Down Expand Up @@ -70,6 +71,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogCalculatedCurveFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateRftPlotsFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateRftPlotsFeatureUi.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateRftCorrelationReportFeature.cpp
)

list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

#include "RicCreateRftCorrelationReportFeature.h"

#include "RimCorrelationPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimRftCorrelationReportPlot.h"
#include "RimWellRftPlot.h"

#include "RiuPlotMainWindowTools.h"

#include "cafSelectionManager.h"

#include <QAction>

CAF_CMD_SOURCE_INIT( RicCreateRftCorrelationReportFeature, "RicCreateRftCorrelationReportFeature" );

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateRftCorrelationReportFeature::isCommandEnabled() const
{
return dynamic_cast<RimWellRftPlot*>( caf::SelectionManager::instance()->selectedItem() ) != nullptr;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateRftCorrelationReportFeature::onActionTriggered( bool /*isChecked*/ )
{
auto* sourcePlot = dynamic_cast<RimWellRftPlot*>( caf::SelectionManager::instance()->selectedItem() );
if ( !sourcePlot ) return;

auto* correlationColl = RimMainPlotCollection::current()->correlationPlotCollection();
if ( !correlationColl ) return;

auto* report = correlationColl->createRftCorrelationReportPlot( sourcePlot );
if ( !report ) return;

report->loadDataAndUpdate();
correlationColl->updateConnectedEditors();

RiuPlotMainWindowTools::showPlotMainWindow();
RiuPlotMainWindowTools::onObjectAppended( report );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateRftCorrelationReportFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Create RFT Correlation Report" );
actionToSetup->setIcon( QIcon( ":/CorrelationReportPlot16x16.png" ) );
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once

#include "cafCmdFeature.h"

//==================================================================================================
/// Creates a RimRftCorrelationReportPlot from the context menu of a RimWellRftPlot.
//==================================================================================================
class RicCreateRftCorrelationReportFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

private:
bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};
15 changes: 12 additions & 3 deletions ApplicationLibCode/FileInterface/RifReaderRftInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ std::vector<double>
auto cellIjk = cellIndices( wellName, timeStep );
for ( const caf::VecIjk0& ijk : cellIjk )
{
if ( ijk.i() >= mainGrid->cellCountI() || ijk.j() >= mainGrid->cellCountJ() || ijk.k() >= mainGrid->cellCountK() ) continue;

auto globalCellIndex = mainGrid->cellIndexFromIJK( ijk.i(), ijk.j(), ijk.k() );

auto avgMd = eclExtractor->averageMdForCell( globalCellIndex );
Expand All @@ -80,10 +82,17 @@ std::vector<double>
{
// The RFT cell is not part of cells intersected by well path
// Use the TVD of cell center to estimate measured depth

avgMeasuredDepthForCells.push_back( std::numeric_limits<double>::infinity() );
auto center = mainGrid->cell( globalCellIndex ).center();
tvdValuesToEstimate.push_back( -center.z() );

const RigCell& cell = mainGrid->cell( globalCellIndex );
if ( cell.isInvalid() )
{
tvdValuesToEstimate.push_back( std::numeric_limits<double>::infinity() );
}
else
{
tvdValuesToEstimate.push_back( -cell.center().z() );
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimParameterRftCrossPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimRftCorrelationReportPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimRftTornadoPlot.h
)

set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimAbstractCorrelationPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimParameterRftCrossPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimRftCorrelationReportPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimRftTornadoPlot.cpp
)

list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
#include "RimCorrelationPlot.h"
#include "RimCorrelationReportPlot.h"
#include "RimParameterResultCrossPlot.h"
#include "RimParameterRftCrossPlot.h"
#include "RimProject.h"
#include "RimRftCorrelationReportPlot.h"
#include "RimSummaryEnsemble.h"
#include "RimSummaryEnsembleTools.h"
#include "RimWellRftPlot.h"

CAF_PDM_SOURCE_INIT( RimCorrelationPlotCollection, "CorrelationPlotCollection" );

Expand All @@ -39,6 +42,7 @@ RimCorrelationPlotCollection::RimCorrelationPlotCollection()

CAF_PDM_InitFieldNoDefault( &m_correlationPlots, "CorrelationPlots", "Correlation Plots" );
CAF_PDM_InitFieldNoDefault( &m_correlationReports, "CorrelationReports", "Correlation Reports" );
CAF_PDM_InitFieldNoDefault( &m_rftCorrelationReports, "RftCorrelationReports", "RFT Correlation Reports" );
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -174,6 +178,52 @@ RimCorrelationReportPlot* RimCorrelationPlotCollection::createCorrelationReportP
return report;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimRftCorrelationReportPlot* RimCorrelationPlotCollection::createRftCorrelationReportPlot( RimWellRftPlot* source )
{
auto* report = new RimRftCorrelationReportPlot;
report->setAsPlotMdiWindow();

if ( source )
{
report->initializeFromSourcePlot( source );

const auto ensembles = source->selectedEnsembles();
if ( !ensembles.empty() )
{
auto* ensemble = ensembles.front();
report->crossPlot()->setEnsemble( ensemble );

// Pick the first numeric ensemble parameter as a default
for ( const auto& param : RimSummaryEnsembleTools::alphabeticEnsembleParameters( ensemble->allSummaryCases() ) )
{
if ( param.isNumeric() )
{
report->crossPlot()->setEnsembleParameter( param.name );
break;
}
}
}
report->crossPlot()->setWellName( source->simWellOrWellPathName() );

const auto timeSteps = source->selectedTimeSteps();
if ( !timeSteps.empty() ) report->crossPlot()->setTimeStep( timeSteps.front() );
}

m_rftCorrelationReports.push_back( report );
return report;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimRftCorrelationReportPlot*> RimCorrelationPlotCollection::rftReports() const
{
return m_rftCorrelationReports.childrenByType();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -222,6 +272,7 @@ void RimCorrelationPlotCollection::deleteAllPlots()
{
RimTypedPlotCollection<RimAbstractCorrelationPlot>::deleteAllPlots();
m_correlationReports.deleteChildren();
m_rftCorrelationReports.deleteChildren();
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -382,6 +433,9 @@ void RimCorrelationPlotCollection::loadDataAndUpdateAllPlots()
for ( const auto& corrPlot : m_correlationPlots )
corrPlot->loadDataAndUpdate();

for ( const auto& reports : m_correlationReports )
reports->loadDataAndUpdate();
for ( const auto& report : m_correlationReports )
report->loadDataAndUpdate();

for ( const auto& rftReport : m_rftCorrelationReports )
rftReport->loadDataAndUpdate();
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class RimCorrelationPlot;
class RimCorrelationMatrixPlot;
class RimCorrelationReportPlot;
class RimParameterResultCrossPlot;
class RimRftCorrelationReportPlot;
class RimSummaryEnsemble;
class RimWellRftPlot;

//==================================================================================================
///
Expand Down Expand Up @@ -66,14 +68,17 @@ class RimCorrelationPlotCollection : public caf::PdmObject, public RimTypedPlotC

void removeReport( RimCorrelationReportPlot* correlationReport );

RimRftCorrelationReportPlot* createRftCorrelationReportPlot( RimWellRftPlot* source );

std::vector<RimAbstractCorrelationPlot*> plots() const final;
size_t plotCount() const final;
void insertPlot( RimAbstractCorrelationPlot* plot, size_t index ) final;
void removePlot( RimAbstractCorrelationPlot* correlationPlot ) final;
void deleteAllPlots() final;
void loadDataAndUpdateAllPlots() override;

std::vector<RimCorrelationReportPlot*> reports() const;
std::vector<RimCorrelationReportPlot*> reports() const;
std::vector<RimRftCorrelationReportPlot*> rftReports() const;

private:
void applyFirstEnsembleFieldAddressesToPlot( RimAbstractCorrelationPlot* plot, const std::vector<QString>& quantityNames = {} );
Expand All @@ -91,6 +96,7 @@ class RimCorrelationPlotCollection : public caf::PdmObject, public RimTypedPlotC
std::time_t timeStep );

private:
caf::PdmChildArrayField<RimAbstractCorrelationPlot*> m_correlationPlots;
caf::PdmChildArrayField<RimCorrelationReportPlot*> m_correlationReports;
caf::PdmChildArrayField<RimAbstractCorrelationPlot*> m_correlationPlots;
caf::PdmChildArrayField<RimCorrelationReportPlot*> m_correlationReports;
caf::PdmChildArrayField<RimRftCorrelationReportPlot*> m_rftCorrelationReports;
};
Loading