Commit Graph
19844 Commits
Author SHA1 Message Date
Kristian Bendiksen eda2d73fed #14772 Forward scaleFractureTemplate to RimcFractureTemplate_setScaleFactors
Add a typed setter to the existing RimcFractureTemplate_setScaleFactors
object method and let RicfScaleFractureTemplate forward to it via
RicfForwarding::findFractureTemplate(). Make RimFractureTemplate::m_id
scriptable (read-only) so templates can be looked up by id from Python.

Project.scale_fracture_template(template_id=...) in Python now resolves
the template object and calls FractureTemplate.set_scale_factors(),
emitting a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen dbd9e50f5f #14772 Python: Add EclipseCase.export_flow_characteristics as object method and forward exportFlowCharacteristics to it
RimEclipseResultCase_exportFlowCharacteristics has the same arguments
as the legacy command (lists only, no scalar shorthand).
RicfExportFlowCharacteristics forwards to it.

The hand-written Case.export_flow_characteristics() Python wrapper is
removed: the generated EclipseCase method has the same name and
argument names and shadows it for all cases the command applies to.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 6e3e6e738f #14772 Python: Add Reservoir.create_multiple_fractures as object method and forward createMultipleFractures to it
RimEclipseCase_createMultipleFractures takes WellPath objects and a
FractureTemplate object instead of names and ids. The
MultipleFractures::Action enum is moved from the Ricf header to
RicCreateMultipleFracturesFeature.h so the object method does not
depend on CommandFileInterface, and is registered as the Python
StrEnum MultipleFracturesAction.

Add RicfForwarding::findFractureTemplate(). RicfCreateMultipleFractures
resolves names/ids and forwards to the object method.

The hand-written Case.create_multiple_fractures(template_id=...,
well_path_names=...) Python wrapper is removed: the generated
Reservoir method has the same name and shadows it. The test is updated
to the object based signature.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen afa816826b #14772 Forward exportLgrForCompletions to RimEclipseCase_exportLgrForCompletions
RicfExportLgrForCompletions resolves well path names and the LGRS
export folder from the command file executor and forwards to the
object method. Add Python tests for both LGR object methods.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen e54363133e #14772 Python: Add Reservoir.create_lgr_for_completions and export_lgr_for_completions as object methods
RimEclipseCase_createLgrForCompletions and
RimEclipseCase_exportLgrForCompletions take WellPath objects and
expose refinement and split type. Lgr::SplitType is registered as the
Python StrEnum LgrSplitType. RicfCreateLgrForCompletions forwards to
the create method. Case.create_lgr_for_completion() in Python is kept
and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen b40d19f55f #14772 Python: Add Reservoir.export_msw_completions as object method and forward exportMsw to it
RimEclipseCase_exportMswCompletions takes WellPath objects and an
explicit export folder. RicfExportMsw resolves the well path name and
export folder and forwards to it. Case.export_msw() in Python is kept
and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen afe8f39f6b #14772 Python: Add Reservoir.export_completions as object method and forward exportWellPathCompletions to it
RimEclipseCase_exportCompletions takes WellPath objects (empty list
means all visible well paths) and an explicit export folder, and
exposes all completion export settings. The existing enums
ExportSplit, CompdatExport and PressureDepletionWBHPSource are
registered as Python StrEnums CompletionExportSplit,
CompdatExportType and TransScalingWbhpSource.

RicfExportWellPathCompletions resolves well path names to objects and
the export folder from the command file executor, then forwards to the
object method. Case.export_well_path_completions() in Python is kept
and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 001a515c68 #14772 Python: Add EclipseView.export_visible_cells as object method and forward exportVisibleCells to it
RimEclipseView_exportVisibleCells writes a FLUXNUM/MULTNUM/ACTNUM
keyword based on cell visibility in the view and requires an explicit
export file. The export keyword reuses
RicSaveEclipseInputVisibleCellsUi::ExportKeyword, registered as the
Python StrEnum VisibleCellsExportKeyword.

