Commit Graph
4319 Commits
Author SHA1 Message Date
Magne Sjaastad 7f99498072 Fix crash in RimDockWindowController when view widget creation fails
Guarded two unconditional null derefs: dockWidget->setWidget(viewWidget) when viewWidget creation fails, and viewPdmObject() in handleViewerDeletion() when no view has ever been assigned to control. Added regression test for the handleViewerDeletion() case; the setWidget() path requires a running GUI/main window and isn't reachable from the headless unit test harness.
2026-10-05 19:56:10 +02:00
Magne Sjaastad b5b34fcf9b Fix crash synchronizing 2D intersection views when owner case or view is null
synchronize2dIntersectionViews() could crash in two ways: when the view's ownerCase() is null, and when the collection has no Rim3dView ancestor at all (e.g. mid-destruction after detaching from the PDM tree, where firstAncestorOrThisOfTypeAsserted<Rim3dView>() returns null since CAF_ASSERT is compiled out in release). Both cases are now guarded.
2026-10-05 19:56:10 +02:00
Magne Sjaastad 51afde28f5 Fix crash when axis mapping is pruned before plot widget axis setup 2026-10-05 19:56:10 +02:00
Magne Sjaastad a6a2f349b6 Fix crash in RigStimPlanFractureDefinition::minY/maxY on empty Ys 2026-10-05 19:56:10 +02:00
Magne Sjaastad a94358cc0d Drop implicit include dirs from per-file HDF5 include property
A system HDF5 reports /usr/include. CMake filters implicit dirs from
target include directories but not from the source-file
INCLUDE_DIRECTORIES property, so -I/usr/include reached the command line
and broke #include_next <math.h> in <cmath> on gcc-toolset.
2026-10-05 13:27:50 +02:00
Magne Sjaastad c8ad00a904 NNC: Remove RigConnectionContainer, use std::vector<RigConnection> directly
RigConnectionContainer was a thin wrapper around std::vector<RigConnection> with no added value beyond push_back/reserve/remove_duplicates. Replace it everywhere with std::vector<RigConnection> and inline the remaining container-merge and deduplication logic at their single call sites.
2026-10-05 08:39:07 +02:00
Magne Sjaastad 431d454c2a #14806 NNC: Use move semantics for RigConnection
RigConnection had user-defined copy operations and no move operations, so
sorting in remove_duplicates() and merging connections copied the polygon of
every connection.

- Remove the member-wise copy operations, so the implicit noexcept move
  operations are used.
- Take the polygon by value and move it into the connection.
- Add move overloads of RigConnectionContainer::push_back(), and use them when
  collecting the computed connections.
- Avoid copying each native connection when building the set of cell pairs.
2026-10-05 08:39:07 +02:00
Magne Sjaastad c04dbbeec3 #14806 NNC: Only test candidates in the neighbor pillar column for I and J fault faces
Computing additional NNCs spent most of its time running quad overlap tests on
candidate cells outside the neighbor pillar column. Most of these touch the
fault face along an edge only. Restrict candidates for I and J faces to the
neighbor column. This intentionally skips a small number of non-zero area
overlaps outside the column.
2026-10-05 08:39:07 +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
Magne Sjaastad 4ab0938c2d #14806 Faults: Compute unnamed fault faces in parallel and only from positive faces (#14836)
* #14806 Faults: Compute unnamed fault faces in parallel and only from positive faces

- A negative I or J face is the positive face of the neighbor cell with a lower
  index, and is already handled when that neighbor is processed. Only visit the
  positive faces.
- Each cell only writes the fault index of its own positive faces and the
  opposite faces of its neighbors, so process the cells in parallel. The
  thread results are appended in thread order, so the fault faces keep the
  same order as before.

* #14806 Faults: Add unit tests for parallel unnamed fault face computation

