Commit Graph
100 Commits
Author SHA1 Message Date
Kristian Bendiksen 43b63ac4bf #14912 Reject enum names that conflict with module symbols 2026-10-23 15:21:23 +02:00
Kristian Bendiksen 5b229cdf32 #14912 Reject duplicate generated Python enum names 2026-10-23 15:21:23 +02:00
Kristian Bendiksen 9feace91ee Split NNC, aquifer and connection code out of RigSimulationInputTool (#15001)
Move EDITNNC, AQU* and COMPDAT/COMPSEGS processing into RigSimulationInput{Nnc,Aquifer,Connection}Tools, and move their tests into matching test files.
2026-10-23 12:32:17 +02:00
Kristian Bendiksen 409f175467 COMPLUMP: Choose completion number by largest overlap in cell
When several perforation intervals cut the same cell, the completion number
was taken from the first contribution, which depended on the order events
were applied. Unrelated event changes (e.g. group tree members) could then
change COMPLUMP numbers on boundary cells.

Pick the number with the largest summed MD overlap in the cell, with ties
going to the lowest number. Also use stable_sort for same-date events so
they keep file order.
2026-10-21 14:43:07 +02:00
Kristian Bendiksen 66c2cd47d3 Sector export: Assign all refined sub-cells to segments in COMPSEGS
Only END_IJK denotes a cell range, DIRECTION alone is a single cell and the MD
interval is split. A defaulted start MD is zero. Without an end MD the record is
copied to each sub-cell so all refined COMPDAT connections are attached to a segment.
2026-10-21 14:42:53 +02:00
Kristian Bendiksen 2a8cd7856b Sector export: Split COMPSEGS MD interval in the direction the well travels through the refined cell 2026-10-21 14:42:53 +02:00
Kristian Bendiksen b84eea5cb1 Sector export: Correct connection factors for refinement perpendicular to wells
Lateral refinement reduces the Peaceman pressure equivalent radius r0 of the
completed center sub-cell. Explicit CF is scaled by
(ln(r0_old/rw)+S)/(ln(r0_new/rw)+S), and an explicit PR item is updated to r0_new.
r0_old is taken from PR, or computed from the original cell size and permeability.
2026-10-21 14:42:53 +02:00
Kristian Bendiksen 9a01e09ecd Sector export: Complete all refined sub-cells along well connections
COMPDAT and COMPSEGS cells were mapped to the center refined sub-cell only,
so with K refinement only every other refined layer was completed, and the
original connection factor was copied unchanged.

Along the connection penetration direction (COMPDAT DIR) all sub-cells are
now completed, with explicit CF and KH scaled by the sub-cell length
fraction. COMPSEGS records are split the same way with the MD interval
divided between the sub-cells. Perpendicular directions still use the
center sub-cell.
2026-10-21 14:42:53 +02:00
Kristian Bendiksen 1960cabc15 Fix unit test aggregate initialization warnings 2026-10-21 14:42:36 +02:00
Kristian Bendiksen 1762dd8099 Enable warnings as errors for application unit tests 2026-10-21 14:42:36 +02:00
Kristian Bendiksen 8dc1d56bd3 #14688 Sim Events: Add API to query event dates and wells
Add event date and well queries with date, owner and event type/keyword
filters to SimulatorEventsDocument and WellEventTimeline, including
latest_event_date() and wells_with_msw_events() for building the
export_msw_for_wells list.
2026-10-19 12:00:28 +02:00
Kristian Bendiksen 360c3c69db #14684 Simulator Events: Allow schedule generation without a grid case
Grid-dependent keywords (WELSPECS, COMPORD, COMPDAT, COMPLUMP, WELSEGS, COMPSEGS, WSEGVALV, WSEGAICD) are skipped and reported as WARNING comments in the schedule header, so production-data-only setups can still generate DATES and well control keywords.
2026-10-19 12:00:28 +02:00
Kristian Bendiksen b2a85fb7a4 #14960 Sim Events: Use first segment MD as user defined reference MD
When a SEGMENT event is applied (SIMEVENTS mapping or timeline
set_timestamp), set the segment collection Reference MD Type to User
Defined and the reference MD to the start MD of the first segment
interval, so WELSEGS TOP_LENGTH matches the first segment.
2026-10-19 09:28:29 +02:00
Kristian Bendiksen 92c4fe8dc2 #14961 Sim Events: Add segment length usage to SIMEVENTS example 2026-10-19 09:28:29 +02:00
Kristian Bendiksen 8174e21561 #14961 Sim Events: Support segment lengths in SEGMENT events
Add FIXED_SEGMENT_LENGTH, MIN_SEGMENT_LENGTH and MAX_SEGMENT_LENGTH to
SIMEVENTS SEGMENT events. The lengths are stored on RimWellEventSegment
(new AddSegmentEvent arguments, 0 = not set) and applied to the segment
interval when the timeline is applied. Invalid combinations (fixed with
min/max, min > max, non-positive values) are reported as parse errors.
2026-10-19 09:28:29 +02:00
Kristian Bendiksen c56e921160 #14958 Sim Events: Move PRESSURE_COMPONENTS to WELSPECS
Move Pressure Drop and Length and Depth from the segment collection to
the well path completion settings. PRESSURE_COMPONENTS is now a dated
WELSPECS attribute used for the WELSEGS header at export, and is
rejected on SEGMENT events.
2026-10-19 09:28:29 +02:00
Kristian Bendiksen 2f86d4c210 #14956: Rename well event Tubing to Segment
Rename RimWellEventTubing to RimWellEventSegment (keyword WellEventSegment),
EventType::TUBING to SEGMENT, and the scripting method AddTubingEvent to
AddSegmentEvent (Python: add_segment_event). Update the project tree label,
schedule comments, Python helpers, examples, tests and docs.
2026-10-19 09:28:29 +02:00
Kristian Bendiksen bcfa6e9fea Nested hybrid grid: Move well connections to reconstructed LGR cells
Well connections read from the restart file referenced the original refined
cells in the main grid. These cells are hidden after reconstruction, but the
well cell visualization does not check the invalid flag, so they were still
drawn. Re-point well connections and well heads to the corresponding LGR cells
and recompute the well cells per grid.
2026-10-15 13:21:55 +02:00
Kristian Bendiksen a789bdb4b4 Well target mapping: option to avoid growing across faults
Add AvoidFaults option that blocks cluster growth across fault faces and
fault NNCs, and generate a WELL_TARGET_FAULT_FACES result with the number
of fault faces per cell.
2026-10-15 12:56:18 +02:00
Kristian Bendiksen 19f94395a7 Well target mapping: separate start and grow data filters
Add a start data filter used when finding starting cells. If empty, the
grow filter is used. An empty grow filter allows growing anywhere.
2026-10-15 12:56:18 +02:00
Kristian Bendiksen 04df5d0309 Fix MSW segmentation test initializers 2026-10-14 10:45:21 +02:00
Kristian Bendiksen 24e5d2b441 #14870 Schedule export: reject independent trees sharing an MSW name 2026-10-12 18:47:03 +02:00
Kristian Bendiksen f3d9d04281 #14870 Schedule export: export multilateral wells once per well name
Wells sharing an export name now produce one WELSPECS/COMPORD record,
one set of MSW keywords, and no duplicate COMPDAT/COMPLUMP connections.
Events on any well in the group trigger the group's keywords.

Connections in cells shared by several well paths of a group are combined
into one record. MSW keywords are exported for the well tree of the first
group member selected for MSW export.

Fixes #14870
2026-10-12 18:47:03 +02:00
Kristian Bendiksen 164dee3f4b #14873 Schedule export: valve events only emit WSEGVALV/WSEGAICD
VALVE events no longer trigger WELSPECS, COMPORD, WELSEGS and COMPSEGS.
WELSEGS/COMPSEGS are only regenerated for tubing and perforation events.

Fixes #14873
2026-10-12 18:47:03 +02:00
Kristian Bendiksen b0f2044746 #14823 Group nested hybrid LGRs per refinement level in the Grids tree 2026-10-12 15:12:48 +02:00
Kristian Bendiksen 3d8912ba6c #14794 Cell filter: Use original parent IJK for IJK range filters on nested hybrid grids
For nested hybrid grids, IJK range filters (I/J/K slices and IJK filters)
now refer exclusively to the original (coarse) grid IJK. Nested-grid local
IJK values are no longer offered, and every cell, including cells in all
refinement levels, is mapped to the original IJK of its top-most parent.

- Add RigNestedHybridGridLayout describing how original cells are embedded
  in the flat grid, shared by the LGR reconstruction and the IJK mapping
- RigMainGrid: store the layout and compute the original IJK of any cell on
  demand by following the parent cell chain, without per-cell storage
- Range filter UI: slider limits, clamping, defaults and active cell range
  use the original grid dimensions; grid selection is hidden
- Evaluate range filters on all grids using the original IJK in the 3D view,
  combined filters and data filters
- 3D view context menu slices use the original IJK of the picked cell
- Add unit tests for the layout, the IJK mapping against OLDIJK, and slice
  filtering across refinement levels
2026-10-12 15:12:48 +02:00
Kristian Bendiksen f8b20a3f44 Add missing function headers in cpp files 2026-10-05 19:56:36 +02:00
Kristian Bendiksen d53419bd5c Remove obsolete SOURCE_GROUP_HEADER_FILES everywhere. 2026-10-05 19:56:36 +02:00
Kristian Bendiksen 65942d455d Workflows: Read workflow schemas with the taskmaestro CLI
Replace the rips.taskmaestro_helper introspect subcommand with
`python -m taskmaestro workflow describe --json`. RimWorkflowDescribeTools
converts the describe output (JSON schemas, depends_on, config_values)
into the workflow graph used by the Workflow UI. This also adds support
for collect dependencies and maps rips.Reservoir to EclipseCase pickers.
2026-10-05 19:56:36 +02:00
Kristian Bendiksen 4175bfdf7b Add README for running ResInsight with the experimental Workflow UI 2026-10-05 19:56:36 +02:00
Kristian Bendiksen d63bde00e4 #14789 Workflow: Visualize taskmaestro DAG in native Qt view 2026-10-05 19:56:36 +02:00
Kristian Bendiksen 5112df4ee0 Workflows: Gate the Workflows UI behind an experimental feature flag
Register a 'workflows' experimental feature and gate the taskmaestro Workflows
UI behind it, following the registry pattern from #14081. The Workflows tree
collection is only added in RimProject::defineUiTreeOrdering when the feature is
enabled, and RimWorkflowCollection::rescanWorkflows() skips the eager discovery
scan (and its per-workflow Python introspection) when disabled.
2026-10-05 19:56:36 +02:00
Kristian Bendiksen 3a7b8f6be8 Workflows: Add UI for taskmaestro workflows
Discover taskmaestro workflows under ~/.taskmaestro/workflows/ and surface
them as a "Workflows" collection in the project tree alongside Scripts.
Each workflow's task input schema is auto-generated by introspecting the
Pydantic models via a Python helper (rips.taskmaestro_helper) and rendered
as PDM field bindings - scalars for str/int/float/bool, and PdmPtrField
pickers for fields typed as rips.Case / rips.WellPath / rips.View.

The Run button on a RimWorkflow writes input.yaml from current bindings
(rips object references serialized as __resinsight_ref__ maps), spawns
the helper's run subcommand, and streams output to a modeless log dialog.
The helper resolves __resinsight_ref__ markers back to live rips objects
via the running ResInsight's gRPC server before driving taskmaestro.
2026-10-05 19:56:36 +02:00
Kristian Bendiksen 4977941896 #14821 Python: Report specific errors when import_surface fails
- Return std::expected from RimSurfaceCollection::importSurfacesFromFiles
  with a message naming the files that could not be imported
- Return specific errors from ImportSurface and NewSurface scripting
  methods instead of nullptr
- Import before deleting the surface to overwrite, so a failed overwrite
  keeps the existing surface
- Catch surfio exceptions in RifSurfio to avoid a crash on corrupt files
- Include the method name in the generic "no result" gRPC error
- Add Python tests for import_surface error handling
2026-10-05 08:30:33 +02:00
Kristian Bendiksen 1cfe49262a #14828: Do not create a view when creating a grid from the Python API
Previously a view was created and ACTNUM displayed when running with GUI.
Users can create a view explicitly through the API.

Fixes #14828.
2026-10-02 14:03:55 +02:00
Kristian Bendiksen 3046c7e09d #14829: Emit insert-date event comment above DATES keyword
Fixes #14829.
2026-10-02 12:36:54 +02:00
Kristian Bendiksen beadb306c2 #14640 Simulator Events: Use one experimental feature flag
The import and schedule export of simulator events are two halves of the same
workflow, so they share the "simulator-events" flag instead of having one
keyword each. Users who enabled "simulator-events-import" have to tick the new
entry once in Preferences -> System -> Experimental Features.
2026-09-25 14:35:45 +02:00
Kristian Bendiksen 9dda0faa3c #14640 Simulator Events: Add menu to export schedule based on events
The schedule generated from the well event timeline can now be written to
file from the GUI, without scripting.

- RicScheduleDataGenerator::generateScheduleForTimeline() collects the dates
  and wells from the timeline (honoring the last applied timestamp, never
  filtering insert-date events). The Python generate_schedule() method now
  calls it, so GUI and Python export the same schedule.
- New RicExportScheduleFeature "Export Schedule from Events" asks only for the
  file name and uses fixed defaults: the Eclipse case of the active view (else
  the first case of the project), MSW keywords for every well with events, the
  first date as a comment and aligned columns.
- Available from the context menu of the well event timeline and the well path
  collection, and from File -> Export, gated by the new experimental feature
  "simulator-events-export".
2026-09-25 14:35:45 +02:00
Kristian Bendiksen 8324af966c #14666 Simulator Events: Expand INSERT_DATE into insert-date events
INSERT_DATE statements are now expanded into one timeline event per
occurrence instead of a list of bare dates, so each generated date keeps
the COMMENT of its statement.

- New RimWellEventInsertDate (EventType::INSERT_DATE): a date-only event
  that generates no keyword, added with
  WellEventTimeline.add_insert_date_event(event_date, comment).
- The schedule generator writes the comment of an insert-date event as
  "--" lines directly below its DATES keyword.
- generate_schedule(_text) no longer takes additional_dates; insert-date
  events are part of the timeline, but keep the previous behavior of not
  being filtered by set_timestamp().
- SimulatorEventsDocument.report_dates and ApplyReport.report_dates are
  replaced by SimulatorEventsDocument.insert_date_events/insert_dates;
  merging files drops insert dates repeating both date and comment.
2026-09-25 14:35:45 +02:00
Kristian Bendiksen 70e10cb386 #14666 Simulator Events: Align INSERT_DATE with other keyword events
INSERT_DATE is now a SCHEDULE event using KEY=VALUE attributes, and the file
format version is bumped to SIMEVENTS 1.2:

    <date-expr> INSERT_DATE [EVERY=<duration>] [UNTIL=<date-expr>]

- EVERY takes a duration literal, DURATION variable or expression
  (EVERY=1mon, EVERY=30d, EVERY=12mon, EVERY=12h) and must be positive.
  Occurrence n is start + n months (clamped), then + n times the fixed part,
  which preserves the dates of the previous DAY/MONTH/YEAR recurrences.
- UNTIL is an inclusive end date and requires EVERY; quote values with spaces.
- COMMENT is accepted and ignored; other attributes are rejected.
- SIMEVENTS 1.1 files and old-style INSERT_DATE lines are rejected with a
  migration hint showing the rewritten line.
2026-09-25 14:35:45 +02:00
Kristian Bendiksen cbd3d39a5c #14582 Simulator Events: Merge events from multiple files
Importing several SIMEVENTS files together now merges them into one document
before coalescing, so keyword events with the same owner, type and timestamp
are combined across files, not only within one file.

- Add merge_simulator_events_documents, parse_simulator_events_files and
  apply_simulator_events_files. Source locations carry the file name, so
  conflict warnings and errors identify both files.
- Reject mismatched UNIT, and a second RESTART or duplicate WELSPECS across
  files. Collect parse errors from all files in one pass.
- Warn when files declare the same FILTER name with different expressions,
  and keep each file's filter instead of reusing the first one.
- CLI accepts multiple files; the import dialog allows multi-selection.
2026-09-25 14:35:45 +02:00
Kristian Bendiksen b0f60c392f #14651 SIMEVENTS 1.1: datetime dates and Go-style durations
Increase the time resolution of the SIMEVENTS format and replace whole-day
integer offsets with Go-style duration literals.

- All DATE values are now datetimes with second resolution. A date-only
  literal means midnight; a time-of-day requires the 'T' separator and
  fractional seconds are rounded to the nearest second.
- DURATION values and offset terms are Go-style literals such as 5d,
  12h30m, 1.5h, 3mon and -3d. Units (mon, d, h, m, s) are mandatory, must
  appear in strictly descending order without repeats, and a fraction is
  allowed only on the last component (never on mon or s). Unitless numbers
  and the legacy DAYS suffix are rejected with hints.
- New Duration type keeps calendar months separate from the fixed
  timedelta part; adding months clamps to the end of shorter months, and
  str() renders the Go-style form.
- Header version bumped to 1.1; 1.0 files are rejected with a migration
  hint.
- Update tests, sample .events file, example script and
  docs/simulatorEvents.md.
2026-09-22 14:20:36 +02:00
Kristian Bendiksen fed0fa43c7 #14772 Python: GridCaseGroup.compute_statistics() treats an empty case_ids list as all cases
The legacy computeCaseGroupStatistics command could not distinguish an unset list from an
empty one, so [] meant all statistics cases. Keep that in the deprecation shim.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 0eff2c193a #14772 exportPropertyInViews: Keep write failures as errors
Only a missing property in a view was a warning in the legacy command; a failed write
aborted with COMMAND_ERROR. The forwarding turned every failure into a warning. Add
RimEclipseView_exportCurrentProperty::hasCurrentProperty() so the Ricf command can
distinguish the two cases without parsing error strings.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 4148e7a5b1 #14772 Create the export folder on demand in exportCompletions and exportMswCompletions
The legacy exportMsw and exportWellPathCompletions commands relied on the export
implementation creating the folder (RicWellPathExportCompletionsFileTools::openFileForExport),
so the default <project>/completions folder worked on a fresh project. The new Rimc methods
rejected a non-existent folder up front. Create it instead, and only fail if that fails.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 7cb5ee4363 #14772 Ricf: Only fall back to the first case/group for replaceCase and replaceSourceCases
RicfForwarding::findCase() and findCaseGroup() resolved a negative id to the first
Eclipse result case / first case group for every legacy command. Only replaceCase and
replaceSourceCases had that behavior; all other commands rejected a missing id. Make the
lookups strict and add explicit findCaseOrFirstEclipseResultCase() / findCaseGroupOrFirst()
for the two replace commands.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen d17930d2b3 #14772 Python: Fix type annotations in new wrapper code 2026-09-22 14:19:23 +02:00
Kristian Bendiksen eac6fa3482 #14772 Python: Update examples to use the object methods instead of deprecated wrappers 2026-09-22 14:19:23 +02:00
Kristian Bendiksen 072ef45909 #14772 Document the Rimc object method / Ricf forwarding convention in the agent guidelines 2026-09-22 14:19:23 +02:00
Kristian Bendiksen 9a6a18cf5d #14772 Python: Remove dead View.export_sim_well_fracture_completions wrapper
The server side of this command was removed in #11871 (simulation well
fractures). The Python wrapper has been failing ever since.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen ebf7a061d8 #14772 Python: Add View.export_contour_map_to_text as object method and forward exportContourMapToText to it
Rim3dView_exportContourMapToText exports the contour map of an Eclipse
or GeoMech contour map view. The implementation is extracted from the
RICF_SOURCE_INIT feature RicExportContourMapToTextFeature into a static
helper returning std::expected, used by both the object method and the
legacy command.