RicSaveEclipseInputVisibleCellsFeature::exportVisibleCells() is split
out of executeCommand() to return errors via std::expected instead of
only logging them.

RicfExportVisibleCells resolves the export folder from the command file
executor's CELLS export path and forwards to the object method. The
hand-written View.export_visible_cells() wrapper is removed since the
generated EclipseView method shadows it.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 1f06f02b39 #14772 Python: Add EclipseView.export_current_property and forward exportPropertyInViews to it
RimEclipseView_exportCurrentProperty exports the cell result shown in
the view at its current time step to a GRDECL style text file, and
requires an explicit export file. RicfExportPropertyInViews selects the
views by id/name, resolves the default file names from the command file
executor's PROPERTIES export folder, and forwards to it for each view.

The method is named exportCurrentProperty rather than exportProperty to
avoid shadowing the legacy View.export_property() wrapper (different
signature) in the generated Python class hierarchy. The legacy wrapper
is kept and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen d2078613a8 #14772 Python: Add Reservoir.export_property as object method and forward exportProperty to it
RimEclipseCase_exportProperty writes a cell property to a GRDECL style
text file and requires an explicit export file. RicfExportProperty
resolves the default file name from the command file executor's
PROPERTIES export folder and forwards to it.

The hand-written Case.export_property() wrapper is removed. The
generated Reservoir.export_property() has the same argument names and
shadows the base class wrapper anyway, so a deprecation shim would
never be reached.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 77c32a3fa5 #14772 Python: Add snapshot export object methods and forward exportSnapshots to them
- Add RimViewWindow_exportSnapshot on RimViewWindow (3D views and
  plots) with explicit ExportFolder, Prefix, Width, Height and
  FileFormat parameters. Generated as ViewWindow.export_snapshot().
- Add RimProject_exportSnapshots for exporting all views and/or plots
  with a ContentType parameter. Generated as Project.export_snapshots().
- Add RiaDefines::SnapshotFileFormat and SnapshotContentType enums,
  registered as Python StrEnums.
- Extract single-item exportSnapshotOfView()/exportSnapshotOfPlot()
  from the RicSnapshotAll*ToFileFeature loops so the object methods
  and the legacy loops share the implementation.
- RicfExportSnapshots resolves the export folder from the command file
  executor and forwards to the object methods.

Python: the hand-written ViewWindow.export_snapshot() wrapper is
removed (generated method is compatible). PlotWindow.export_snapshot()
and Project.export_snapshots() keep their legacy argument names
(file_prefix, output_format, snapshot_type, plot_format) as deprecated
aliases. Case.export_snapshots_of_all_views() is deprecated in favor
of View.export_snapshot().

Also fix Case.views(), which compared the view id to the case id and
therefore never returned any views.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen ee28576c48 #14772 Python: Add View.set_time_step as object method and forward setTimeStep to it
Rim3dView_setTimeStep validates the time step against the owner case
and updates the view. RicfSetTimeStep forwards to it, looping over all
views of the case when viewId is -1. The hand-written Python
View.set_time_step() wrapper is removed since the generated method has
the same name and signature.

Also fix the argument description of the new Rimc methods: the whatsThis
text is the third variadic argument of CAF_PDM_InitScriptableField.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen e87e372c7b #14772 Python: Add View.clone as object method and forward cloneView to it
Rim3dView_clone copies an Eclipse or GeoMech view into the same case
and returns the new view. RicfCloneView forwards to it. Add a
project-wide RicfForwarding::findView(viewId) helper. The hand-written
Python View.clone() wrapper is removed since the generated method has
the same name and signature.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen bdef98203b #14772 Python: Add Case.create_view as object method and forward createView to it
RimCase_createView creates a 3D view in an Eclipse or GeoMech case and
returns it. RicfCreateView forwards to it and wraps the view id in the
legacy createViewResult. The hand-written Python create_view() wrapper
is removed since the generated method has the same name and signature.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 3eb63c0b8e #14772 Python: Add Case.replace_grid and forward replaceCase to it
First step in modernizing the command file interface: move the
implementation of legacy Ricf commands into object-oriented Rimc
methods, and let the Ricf command forward to them.

