Commit Graph
18177 Commits
Author SHA1 Message Date
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
Magne Sjaastad f2fb2fdcc5 Guards against null pointer use 2025-09-04 08:26:29 +02:00
Magne Sjaastad bde4eeb892 Removes scripting capability of trajectory points
For large point arrays, the scripting causes overflow in the grpc communication. Disable scripting to make sure the grpc object size is below size threshold.
2025-09-03 16:11:13 +02:00
Kristian Bendiksen 4a8af2ff9d Add [[nodiscard]] to new api. 2025-09-03 14:21:19 +02:00
Kristian Bendiksen 086b542db2 Github Actions: workaround missing libcrypto in latest buildcache. 2025-09-03 14:21:19 +02:00
Kristian Bendiksen 10182e99a7 Refactor: Change RigGridBase::cellCornerVertices to return std::array
Refactored RigGridBase::cellCornerVertices to return std::array<cvf::Vec3d, 8> by value instead of taking a reference to std::array as an output parameter. This change improves code readability and leverages modern C++ return value optimizations.

Updated all call sites across the codebase to reflect the new function signature.
2025-09-03 14:21:19 +02:00
Kristian Bendiksen da69eef72b #1584 Replace cvf::vec3d[8] with std::array<cvf::vec3d, 8> 2025-09-03 14:21:19 +02:00
Magne Sjaastad 7b34d7f103 Compute measured depth if not present on file (#12872)
* Refactors RigWellPathGeometryTools to namespace
* Refactors measured depth calculation to utility.
* Calculates MD if missing from well path data
2025-09-03 12:59:15 +02:00
Kristian Bendiksen e10b852771 cvfVector: Fix definition in different translation unit warning 2025-09-03 12:52:24 +02:00
Magne Sjaastad 0228d14899 #12869 Allow multiple import of all well file types
Previously, we had support for import of well log file including (some) well path geometry. Then, when the full well path was imported later, the well log data was moved to the full well path. This functionality is now removed as it is not working well when we allow import of multiple well path files.
2025-09-03 11:04:21 +02:00
Magne Sjaastad b8566b7761 #12873 Make sure addresses are created on single summary case reload 2025-09-02 15:48:12 +02:00
Magne Sjaastad 880da0bb9d Updates .gitignore and removes obsolete file 2025-09-02 10:14:03 +02:00
Magne Sjaastad 72d6b303b1 Prepare dev after release 2025-09-01 15:57:40 +02:00
Magne Sjaastad 7384e97854 Release 2025.09.0 2025-09-01 11:15:26 +02:00