The Python EclipseContourMap/GeoMechContourMap.export_to_text() wrappers
are kept as aliases of the generated method.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen b1a822e7ac #14772 Python: Add Project.run_octave_script as object method and forward runOctaveScript to it
RimProject_runOctaveScript takes Case objects (empty means all Eclipse
cases) and runs the script once per case through the existing
multi-case process launcher. RicfRunOctaveScript resolves the case ids
and forwards to it.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 54c5ef7dad #14772 Python: Add GeoMechCase.create_well_bore_stability_plot as object method and forward createWellBoreStabilityPlot to it
RimGeoMechCase_createWellBoreStabilityPlot takes a WellPath object and
a time step and returns the plot. WBS parameters cannot be passed as a
method argument (child objects are not supported as gRPC method
parameters), so the C++ setter is available for the Ricf forwarder and
the Python wrapper copies a WbsParameters object into the created
plot's Parameters child instead.

The Python wrapper moves from Case to GeoMechCase, accepts both a
WellPath object and (deprecated) a well path name, and keeps the
optional parameters argument.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 6a2e7a2a21 #14772 Python: Add WellLogPlot.export_data_as_las/ascii as object methods and forward exportWellLogPlotData to them
RimWellLogPlot_exportDataAsLas and RimWellLogPlot_exportDataAsAscii
return the exported file names. RicfExportWellLogPlotData picks the
method from the exportFormat and forwards to it. Add
RicfForwarding::findWellLogPlot().

