Commit Graph
511 Commits
Author SHA1 Message Date
Magne Sjaastad 544e9eedd9 Improve spell checker using codespell
* Configures automated spell checking with codespell
Adds GitHub workflows and configuration files for automated spell checking using `codespell`.

This includes:
- A workflow for checking pull requests and preventing new typos
- A workflow for automatically fixing typos in the main codebase
- Configuration files for `codespell` to ignore specific terms and file types
- Documentation on how to use and configure the spell checking workflows.

* Corrects minor spelling and grammar errors.
2025-11-19 10:25:32 +01:00
Kristian Bendiksen 38c691d9a4 Refactor: Update usage of caf::VecIjk. 2025-11-14 14:44:21 +01:00
Magne Sjaastad b6f0164de7 #13176 Use guarded pointers for highlighted curves 2025-11-14 13:06:32 +01:00
JJ 7c8aadcd60 Update OPM Flow Job Preferences (#13172)
* Add job settings, with default settings in preferences.
* Move opm flow settings to separate preferences tab
* Add warning/error detection add display count next to progress
* Adjust size of preference window
2025-11-14 12:56:23 +01:00
jonjenssen 5450ab292d Make sure we switch to the correct treeview when selecting an item. 2025-11-10 07:44:55 +01:00
Magne Sjaastad 7e7e7e0528 #13124 Show SWAT/SGAS instead of Saturation 2025-11-05 09:06:53 +01:00
JJ 453562082d Summary case refresh update. (#13123)
Use improved opm-common reader with less throws.
Add reload selected cases button
Add timer for auto-reload of cases
Add include in auto update option for cases and ensembles
Do not enable auto reload option for cases in an ensemble
2025-11-03 18:41:55 +01:00
Magne Sjaastad 98fe652f5d Simplifies relative permeability plot axis title.
Updates the relative permeability plot's X-axis title to use shorter, more standard labels ("SWAT" and "SGAS") instead of the longer "Water" and "Gas" versions. This improves readability and consistency with common saturation representations.
2025-11-03 16:07:40 +01:00
Magne Sjaastad 186992ebb6 Improves relative permeability plot display
Enhances the relative permeability plot by:

- Adding support for SATNUM and IMBNUM result display in cell reference information.
- Disabling the imbibition curve selection by default and enabling it dynamically based on the IMBNUM value.
- Removing the `satnum` argument from `calculateRelPermCurves` as it's no longer needed.
2025-11-03 16:07:40 +01:00
Magne Sjaastad f884b65bb6 Adds imbibition curves to relative permeability plot
Adds styling for imbibition relative permeability curves to the plot, differentiating them visually from drainage curves.

Adds UI elements (checkboxes) to control the visibility of drainage and imbibition curve sets. Also introduces a tracker that displays curve values near the cursor position.
2025-10-28 19:02:36 +01:00
Magne Sjaastad b0b2c56267 Refactors tracker text implementation
Simplifies the implementation of the tracker text provider by using a `std::function` instead of a dedicated interface.

This change improves code maintainability and reduces complexity.
2025-10-28 19:02:36 +01:00
Magne Sjaastad 91192a671c Use opm-flowdiagnostics-applications as submodule
* Deletes the copy of the code in ThirdPary folder
* Replace code with opm-flowdiagnostics-applications as submodule
* Refactors ECL data handling for flow diagnostics
Updates flow diagnostics to utilize ECL init data consistently.
This change streamlines the passing and usage of initialization
data within the flow diagnostics routines, enhancing code
clarity and maintainability. Removes redundant passing of grid
data, simplifying function signatures.
2025-10-27 14:09:57 +01:00
Magne Sjaastad cfc620b501 Avoids potential null pointer dereference
Adds a null check for the eclResDef pointer before accessing its members.
This prevents a potential crash if eclResDef is null.
Additionally, the unnecessary assertions are removed.
2025-10-23 16:14:12 +02:00
Magne Sjaastad 6bc25c387d #13065 Improves result info handling
Improves result info handling by ensuring the result
definition is valid before accessing it, preventing
potential crashes.
Uses `if (auto)` to check for null result definitions,
and displays a user-friendly message when no result
definition is available.
2025-10-23 16:14:12 +02:00
JJ 1eaf50b6b9 Support running jobs without blocking GUI (#13040)
* Add view job log command.
* Add stop job command.
* Do not block ui while job is running.
* Show progress while job is running
* Make sure user gets notified of running jobs when exiting ResInsight or closing current project.
2025-10-18 02:42:11 +02:00
Magne Sjaastad 0b7a4b12f1 #13019 Remove assert from RiaSummaryTools::summaryCaseMainCollection() 2025-10-14 14:47:58 +02:00
Magne Sjaastad 5f2e2919c8 Avoids iterator invalidation in QwtPlot item lists
When working with a summary ensemble in a Debug build on Windows, a crash happened in RiuQwtPlotWidget::resetPlotCurveHighlighting(). When iterating over list of plot items, one pointer to item pointed to 0xddddddd, a clear indication that the underlying list had been updated during the loop and the iterator invalidated.

The change ensures that modifications to the item list during iteration do not cause unexpected behavior, particularly in scenarios involving grid lines and curve highlighting.

This is achieved by making a copy of the item list before iteration when modifications may occur. For cases where no add/remove will be performed during the iteration, a comment is added to clarify that it is safe to access the reference to the list.
2025-10-14 12:52:24 +02:00
Magne Sjaastad bba6af58e5 #13001 3D-view: Scale factor is not shown correctly 2025-10-13 13:10:33 +02:00
Magne Sjaastad 62188fa9f2 Improve naming of cell related result names
Use radial/theta when required for GUI
Hide DX/DY from the list of available results
2025-10-08 16:03:56 +02:00
Magne Sjaastad fea2170826 Add guarding tying to mitigate reported segmentation fault
2025-10-06 12:48:32.779] [rotating_logger] [error] Stack trace:
  [0] manageSegFailure(int) at :0
  [1]  at :0
  [2] __dynamic_cast at :0
  [3] RimSummaryMultiPlot::updateReadOutLines(double, double) at :0
  [4] CoordinatePicker::trackerText(QPoint const&) const at :0
  [5] QwtPicker::trackerRect(QFont const&) const at :0
  [6] QwtPicker::updateDisplay() at :0
  [7] QwtPicker::begin() at :0
  [8] QwtPicker::transition(QEvent const*) at :0
  [9] QwtPicker::eventFilter(QObject*, QEvent*) at :0
  [10] QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) at :0
  [11] QApplicationPrivate::notify_helper(QObject*, QEvent*) at :0
  [12] RiaGuiApplication::notify(QObject*, QEvent*) at :0
  [13] QCoreApplication::notifyInternal2(QObject*, QEvent*) at :0
  [14]  at :0
  [15] QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) at :0
  [16]  at :0
  [17]  at :0
  [18] QApplicationPrivate::notify_helper(QObject*, QEvent*) at :0
  [19] RiaGuiApplication::notify(QObject*, QEvent*) at :0
  [20] QCoreApplication::notifyInternal2(QObject*, QEvent*) at :0
  [21] QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) at :0
  [22] QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) at :0
  [23]  at :0
  [24] g_main_context_dispatch at :0
  [25] g_main_context_iterate.isra.20 at :0
  [26] g_main_context_iteration at :0
  [27] QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) at :0
  [28] QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) at :0
  [29] QCoreApplication::exec() at :0