- Add RimCase_replaceGrid (PdmVoidObjectMethod on RimCase) with
  NewGridFile and optional ProjectFile parameters. Works for both
  Eclipse result cases and GeoMech cases. Generated in Python as
  Case.replace_grid().
- Add RicfCommandForwarding helpers for resolving ids to objects and
  converting std::expected results to PdmScriptResponse.
- RicfSingleCaseReplace::execute() now resolves the case and the
  executor's last project path, then forwards to RimCase_replaceGrid.
  Command file syntax and Commands.proto are unchanged.
- Case.replace() in Python is kept as a thin wrapper over
  replace_grid() and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Magne Sjaastad 3437cf9b94 #14778 Fix crashes from unguarded pointer and index accesses
* Skip deleted plot widgets in RiuMultiPlotBook::visiblePlotWidgets
* Guard missing calculation in detectCyclicCalculation
* Guard invalid node index in RigFemPart node lookups
* Guard null well path in RimWellLogExtractionCurve::extractGeomData
* Guard unopened case in RimGridCalculation::removeDependentObjects
* Guard empty subset in createLateralAtMeasuredDepth
2026-09-22 08:23:00 +02:00
Kristian Bendiksen 4d2a868079 #14766 Fix potentially uninitialised object used for accumulation
RigStatisticsCalculator::mobileVolumeWeightedMean() accumulated into a sum
from an out-parameter that callees were not required to write. Every
implementation of the per time step overload has early-return paths that
leave the value untouched, as does RigWeightedMeanCalc::weightedMeanOverCells,
so indeterminate stack memory could be summed and presented in the UI.

Return std::optional<double> from the computation layer instead of using an
out-parameter, making "value not available" explicit and impossible to ignore:

- RigWeightedMeanCalc::weightedMeanOverCells
- RigStatisticsCalculator::mobileVolumeWeightedMean and all overrides

Time steps without a computable mean no longer contribute to the accumulated
sum, and are excluded from the divisor. Previously they would either add
garbage or, with a naive zero initialisation, bias the average towards zero.

RigStatisticsDataCache keeps the existing HUGE_VAL marker on its public API
via value_or(), so behaviour seen by RigHistogramData and the overlay info
is unchanged apart from the fix.

Also:
- Set m_isVolumeWeightedMeanCalculated in the per time step cache, which was
  never assigned, so the cached value was recomputed on every call.
- Remove a duplicated ensureKnownResultLoaded() call in
  RigEclipseNativeVisibleCellsStatCalc.