The Python wrappers keep their signature and List[str] return value,
now calling the object methods. The misspelled export_tvdrkb argument
is kept as a deprecated alias of export_tvd_rkb.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen e3e09c0d1f #14772 Python: Add WellPath.export_geometry as object method and forward exportWellPaths to it
RimWellPath_exportGeometry writes the well path to a .dev file in an
explicit folder. RicfExportWellPaths resolves the well path names (empty
means all) and the WELLPATHS export folder from the command file
executor, then forwards to it per well path.
Project.export_well_paths() in Python is kept and emits a
DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 147a60ceec #14772 Python: Add Project.import_formation_names and Case.set_formation_names as object methods and forward importFormationNames to them
The legacy command combined import and assignment with an applyToCaseId.
This is split into RimProject_importFormationNames (returns the
FormationNames object) and RimCase_setFormationNames (takes the
object). RimFormationNames is made scriptable so it can be returned and
passed. RicfImportFormationNames forwards to both.

Project.import_formation_names() in Python keeps its signature, now
returns the FormationNames object, and gains an apply_to_all_cases
flag (default True, matching the old behavior).
Case.import_formation_names() is kept and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen b60ccf1f83 #14772 Python: Add WellPathCollection.import_well_log_files as object method and forward importWellLogFiles to it
RimWellPathCollection_importWellLogFiles imports LAS files given
explicitly and/or all LAS files in a folder. RicfImportWellLogFiles
forwards to it.