2025-10-07 16:33:26 +02:00
Magne Sjaastad b321109904 Delete unused QtCharts files 2025-10-07 12:17:42 +02:00
Kristian Bendiksen 5c48383d71 Refactor: Improve interface for characteristicCellSize() 2025-10-06 09:10:58 +02:00
Magne Sjaastad a73999323a Move defines into separate file 2025-10-03 08:37:24 +02:00
Magne Sjaastad 336e4b65fd Consolidate linear interpolation algorithms
Replaces custom linear interpolation logic with
`std::upper_bound` for improved efficiency.

Refactors the permeability plot panel to utilize the improved
interpolation tool.
2025-10-03 08:37:24 +02:00
Magne Sjaastad 6b7d93e2da Refactor import of radial grid
* Add radial display mode to preferences
* Adds isRadial to grid
* Improve mesh lines for radial cells
For temporary radial LGRs, show mesh outline based on the aggregated geometry of all LGRs of the parent cell clicked on.
* Improve warning message
* Modify cell selection in pick event handler
2025-09-29 11:46:28 +02:00
Magne Sjaastad a2e94a0c83 Create mesh lines based on for lgr cells
If the angular cell count is low, especially 1, the geometry representation of a cell requires refinement in angular(J) direction. Show this geometry as a cylinder segment when holding CTRL and clicking on the radial geometry.
2025-09-24 10:20:56 +02:00
Kristian Bendiksen da741b16ac Revert "RiuSummaryPlot: Fix memory leak by integrating into Qt's parent-child system."
This reverts commit e6746cd819.
2025-09-19 11:00:48 +02:00
Kristian Bendiksen 3e16fc4162 Summary Plot: Fix crash when setting "Col Span" to "unlimited". 2025-09-08 18:07:02 +02:00
Kristian Bendiksen e6746cd819 RiuSummaryPlot: Fix memory leak by integrating into Qt's parent-child system. 2025-09-04 09:04:30 +02:00
Kristian Bendiksen 0cce2bb42d Fix critical RiuContextMenuLauncher memory leak by setting parent widget
Address sanitizer detected a memory leak in CmdFeatureMenuBuilder::MenuItem
objects caused by RiuContextMenuLauncher objects that were never deleted.

