Commit Graph
18340 Commits
Author SHA1 Message Date
Magne Sjaastad 0f339a6ab2 Writes optional value directly to stream
The change directly writes the value of an `std::optional` to the output stream.

If an optional is undefined, nothing is written to the TextStream. Parsing of data coming from Python to C++ is improved to handle no data.
2025-09-24 12:50:21 +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
Magne Sjaastad 6ef5db2530 Support radial grids as cylindrical cells
* Add minimum angular count to system preferences
* Refactors grid view updates and radial grid handling
* Improves radial grid handling and LGR creation
2025-09-24 09:46:00 +02:00
Kristian Bendiksen d494725da8 Fix RigResdataGridConverter test assert in debug. 2025-09-19 15:22:17 +02:00
Kristian Bendiksen c6b8620486 #12547 Export border classification as BORDNUM to sector model. 2025-09-19 15:22:17 +02:00
Jon Jenssen 4c0d4b3d1d Support generating border result based on current visibility 2025-09-19 15:22:17 +02:00
Magne Sjaastad 3ff9ac3336 Improve LGR data structures and UI
Use term refinement from GUI to export code
Improve naming of variables
2025-09-19 11:00:57 +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
Magne Sjaastad 88cbcb5be0 #12930 Avoid pinning for grpc-related packages 2025-09-18 14:13:56 +02:00
Kristian Bendiksen efee24736c #12900 Export Sector Model: Add "Visible Wells" option. 2025-09-18 12:53:07 +02:00
Kristian Bendiksen 3150d5df16 #12900 Add method for padding ijk bounding box. 2025-09-18 12:53:07 +02:00
Kristian Bendiksen f6c5285e26 #12900 Compute IJK bounding box based on selected simulation wells. 2025-09-18 12:53:07 +02:00
Kristian Bendiksen 5133ae620b Refactor: simplify API for configuring cell counts in IJK.
The old API was based on "grid points", but it was always used to
specify number of cells in each direction.
2025-09-18 11:46:57 +02:00
Kristian Bendiksen e0df487eaa Sector export UI: fix bug in comparison. 2025-09-18 11:46:57 +02:00
Magne Sjaastad 772f7ac93c Make sure well targets are available as table editor
In 8251562cd9, logging was activated when no field editor could be created. This happens for PdmChildArray fields and PdmChildFields. A early return checking for these types was added, and caused well targets to be hidden from the property editor.
2025-09-13 20:16:42 +02:00
Kristian Bendiksen a308eb6419 #12894 Stimplan model export: make sure MD is always increasing.
The numerical precision in the output was lowered in #11556 since Stimplan
was not correctly handling the high precision (requested by Nan).
That change leads to the MD not always increasing (which is expected by
Stimplan). Added another tweak to the MD values to make sure it increases
in the precision range that will be written to file.

The original issue asked for improved precision in the output,
but that is not a viable option this Stimplan does not use all
of the decimal precision.

Fixes #12894.
2025-09-12 15:13:50 +02:00
Magne SjaastadandKristian Bendiksen 5269ba665f Export zcorn/coord to grdecl.
Changes:
- Refactors data writing to allow configurable row length
- Adds documentation describing the Eclipse grid format (COORD and ZCORN)

Co-Authored-By: Kristian Bendiksen <kristian.bendiksen@gmail.com>
2025-09-12 08:38:43 +02:00
Kristian Bendiksen e18a252cd8 Fix incorrect sector export in refinement. 2025-09-12 08:10:21 +02:00
Kristian Bendiksen aaed6aaf5d Add more tests for RifEclipseInputFileTools. 2025-09-12 08:10:21 +02:00
Magne Sjaastad 6bc251896c Update surfio
Fixes a compile issue for Debug builds on Visual Studio 2022
2025-09-12 08:07:17 +02:00
magnesj a70a094caf Fixes by clang-tidy 2025-09-12 05:45:56 +02:00
Magne Sjaastad df965a4a16 Add default line editors for some std::optional types 2025-09-11 13:44:25 +02:00
Magne Sjaastad 7246f0596b Add logging bridge between caf and ResInsight 2025-09-11 13:43:52 +02:00
Magne Sjaastad 8251562cd9 Add logging to CAF 2025-09-11 13:42:56 +02:00
Magne Sjaastad 7a483bdb4e Adds update procedure for opm-common keywords
Documents the procedure for updating the generated C++ code for Eclipse keywords from JSON definition files in the opm-common library.