Project.import_well_paths() and Project.import_well_log_files() in
Python now call the object methods on the well path collection. Their
signatures and return values are unchanged, so no deprecation.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 06d6e2da65 #14772 Python: Add WellPathCollection.import_well_paths as object method and forward importWellPaths to it
RimWellPathCollection_importWellPaths imports well path files given
explicitly and/or all well path files in a folder, and returns the
names of the imported well paths. The legacy RicImportWellPaths
command (a RICF_SOURCE_INIT feature in Commands/) forwards to it.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 6548c4f4db #14772 Python: Add Project.create_grid_case_group as object method and forward createGridCaseGroup to it
RimProject_createGridCaseGroup returns the created group object.
RicfCreateGridCaseGroup forwards to it and wraps the group id and name
in the legacy createGridCaseGroupResult. The hand-written Python
wrapper is removed since the generated method has the same signature.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 739f3744f6 #14772 Python: Add Project.load_case as object method and forward loadCase to it
RimProject_loadCase loads a grid case from file and returns the case
object. RicfLoadCase forwards to it and wraps the case id in the legacy
loadCaseResult. The hand-written Python Project.load_case() wrapper is
removed since the generated method has the same signature and returns
the most-derived case class.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen cc1f09b665 #14772 Python: Add EclipseCase.create_saturation_pressure_plots as object method and forward createSaturationPressurePlots to it
RimEclipseResultCase_createSaturationPressurePlots exposes the time step
(the legacy command hardcodes 0) and returns an error when no plots
could be created. It only shows the plot window when a GUI is running;
the legacy code dereferenced RiaGuiApplication::instance()
unconditionally. RicfCreateSaturationPressurePlots resolves the cases
and loops, treating per-case failures as warnings as before.