Fixes #14766
2026-09-21 18:36:27 +02:00
Kristian Bendiksen 0eba9e8ef7 #14752 Well Target Mapping: use view-independent data filters 2026-09-18 12:36:43 +02:00
JJ 53ec9dfe4d Modernize preference dialog to better handle many tabs (#14776)
* Modernize preference dialog to better handle many tabs
2026-09-18 11:56:17 +02:00
JJ e0c1f23e6e Support for ensemble jobs (#14773)
Initial support for running well planning opm flow jobs for ensembles
2026-09-17 14:03:54 +02:00
Magne Sjaastad 044454b9b1 Auto-assign Y-axis for ensemble curve sets based on unit/vector match
Extends the existing single-curve auto axis assignment (unit and summary vector matching, then alternating left/right) to also cover RimEnsembleCurveSet. Previously ensemble curve sets were always placed on the default left axis, so e.g. FOPT and FOPR ensembles ended up on the same axis despite differing units.

- Add RimEnsembleCurveSet::unitNameY(), looked up from the first available summary case reader in the ensemble.
- Move X and Y axis assignment from RimSummaryPlot to new RimSummaryPlotTools. Y-axis assignment takes a RiaSummaryAddressModifier::CurveAddressProvider, and compares against both curves and curve sets in the plot.
- RimEnsembleCurveSetCollection::addCurveSet gains an autoAssignPlotAxis flag (default true, matching addCurveAndUpdate for single curves).

Also fixes a bug in the summary plot editor where ensemble curve sets manually assigned to different Y-axes collapsed onto the same axis when clicking OK. The PdmPtrField axis reference does not resolve across the cloned preview and target plots. Add RimEnsembleCurveSet::findOrAssignLeftOrRightAxisY() to capture and re-apply the axis explicitly.

Add RimSummaryPlot-Test.cpp with unit tests for axis auto-assignment of curves and ensemble curve sets.

Fixes #14728
2026-09-16 06:28:50 -04:00
Kristian Bendiksen f32d59775b Python: Reject summary writes for unsupported case types 2026-09-16 11:37:59 +02:00
Kristian Bendiksen ef1ad39723 Python: Reject overwriting source summary vectors 2026-09-16 11:37:59 +02:00
Kristian Bendiksen dc1cc8e243 #14667 Python: Update tubing event interval test 2026-09-16 11:35:13 +02:00
Kristian Bendiksen 52e212e24f #14667 Completions: Simplify segment interval properties 2026-09-16 11:35:13 +02:00
Kristian Bendiksen 63bcc22485 #14667 Completions: Move MSW settings to segments 2026-09-16 11:35:13 +02:00
Magne Sjaastad cfb9e5765e #14761 Find summary data files when file name contains multiple dots
QFileInfo::baseName() truncates at the first dot, so the ESMRY and h5 files were not found for realizations like CASE.V2-0.SMSPEC. Without an UNSMRY file the realization was opened as an empty summary case. Use completeBaseName() to strip only the extension.
2026-09-16 05:06:47 -04:00
Magne Sjaastad 3414fee046 #14345 Ensure reservoir case is open for destination ensemble grid calculations
Also open the reservoir case when the calculation's destination ensemble is set, not only when additional cases type is ENSEMBLE.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen 26314940a3 #14345 Property Filter: Use view case for ensemble filters 2026-09-16 10:53:31 +02:00
Kristian Bendiksen 42d46cf1a8 #14345 Property Filter: Allow bounds without result limits 2026-09-16 10:53:31 +02:00
Kristian Bendiksen 99ce6daf58 #14345 Grid Calculation: Fix additional ensemble selection 2026-09-16 10:53:31 +02:00
Kristian Bendiksen 0ba20f0b65 #14345 Grid Calculation: Add destination ensemble 2026-09-16 10:53:31 +02:00
Kristian Bendiksen 8cbc81fe98 #14345 Grid Calculation: Close cases opened during calculation 2026-09-16 10:53:31 +02:00
Kristian Bendiksen bc9f64af92 #14345 Propagate LGR parent visibility for index-based data filters
The grid calculation data filter evaluated index filters (polygon, user
defined) directly on every grid. An INDEX_K polygon evaluated on a fine
LGR can select no cells, so refined cells whose parent host cell is
inside the polygon were dropped from the aggregation. This gave a lower
sum than the histogram of visible cells in the 3d view, which renders
LGR cells following their parent grid cell.

Hoist the parent grid visibility propagation out of the range filter
branch so it also runs for index filters. Property filters are evaluated
per cell against their own result values and are left untouched.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen b62738ff8a #14345 Restore view visibility for the cell filter view filter type
The cell filter view filter type was changed to use the cell filter
geometry to include cells inside the filters that are inactive in the
view's case, at the cost of ignoring property filters in the view. That
use case is now covered by the data filter type, which evaluates the
filters per calculation case. Restore the original visible cells
semantics for the cell filter view filter type, so property filters in
the view affect the calculation again.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen 5a7e043837 #14345 Add Data Filters to grid ensembles
Add a data filter collection to RimReservoirGridEnsemble, so filters
can be defined once for the ensemble instead of per realization. The
filters are bound to the main case of the ensemble for configuration,
and evaluated per case as elsewhere.

The filter creation commands are available from a Data Filters submenu
on the ensemble node, and the collection node is hidden while empty,
matching the case-level behavior. The grid calculation data filter
options include the filters of the ensemble the destination case
belongs to.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen 996e18426c #14345 Grid Calculation: add filtering with view-independent data filters
Add a filter type option to the grid calculation: None, Cell Filter
View or Data Filter. In data filter mode a single filter from the
destination case's Data Filters collection is selected, and the filter
is evaluated per calculation case and time step using each case's own
active cells and result values. Property based filtering of ensemble
calculations then uses each realization's own property values, which is
not possible with view based filtering.

Old projects with a cell filter view are migrated to the cell filter
view mode. Complex filtering is composed with a combined filter (AND/OR)
in the Data Filters collection.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen e9b28c1b02 #14345 Add per-case cell filter evaluation with source case override
Add a sourceCaseOverride parameter to RimCellFilter::applyToCellVisibility.
When set, property filters evaluate against the override case's result
values instead of the case the filter is bound to, allowing the same
filter definition to be evaluated against each case in an ensemble.
Combined filters forward the override to their children, and geometry
based filters ignore it.

Add RimCellFilterTools::computeReservoirCellVisibility, which evaluates
a cell filter against a given case for all grids and returns the
visibility indexed by reservoir cell index. Range filters propagate the
parent grid visibility into LGR cells, matching the filtered geometry
of a 3d view.

Also add RimCellFilter::setFilterMode.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen da28ffe613 #14345 Use cell filter geometry for grid calculation visibility
The visibility mask for 'filter by view' was taken from the view's
visible cells, which are limited to the active cells of the view's
case. When applying the calculation to additional cases with different
ACTNUM, cells inside the filter geometry that are inactive in the
view's case were excluded from the aggregation for cases where they are
active, giving too low sums.

Build the mask from the cell filter geometry (RANGE_FILTERED +
RANGE_FILTERED_INACTIVE) instead, so each calculation case contributes
its own active cells inside the filters. Property filters in the view
no longer affect the calculation. The result filtering now uses the
same mask as the input filtering, also when the visibility filter is
provided by the caller.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen be9969d5b4 #14345 Add debug logging of value counts used in aggregations and histogram statistics
Log at debug level, for each case and time step, how many input values
contribute to a grid calculation aggregation and how many were replaced
with the default value (non-visible cells and undefined values). Also
log the sum and number of values used when computing visible cells
statistics, to allow comparison with the histogram sum in the 3d view.
2026-09-16 10:53:31 +02:00
Kristian Bendiksen 0ad61a004a #14345 Grid Calculation: replace undefined values with default value in aggregations
Aggregation functions like sum() in the expression parser include all
values in the input vector. Undefined values (HUGE_VAL) could leak into
the aggregation input when a grid case group member has fewer time steps
on disk than the main case it inherits result meta data from, or when a
cell is active in the calculation case but has no value in the source
data. This produced infinite sums for some realizations, while the
histogram statistics ignore undefined values.

Replace undefined values in the aggregation input with the default value
0.0, matching the histogram semantics, and log a warning per case and
variable when values were replaced.
2026-09-16 10:53:31 +02:00
Magne Sjaastad 0579dbb468 Move time-step control and grid-only hooks from Rim3dView to RimGridView
* #14760 Move time-step control and grid-only hooks from Rim3dView to RimGridView
* #14760 Store named 3D visualization models in a shared collection instead of per-model fields
2026-09-16 08:44:00 +02:00
Magne Sjaastad f73afc5b76 #14741 Fix null-pointer dereference in RicPlaceThermalFractureUsingTemplateDataFeature
selectedThermalFracture() dereferenced the result of selectedItemOfType<RimWellPathFracture>() without a null check, surfaced by the command-feature enablement sweep when no fracture is selected.
2026-09-15 08:15:59 -04:00
Magne Sjaastad c1bce5299a #14741 Add individual Ric*Feature command tests
Curated feature tests exercising specific Ric*Feature commands (close case, new view, delete well path, toggle items, new intersection, Eclipse property/cell filters, well path lateral, perforation interval, summary plot, well log plot, polygon, cell index filter), grouped under FeatureTests/Tests with their own CMakeLists_files.cmake.
2026-09-15 08:15:59 -04:00
Magne Sjaastad 7fa9d0c5bf #14741 Add command-feature test infrastructure
Add the ResInsight-featuretests executable: a headless GUI test harness (RiaFeatureTestModelBuilder, RiaFeatureTestTreeView), a runner that triggers Ric*Feature commands through their QAction (RicFeatureExecutionRunner), a generic execution sweep over every registered feature (RicFeatureSweep-Test, RicFeatureExecutionSweep-Test, RicFeatureSubprocessSweep-Test, RicFeatureSweepDenylist), and supporting CMake wiring. Adds RiaRegressionTestRunner::setRunningRegressionTests() so tests can suppress modal dialogs, and shares RimMockSummaryCase as a common test model under TestModels.
2026-09-15 08:15:59 -04:00
Magne Sjaastad aad5fca262 Docs: Add copilot config, extract shared agent workflow guidelines
Create .github/copilot-instructions.md as a minimal GitHub Copilot entry point, trim CLAUDE.md to a minimal pointer file, and move shared safety/output-expectation guidance into docs/agents/workflow.md. Also update the header/implementation-split rule in docs/agents/coding-style.md to allow short one-line bodies and short initializer lists inline in the header.
2026-09-15 12:51:35 +02:00
Magne Sjaastad 2474e8885e #14711 Restyle tiling icons to match Maximize Windows design
Update TileWindows, TileVertically, and TileHorizontally icons to use
a flat, pastel-fill/colored-stroke style consistent with the existing
Maximize Windows icon, replacing the previous bright gradient/dot
design.
2026-09-15 05:01:17 -04:00
JJ b4aededbdb Support tiling windows in a single direction (horz or vert) (#14754)
* Support tiling windows in a single direction (horz or vert)
2026-09-14 20:30:46 +02:00
Magne Sjaastad 43c6e0b518 #14739 Fix null pointer crash in intersection result text builders
Guard against a null flatIntersectionPartMgr() in RiuResultTextBuilder and RiuFemResultTextBuilder. The part manager is only created when the display model is built, but result text can be requested (via selection updates) before that happens, e.g. right after appending a new intersection.
2026-09-14 08:18:04 -04:00
Magne Sjaastad 2120a13d63 #14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG
* #14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG

CMAKE_CXX_FLAGS_RELEASE was overwritten with -DNO_DEBUG on Linux in
both CMakeLists.txt and Fwk/CMakeLists.txt. NO_DEBUG is not a standard
macro, so NDEBUG was never defined in Linux Release builds.

As a result, cafAssert.h fell back to CAF_ENABLE_ASSERTS 1, keeping
CAF_ASSERT (and standard assert()) active in Release and aborting the
app, even though RESINSIGHT_ENABLE_ASSERTS_IN_RELEASE defaults to OFF.
Windows and macOS Release builds were unaffected.

Drop the override entirely so CMake supplies its default Release
flags (-O3 -DNDEBUG) on Linux, matching Windows and macOS.

Also simplify CEE_USE_QT5/CEE_USE_QT6 handling: set them directly
instead of via option() with malformed NOT DEFINED(...) guards.

Fixed missing initialization in VfpValueSelection and WellPathCellIntersectionInfo
2026-09-14 14:17:33 +02:00