Build a small in-memory grid (no file, no view) with geometric faults at
every I interface, and verify that calculateFaults() finds all unnamed
fault faces, keeps them ordered by native cell index (the per-thread
results are appended in thread order), and separates faces touching an
inactive cell into the dedicated inactive fault face list.
2026-10-03 09:16:23 +02:00
Magne Sjaastad 6b96df134e #14806 Cell search tree: Group cells in leaves and store leaf ids in flat arrays
Building the cell search tree was dominated by one small std::vector<int>
allocation per leaf, and a tree with one cell per leaf becomes very deep for
large grids.

- BoundingBoxTree: Store leaf ids in flat arrays, and move the input data
  instead of copying it. The tree shape is unchanged. Queries no longer copy
  the ids of each leaf.
- RigMainGrid: Always group at least 8 cells along K in each leaf.
  findIntersectingCells() removes cells not intersecting the query bounding
  box, so the result is the same set of cells as for a tree with one cell per
  leaf. This also applies to very large grids, which previously got the
  cells of the whole leaf.
- Include cells of nested LGRs and LGR cells in invalid main grid cells in
  the grouped tree, as the previous tree with one cell per leaf did.
2026-10-03 07:57:03 +02:00
Magne Sjaastad c5c0e05012 Fix ensemble contour map GENERATED result statistics and caching bugs (#14813)
Fixes a set of related bugs affecting ensemble contour maps that use a GENERATED (grid calculation) result, plus a related bug where switching a view's case lost generated results.
2026-10-02 15:08:30 +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
Jørgen Herje f015af98ee Dedicated python env for ri-cloud-api (#14831)
- Add ri-cloud-api python env preferences
-  Prevent loop of restart/reconnect when manually clicking "start"/"Authenticate"
2026-10-02 12:44:33 +02:00
Kristian Bendiksen 3046c7e09d #14829: Emit insert-date event comment above DATES keyword
Fixes #14829.
2026-10-02 12:36:54 +02:00
Magne Sjaastad b6704429cd Scope GRPC/ODB/OpenVDS/HDF5 build flags to avoid full rebuilds
- Remove unused SOURCE_GROUP_HEADER_FILES from GrpcInterface CMakeLists
- Scope the following defines to the files that need it ENABLE_GRPC, USE_ODB_API , USE_OPENVDS, USE_HDF5 
- RifOdbReader.cpp copied an odb_InstanceRepository by value, which
  fails to compile under MSVC's strict conformance mode due to an
  ambiguous implicit copy constructor in the vendor headers (diamond
  inheritance). Use a reference instead, since it was only ever read
  from.
2026-10-02 12:24:29 +02:00
Magne Sjaastad fa5ba28b0d Fix macOS build: add missing <iomanip> include for std::setw in remaining test files 2026-10-01 09:17:51 +02:00
Magne Sjaastad 7f7e710b16 Fix macOS build: add missing <iomanip> include for std::setw 2026-10-01 07:59:58 +02:00
magnesj deda7c2ba5 Fixes by clang-tidy 2026-10-01 07:47:21 +02:00
Jørgen Herje 52f9cdf777 Add Polygons data from Cloud (#14811)
Add fetch og polygons from cloud using ri-cloud-api service as submodule

Current version of submodule fetches polygons from Sumo, prodviding polygons with standard results tag.
2026-09-30 18:16:00 +02:00
Magne Sjaastad 61db518efc Address review feedback: add range validation and input-size assertion
- RimContourMapPeaksCollection: clamp m_peakCount to [1,20] and m_minDistance to >= 0.0

- RigContourMapPeakFinder: assert z.size() matches nx*ny before indexing in computeProminenceAndRegionSize
2026-09-30 16:26:04 +02:00
Magne Sjaastad 64fd63b77b #14797 Hide cells-to-include option for line polygon filters 2026-09-30 16:26:04 +02:00
Magne Sjaastad c6664a3361 #14797 Add command to compute contour map peaks
Available from the contour map context menu for Eclipse, GeoMech and ensemble statistics contour maps.
2026-09-30 16:26:04 +02:00
Magne Sjaastad 503ea3eb74 #14797 Contour map: Compute peaks and show them as markers
Each contour map projection owns a peaks collection. Computed peaks are shown in the project tree and visualized as single-point marker polygons in the global polygon collection. Markers are deleted with their peak, copied views drop peaks sharing markers with the original, and peaks are flagged as outdated when the result, time step or value filter changes.
2026-09-30 16:26:04 +02:00
Magne Sjaastad e0e05bcc6d #14797 Polygons: Add sphere display options and view update helpers
Add setters for line and sphere appearance on RimPolygon. Add RimPolygonCollection::updateViewsAfterPolygonsChanged(), shared with the contour map polygon tools, and a deferred variant that is safe to call from destructors.
2026-09-30 16:26:04 +02:00
Magne Sjaastad b28051e3d5 #14797 Add RigContourMapPeakFinder to find local maxima in contour maps
Union-find sweep from highest to lowest value computes the prominence of each peak. Peaks are filtered on prominence and edge contact, ranked by prominence or value, and thinned by minimum distance. Flat shoulders and plateaus are rejected, and prominence is measured against the minimum of each connected data region.
2026-09-30 16:26:04 +02:00
Magne Sjaastad 6c09ad66d9 Fix macOS build: add missing <iomanip> include for std::setw 2026-09-30 07:25:31 +02:00
Magne Sjaastad ccdde6596d #13807 Add 3D viewer background context menu with Link View, Update Bounding Box, Zoom All and default camera position 2026-09-28 18:35:28 +02:00
Magne Sjaastad 50a587b292 #13807 Improve generic view bounding box computation and add explicit recompute command
- Only consider visible well paths when computing the generic view bounding box.
- Fix polygon visibility filtering so individually hidden polygons no longer contribute to the bounding box.
- The bounding box is no longer implicitly invalidated when object visibility is toggled; it now only changes on initial load or when explicitly recomputed.
- Add RicUpdateGenericViewBoundingBoxFeature, a context menu command on RimGeneric3dView that recomputes the domain bounding box from currently visible objects, updates the grid box geometry, and zooms to fit.
2026-09-28 18:35:28 +02:00
Magne Sjaastad 5c97f97f32 #13807 Rename command text 'New View' to 'New Grid Model View' 2026-09-28 18:35:28 +02:00
Magne Sjaastad 34f5c52ca7 #13807 Add Python scripting support for generic view (surface/polygon visibility)
Based on magnesj/ResInsight#1078:
- Lift surfaceInViewCollection()/polygonInViewCollection() to virtual Rim3dView methods
- Make RimGeneric3dView scriptable as GenericView
- Add Project.create_generic_view() Python method
- RimcGridView surface/polygon methods now work on any Rim3dView
- Add Python tests and example script
2026-09-28 18:35:28 +02:00
Magne Sjaastad 7838290a4d #13807 Add a case-less Data View and merge it with Eclipse views in the tree
- Added RimGeneric3dView, a 3D view that is not tied to any grid case,
  useful for wells, surfaces and other data not requiring a reservoir
  grid. The view supports a custom name.
- Introduced RimGenericViewCollection, a new top-level collection that
  holds both Eclipse views and RimGeneric3dView instances. It overrides
  defineUiTreeOrdering() to display both types as a single flat list
  under the top-level 'Views' node.
- RimOilField now exposes a single genericViewCollection instead of a
  plain eclipseViewCollection field.
- RimEclipseViewCollection is unchanged and continues to be used for
  per-case and ensemble view collections.
- Updated RimEclipseCase::globalViewCollection() and related helpers to
  use RimGenericViewCollection, and added matching overloads in
  RicNewViewFeature for creating eclipse views from the merged
  collection.
- Added RicNewGenericDataViewFeature to create a new generic data view
  from the context menu.
2026-09-28 18:35:28 +02:00
Magne Sjaastad a57e53db05 Fix build: declare explicit destructor for RimEclipseContourMapView
cvf::ref<RivContourMapProjectionPartMgr> requires the type to be complete
at the point the implicit destructor is instantiated. Declaring the
destructor and defining it in the .cpp (where RivContourMapProjectionPartMgr.h
is included) avoids the incomplete-type error on clang/gcc Linux builds.
2026-09-28 10:30:12 +02:00
Magne Sjaastad 64b53b0612 #14710 Show active data filter as overlay text in contour map view
Refresh the label when the filter selection changes and repaint immediately, as this happens outside a display model rebuild.
2026-09-28 10:30:12 +02:00
Magne Sjaastad bb8af7bbbd #14710 Compute per-time-step visible cells for dynamic data filters
A static property with an active dynamic filter now produces a contour map per time step. Adds a synthetic ensemble fixture with unified restart files, as the OPM reader used for statistics does not support per-step restart files.
2026-09-28 10:30:12 +02:00
Magne Sjaastad cf75dbf58e #14710 Warn when loading a project with the obsolete formation filter
Keep the removed formation filter fields as obsolete so old projects still parse, and warn that the filter is no longer applied.
2026-09-28 10:30:12 +02:00
Magne Sjaastad 9911c49d2b #14710 Support ensemble data filters in ensemble contour maps
Replace the built-in formation filter with ensemble data filters. Load ensemble data filters after project read, and parent new views before assigning the case so the ensemble filter collection is resolved correctly.
2026-09-28 10:30:12 +02:00
Magne Sjaastad cdfc10b833 Count qwt axes when removing a plot axis 2026-09-28 09:18:41 +02:00
Magne Sjaastad d3ce3146fd Guard result metadata copy against a main case without results 2026-09-28 09:18:41 +02:00
Magne Sjaastad 0db64b400b Catch roff parse errors when checking for grid data 2026-09-28 09:18:41 +02:00
Magne Sjaastad 17e8c96e00 Use resdata reader for cases with non-unified restart files
The opm-common reader only reads unified restart files (UNRST). When the
opm-common reader was selected in preferences, cases with one restart file per
time step (X0000, X0001, ...) were opened without dynamic results.

- Fall back to the resdata reader when there is no unified restart file but
  non-unified restart files are present.
- Unit tests using dynamic results check that the result and time step exist
  before accessing them, so a missing result fails the test instead of
  crashing the test executable.
2026-09-27 21:13:13 +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 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
Magne Sjaastad 016ee07dca #14775 Input Property: rename Generated and refresh Data Sources 2026-09-24 08:17:17 +02:00
Magne Sjaastad 20a6373104 #14780 Add unit tests for grouping mode None with varied folder structures
Add a test covering a flat 'realization-N/CASE.EXT' folder structure
(no iter-N level) grouped with EnsembleGroupingMode::NONE, verifying
all files end up in a single best-effort ensemble. Also add a test
confirming empty input produces no bogus ensemble entry.
2026-09-24 08:16:29 +02:00
Magne Sjaastad e269893c04 #14780 Create a best effort ensemble instead of nothing for None grouping
RiaEnsembleNameTools::groupFilesByEnsembleName had no branch for
EnsembleGroupingMode::NONE, so it silently returned an empty map and
no ensemble was created for this grouping mode. Add handling that
groups all input files into a single ensemble.

Also surface warning dialogs instead of silently doing nothing when
no ensemble/grid ensemble could be created from the selected files,
in RicImportGridAndSummaryEnsembleFeature and
RicCreateGridCaseEnsemblesFromFilesFeature.
2026-09-24 08:16:29 +02:00
Magne Sjaastad 8f9b828ac4 Make filter collection and filter names read-only in tree view 2026-09-22 16:16:23 -04:00
JJ bafaa596a3 Remove obsolete cmake config - SOURCE_GROUP_HEADER_FILES (#14783) 2026-09-22 14:23:32 +02:00