The hand-written Case.create_saturation_pressure_plots() Python wrapper
is removed since the generated EclipseCase method shadows it.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 3ce81c4eca #14772 Python: Add GridCaseGroup.replace_source_cases as object method and forward replaceSourceCases to it
RimIdenticalGridCaseGroup_replaceSourceCases takes the grid file paths
directly (instead of a list file) and an optional ProjectFile, following
the same design as Case.replace_grid. RicfReplaceSourceCases reads the
list file and the executor's last project path and forwards to it.
Project.replace_source_cases() in Python is kept and emits a
DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 1eabb5f5f6 #14772 Forward computeCaseGroupStatistics to RimcEclipseStatisticsCase_computeStatistics
Add an UpdateViews parameter to the existing object method. The legacy
command calls computeStatisticsAndUpdateViews() (which also creates a
view if none exists) while the object method only computes; the default
(false) keeps the object method behavior and the Ricf forwarder passes
true. RicfComputeCaseGroupStatistics resolves the statistics cases and
loops over them.

GridCaseGroup.compute_statistics(case_ids=...) in Python now loops over
statistics_cases() and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 111741b365 #14772 Forward createStatisticsCase to RimcIdenticalGridCaseGroup_createStatisticsCase
Add a PopulateResultSelection parameter to the existing object method.
The legacy command selects all available properties (via
createAndAppendStatisticsCase) while the object method created an
empty selection; the default (false) keeps the object method behavior
and the Ricf forwarder passes true. The created case now gets a case id
assigned in both paths.

Add RicfForwarding::findCaseGroup() and findStatisticsCase().
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 0416bd041e #14772 Python: Add FractureTemplate.set_containment as object method and forward setFractureContainment to it
RimFractureTemplate_setContainment validates the layer range and
updates the template. RicfSetFractureContainment forwards to it.
Project.set_fracture_containment(template_id=...) in Python resolves
the template object and calls the new method, emitting a
DeprecationWarning.
2026-09-22 14:19:23 +02:00
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
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
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
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