Problem: The RiuContextMenuLauncher class has two constructors:
1. RiuContextMenuLauncher(widget, CmdFeatureMenuBuilder&) - sets parent ✓
2. RiuContextMenuLauncher(widget, QStringList&) - missing parent ✗

The second constructor was missing the parent initialization, causing all
RiuContextMenuLauncher objects created with QStringList (used in 10+ locations)
to never be deleted, leading to memory leaks of their internal MenuItem vectors.

Root cause: Missing parent-child relationship meant Qt couldn't automatically
clean up these objects when their associated widgets were destroyed.

Fix: Added `: QObject( widget )` to the second constructor to match the first
constructor's behavior. This ensures Qt's automatic parent-child cleanup
handles the RiuContextMenuLauncher lifecycle properly.

This fixes the systemic issue affecting multiple plot types including:
- Correlation plots, Analysis plots, VFP plots, Well allocation plots
- All locations using `new RiuContextMenuLauncher(widget, {commands})`
2025-09-04 09:04:30 +02:00
Kristian Bendiksen aec17d54a7 Fix CmdFeatureMenuBuilder::MenuItem memory leak in RiuContextMenuLauncher
Address sanitizer detected a memory leak in CmdFeatureMenuBuilder::MenuItem
objects allocated during context menu creation.

Problem: The RiuContextMenuLauncher constructor was creating a temporary
CmdFeatureMenuBuilder object, populating it with menu items, then copying
the entire object to the member variable m_menuBuilder. This caused
unnecessary memory allocation and copying of std::vector<MenuItem> data.

Root cause: Inefficient constructor implementation:
  caf::CmdFeatureMenuBuilder menuBuilder;  // temp object
  for (cmd : commandIds) menuBuilder << cmd;  // populate temp
  m_menuBuilder = menuBuilder;  // copy entire vector (leak source)

Fix: Build the menu directly into the member variable instead of creating
a temporary object and copying it:
  for (cmd : commandIds) m_menuBuilder << cmd;  // direct construction

This eliminates the unnecessary temporary object creation and copy operation
that was causing the MenuItem vector allocation detected by the sanitizer.
The fix maintains identical functionality while being more efficient.
2025-09-04 09:04:30 +02:00
Kristian Bendiksen 89e940b1ea Fix QProxyStyle memory leak in PdmUiTreeViewStyle creation
Address sanitizer detected a memory leak in QProxyStyle objects
created during GUI theme updates.

Problem: The updateGuiTheme() function was called multiple times (e.g., during
initialization) and repeatedly created new PdmUiTreeViewStyle objects for
every PdmUiTreeViewWidget without checking if the widget already had the
correct style set.

Root cause: Each call to updateGuiTheme() would:
1. Iterate through ALL widgets in the application
2. Create a new PdmUiTreeViewStyle for every tree view widget
3. Call setStyle() which should take ownership, but repeated calls
   were causing memory leaks

Fix: Added a check to only create and set a new PdmUiTreeViewStyle if the
widget doesn't already have one. This prevents repeatedly creating new
styles for the same widgets during multiple theme update calls.