This procedure is necessary when updating to a newer version of opm-common, when new keywords are added, or when existing keyword definitions change.
2025-09-10 12:50:20 +02:00
Magne Sjaastad a0a0919681 Update opm-common
Update opm-common based on latest main branch
Use branch https://github.com/CeetronSolutions/opm-common/tree/development-01
Update generated opm-common files
2025-09-10 12:50:20 +02:00
Magne Sjaastad 48ae7b2f04 Adds angle conversion utilities
Implements type-safe angle (degrees and radians) representation classes.

Provides utilities for converting between Cartesian and cylindrical
coordinate systems.

Includes a unit test suite for validation.
2025-09-10 08:23:09 +02:00
magnesj 0ed7821e05 Fixes by clang-tidy 2025-09-09 07:42:41 +02:00
Kristian Bendiksen aa5ea73ccb Revert "Fix QWidgetItem memory leak in PdmUiFieldEditorHandle destructor"
This reverts commit 2f4f97c80b.
2025-09-08 18:07:02 +02:00
Kristian Bendiksen 3e16fc4162 Summary Plot: Fix crash when setting "Col Span" to "unlimited". 2025-09-08 18:07:02 +02:00
dependabot[bot] b01434914c Bump actions/github-script from 7 to 8
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 15:36:51 +02:00
dependabot[bot] c6dd4a1d35 Bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 15:36:16 +02:00
Magne Sjaastad 01ad456a3b Add support for connecting a lateral to a parent well from Python (#12613)
* Updates well path connection logic.

Refactors well path connection to ensure tie-in location is updated correctly after connecting to a parent well. This ensures the visualization and data consistency are maintained.

* Updates connected editors after target manipulation

Ensures that connected editors are updated whenever the target is manipulated through the 3D manipulator.

* #12613 Adds functionality to append lateral well paths
2025-09-08 15:33:16 +02:00
Magne Sjaastad 0255d98a2b Bump to 2025.09.2-dev.01 2025-09-04 11:44:19 +02:00
Magne Sjaastad 41da409914 Removes branch check for tag releases. 2025-09-04 11:18:30 +02:00
Magne Sjaastad 69a835893b Changes default readout type
Changes the default readout type from "SNAP_TO_POINT" to "TIME_VALUE_TRACKING".
2025-09-04 11:12:58 +02:00
Kristian Bendiksen 9326da7965 Refactor: Move updateChannelsFromWellLogData to base class RimWellLog 2025-09-04 09:04:56 +02:00
Kristian Bendiksen 160cb71168 Python: Update well log import API to accept measured depth and multiple channels
- Updated Python API to accept measured_depth list and channel_data dictionary
- Modified C++ GRPC implementation to handle CSV-formatted channel mappings
- Replaced single values parameter with dictionary of channels
- Added comprehensive validation for all input parameters
- Updated parameter name from channel_keys_json to channel_keys_csv
- Enhanced tests to cover 16 different scenarios including edge cases
- Updated example to demonstrate new dictionary-based API functionality
2025-09-04 09:04:56 +02:00
Kristian Bendiksen 8089739add Python: Add API for importing well log data
Implement comprehensive Python API for importing well log data into ResInsight
well paths using lists of float values.

Core implementation:
- RigImportedWellLogData: Data storage class inheriting from RigWellLogData
- RimImportedWellLog: Scriptable model class for Python GRPC interface
- RimcWellPath_addWellLogInternal: GRPC method using key-value store for data transfer
- well_path.add_well_log(): Python API with validation and error handling

Features:
- Simple API: well_path.add_well_log(name='LogName', values=[1.0, 2.0, 3.0])
- Comprehensive input validation and type checking
- Efficient data transfer via key-value store mechanism
- Proper error handling with cleanup on failure
- Integration with existing well path functionality

Testing:
- 10 comprehensive unit tests covering all functionality
- Validation of input types, error conditions, and edge cases
- Integration testing with well path creation

Usage example included in PythonExamples directory demonstrating
import of gamma ray, porosity, and permeability log data.
2025-09-04 09:04:56 +02:00
Kristian Bendiksen 5aab904731 Fix: Memory leak in reservoir test
The test `RigReservoirTest_BasicTest10k_NativeECL_Test` was allocating
an `ecl_grid_type` object but was not freeing it, leading to a memory
leak.

This commit fixes the issue by calling `ecl_grid_free` at the end of
the test.
2025-09-04 09:04:30 +02:00
Kristian Bendiksen 8b457f2156 Fix: Memory leak in well_state_add_MSW2
The function `well_state_add_MSW2` in `well_state.cpp` would allocate
an `ecl_rsthead_type` object but would not free it in the case where
the `RSEG_KW` keyword was not found in the restart file view.

This would lead to a memory leak.

This commit fixes the issue by freeing the allocated object before
returning from the function in the error case.
2025-09-04 09:04:30 +02:00
Kristian Bendiksen f27982c119 Fix memory leak in RicGridStatisticsDialog by moving object creation inside validity check 2025-09-04 09:04:30 +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 6d602fb76d Fix memory leak.
m_commandData created with new, but never deleted.
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
Kristian Bendiksen 25dd9db293 Fix critical QWidgetItem memory leak in ensureWidgetContainsEmptyGridLayout
Address sanitizer detected a 1056-byte memory leak in QWidgetItem objects.
This was the actual root cause of the leak reported in the stack trace.

Problem: In ensureWidgetContainsEmptyGridLayout(), when clearing existing
layouts, the code was calling layout->takeAt(0) to remove QLayoutItem
objects but never deleting them. This caused QWidgetItem objects to
accumulate in memory without ever being freed.

The takeAt() method removes items from the layout but does NOT delete them.
The caller is responsible for deleting the returned QLayoutItem objects.

Fix: Added `delete item;` in the cleanup loop to properly free QWidgetItem
objects when clearing layouts before rebuilding the UI.
2025-09-04 09:04:30 +02:00
Kristian Bendiksen 2f4f97c80b Fix QWidgetItem memory leak in PdmUiFieldEditorHandle destructor
Address sanitizer detected a 1056-byte memory leak in QWidgetItem objects
created when adding widgets to layouts via QGridLayout::addWidget().

Root cause: PdmUiFieldEditorHandle destructor was using deleteLater() to
destroy widgets, but deleteLater() requires an active event loop to process
the delayed deletions. During application shutdown or certain cleanup
scenarios, the event loop may not process these deletions, causing
QWidgetItem objects to remain allocated.

Changes:
- Replace deleteLater() with immediate delete in destructor
- Update comment to explain why immediate deletion is necessary
- This ensures widgets and their associated QWidgetItem objects are
  properly cleaned up when field editors are destroyed

The original comment acknowledged that deleteLater() "will not work unless
you are actually inside an event loop" - this change addresses that issue
by using direct deletion instead.
2025-09-04 09:04:30 +02:00
Kristian Bendiksen a468e030af Fix memory leak in PdmUiFormLayoutObjectEditor detected by address sanitizer
Address sanitizer detected a 32-byte memory leak in QVBoxLayout objects
created by PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingInGridLayout().

Root cause: QVBoxLayout objects were being both:
1. Added to parent layouts via addLayout() (proper Qt ownership)
2. Stored in m_layouts member vector (redundant storage)

The redundant storage prevented Qt's automatic cleanup, causing memory leaks.
2025-09-04 09:04:30 +02:00