The fix uses dynamic_cast to check if the current style is already a
PdmUiTreeViewStyle before creating a new one.
2025-09-04 09:04:30 +02:00
JJ 393917e6f3 Histogram drag/drop and paste improvements (#12851)
* Add drag'n'drop support for ensemble summary vectors and ensembles into histogram plots

* Make sure histogram plot is shown and all update signals are connected when loading a project.

* Support ensemble parameter drag'n'drop from data sources into histogram plots. 

* Show ensemble parameters in data sources tree.

* Add copy/paste of histogram curves

* Re-use all existing parameters in a plot when dragging a new ensemble into it
2025-08-29 15:12:32 +02:00
Magne Sjaastad 4135a743fe Release preparations
* Adds a bounds check on the node index to prevent accessing invalid memory locations.
This prevents potential crashes caused by out-of-bounds access when retrieving summary variable values.
* Updates warning message for incomplete deltas
* Plot based on a single realization from a file set ensemble is not restored correctly on project load
* Populate result addresses if no addresses are present
* Adds CNV_ (convergence) result name
* Avoid include of RiaResultNames.h in header file
2025-08-27 14:22:11 +02:00
Santiago Ospina De Los Ríos 66756ff21e Use template function prefix 2025-08-25 12:45:22 +02:00
Kristian Bendiksen 8f825c3cef #12534 Refactor: Simplify RiaDefines::MultiPlotPageUpdateType usage 2025-08-22 16:10:04 +02:00
jonjenssen a53fa416a5 Set minimum preferred height of legend in 3d view 2025-08-10 20:11:18 +02:00
Kristian Bendiksen ade8e1d7e6 Remove QT_CHARTS dependency. 2025-07-30 13:39:02 +02:00
Magne Sjaastad 2f9971cb30 Enhances ensemble curve handling and performance
* Removes obsolete code
* Return first non-empty return value from reader
* Simplifies water cut curve visibility check
* Defers the page update until after all plots have been added.
* Add settings to control number of threads
* Refactors ensemble curve handling and visibility

Improves the efficiency of ensemble curve set management by separating realization and statistics curves into distinct collections. This allows for more targeted operations, such as selectively showing/hiding realization curves without affecting statistics.
Also defers data loading of curves until they are actually displayed, optimizing performance.
The visibility updates are modified to optionally skip updating the parent plot, providing more control over replotting behavior and preventing unnecessary updates.
2025-07-30 07:16:29 +02:00
Magne Sjaastad b9f13f742d Select the first visible plot item in the Project Tree
When clicking on a plot, this change ensures that the first visible ancestor plot in the hierarchy is selected in the project tree.
2025-07-25 08:42:13 +02:00
Magne Sjaastad b4e99e9a3a Improves summary import for ensemble workflows
- Introducing a configuration system to automatically detect file patterns for restart and parameter files across ensemble realizations.
- Adding UI elements to control improved summary import settings.
- Modifying summary file reader to use the determined file patterns.
2025-07-23 15:58:56 +02:00
Magne Sjaastad 3727a12634 Add reordering and drag/drop for summary ensembles 2025-07-23 10:34:27 +02:00
Magne Sjaastad 054001cef4 Selects plot on right-click as well 2025-07-23 10:34:27 +02:00
Kristian Bendiksen 11d85583dd Histogram: Use new plot for "Create Grid Statistics in 3d view". 2025-07-04 16:57:41 +02:00
Kristian Bendiksen e095f524c8 Histogram: Use vertical labels. 2025-07-03 08:35:10 +02:00
JJ bda598dd37 Run Opm Flow jobs from ResInsight (#12580) 2025-06-11 15:43:53 +02:00
jonjenssen 7b7878e0af EDFM grid data support 2025-05-19 17:40:39 +02:00
Magne Sjaastad 37041ad0a6 clang-19-tidy and clang-19-format fixes 2025-05-19 14:31:30 +02:00
Magne Sjaastad 957adc3c4c Adjustments for ensemble file sets
* Add support for reload of ensemble file set
* Fix Replace for ensemble file sets
* Workaround for update of connected plots
* Use summary icon for ensemble data sources
2025-05-19 12:51:52 +02:00
Magne Sjaastad dc4cd33c6e #12495 Refactors ensemble statistics handling
Removes the dedicated `SUMMARY_ENSEMBLE_STATISTICS` category and instead uses a `statisticsType` field within `RifEclipseSummaryAddress` to represent ensemble statistics.

This change simplifies the code and avoids potential confusion by representing statistics as attributes of existing summary types, rather than a separate category. It also improves code robustness.
2025-05-16 07:53:46 +02:00