Commit Graph
19108 Commits
Author SHA1 Message Date
Jon Jenssen 0726f20694 Protect flattening code against polylines with a single point 2026-05-02 13:51:40 +02:00
Magne Sjaastad 86500efbdc #13926 GeoMech well log: Guard against OOB indices when interpolating results
Bounds-check every gridResultValues access in interpolateGridResultValue
to prevent segfaults observed in interpolateInterfaceValues' OMP loop
when a result vector was empty or sized for a different result position
type. OOB now returns the infinity sentinel that matches the existing
undefined-value path and the initializeResultValues pre-fill, so
downstream invalid-value checks correctly skip these slots.

interpolateInterfaceValues additionally short-circuits and logs a
warning with the field/component name when the input result vector is
empty, instead of failing silently.
2026-04-30 21:50:45 +02:00
Magne Sjaastad 5239a4d378 #13930 Viewer: Guard against empty frustum in per-model culling
Camera::computeViewFrustum() returns an empty Frustum if the projection
matrix is degenerate (e.g., on the first paint after project open, before
a valid near/far has been set). The per-model culling introduced by
82c7172c1 calls Frustum::isOutside() unconditionally, which asserts when
the frustum has fewer than 6 planes. Skip culling when the frustum is
not fully populated; all valid models then contribute to the near/far
calculation, matching the pre-82c7172c1 behaviour.
2026-04-30 21:50:31 +02:00
Kristian Bendiksen 605662062c #13924 ContourMap: Use early returns in append-to-model guards
Address review feedback: replace the long conjunction guards added in the
previous commit with early-return statements for readability. Hoist the
legendConfig pointer into a local so the body reuses it instead of calling
legendConfig() repeatedly.
2026-04-29 14:20:38 +02:00
Kristian Bendiksen 32374b1cb6 #13924 ContourMap: Guard against null mapGrid/legendConfig in append-to-model
Mirror the nullptr guards added to RimContourMapProjection::generateGeometryIfNecessary
(commit fdc8608a29) in the three sibling RimEclipseContourMapView and
RimGeoMechContourMapView "append ... to model" methods, which were still
unconditionally dereferencing mapGrid() and legendConfig()->scalarMapper().
2026-04-29 14:20:38 +02:00
Kristian Bendiksen 08b998ac4c #13922 PolygonFilter: Guard K index against per-grid cellCountK
The K layer returned by findEclipseKLayer is computed against one grid
(usually the main grid), but updateCellsForEclipse then forwards it to
every grid including LGRs whose cellCountK can be smaller. Inside
updateCellsKIndexEclipse the unguarded cellIndexFromIJKUnguarded call
combined with the bounds-unchecked cell() accessor produced an
out-of-range cell whose corner indices crashed RigCell::center() and
cellCornerVertices.

Fixes #13922.
2026-04-29 14:11:46 +02:00
Kristian Bendiksen 88355751a5 Sector export: Hide empty Refinement Regions folder in project tree
Add shouldBeVisibleInTree() to RimRefinementRegionCollection (true only
when at least one region exists) and consult it from
RimEclipseView::defineUiTreeOrdering. Refresh the parent view's
connected editors from addNewRegion, removeRegion, and onChildDeleted so
the folder appears and disappears as regions are added or removed via
the generic delete-item action.

The "New Refinement Region" action remains reachable from the Eclipse
view's context menu while the folder is hidden.
2026-04-29 13:14:49 +02:00
Kristian Bendiksen 663142be71 Sector export: Exclude refinement region wireframe from mouse picking
Skip pick items with no cvf source info in both pick paths
(displayContextMenu and findFirstItems). Without this, the refinement
region wireframe — which has no source info — became the topmost hit,
causing the picking handler to bail out and leaving Result Info empty
instead of falling through to the underlying cell.
2026-04-29 13:14:49 +02:00
Kristian Bendiksen 2b52193e90 Sector export: Default refinement region to small centered box
Initialize new refinement regions with a small box (~1/4 of grid I/J
extent) centered in I/J and spanning the full K range, so the wireframe
is clearly visible against the parent grid edges instead of coinciding
with the grid bounds.
2026-04-29 13:14:49 +02:00
Kristian Bendiksen 87e9ab7b5b Sector Export: scale MINPV with refinement
This avoids marking small cells as inactive.
2026-04-29 13:14:49 +02:00
Kristian Bendiksen 9d04f0b122 Sector export: Add refinement regions
Promote sector-export refinement from inline wizard fields to first-class
PDM objects so users can create, edit, and preview refinement regions in
the 3D view before opening the export dialog.
2026-04-29 13:14:49 +02:00
Kristian Bendiksen e936ce24a6 CellFilters: Extract RicCellFilterFeatureTools to deduplicate features
The four single-add cell-filter features (CellIndex, UserDefined,
UserDefinedIndex, RangeSlice) repeated the same combined-filter
dispatch: detect a selected RimCombinedFilter, resolve its case, add
the new filter, select it, and bail out. Move that boilerplate into a
templated helper so each feature shrinks to a single call.

Addresses PR #13911 review feedback.
2026-04-29 11:40:18 +02:00
Kristian Bendiksen 5989785daf CellFilters: Invert dependency in RimCombinedFilter
Replace the six typed addNewXxxFilter factories with a single generic
addNewFilter<T>(init) template. The combined filter no longer references
any concrete RimCellFilter subclass; callers supply the type and an init
lambda for type-specific configuration, while the combined filter handles
cycle checks, parent-case propagation, signal wiring, and host notification.

Addresses PR #13911 review feedback.
2026-04-29 11:40:18 +02:00
Kristian Bendiksen 9d5a8c28f4 CellFilters: Add combined filter for mixing cell and property filters
Add RimCombinedFilter, a node placed under the Eclipse property-filter
collection that holds child filters (cell or property) and combines their
results with a user-chosen AND or OR mode. Supports nesting and is exposed
to Python via the generated rips CombinedFilter class.

To let the same evaluation machinery handle any filter type, introduce a
unified applyToCellVisibility(cellVis, grid, timeStep) virtual on
RimCellFilter with a default implementation that bridges the existing
range/index dispatch. RimEclipsePropertyFilter overrides it with the body
extracted from RivReservoirViewPartMgr::computePropertyVisibility, which
collapses to a generic per-child call and preserves the prior behavior
for ordinary property filters.

Loosen RimEclipsePropertyFilterCollection::m_propertyFilters to
PdmChildArrayField<RimCellFilter*>, keeping the XML tag "PropertyFilters"
and the typed propertyFilters() accessor. Add recursive helpers
(hasActiveEvaluatableDescendant, hasActiveDynamicPropertyDescendant,
hasActiveFormationNamesPropertyDescendant) so hasActiveFilters,
hasActiveDynamicFilters and isUsingFormationNames see property filters
nested inside a combined filter. Bridge filter changes inside a combined
filter to updateDisplayModelNotifyManagedViews, since the property-filter
collection doesn't subscribe to filterChanged signals.

The existing RicNew* cell-filter creation features now route the new child
into a selected combined filter when one is selected, otherwise into the
top-level cell-filter collection as before. The combined filter's context
menu offers the full mixed set: property, polygon, range, index,
user-defined, and nested combined filter.
2026-04-29 11:40:18 +02:00
Magne Sjaastad b27199f4ba RimRftCorrelationReportPlot: Rename correlation plot field and accessor to tornado plot 2026-04-29 10:16:24 +02:00
Magne Sjaastad 42a11da26b Correlation: Sync depth range to tornado and use RFT curve depth values for filtering 2026-04-29 10:16:24 +02:00
Magne Sjaastad 97ed7121ed #13863 Roff: Load grid zonation (subgrids) as SUBGRIDS input property
Read the ROFF "subgrids.nLayers" array and expand it into a 1-based per-cell integer property (SUBGRIDS) so ROFF zonation becomes a regular grid property. If a companion "subgrids.names" array is present, zone names are surfaced as category code-names via the existing color-legend flow.
2026-04-28 19:18:12 +02:00
Magne Sjaastad 5d7d6e85ee RimProject: Include reservoir grid ensemble realizations in allGridCases 2026-04-28 13:51:45 +02:00
Magne Sjaastad 8eb225651b Remove obsolete libecl-based RifReaderEclipseRft, use RifReaderOpmRft only 2026-04-28 12:32:21 +02:00
jonjenssen 9a5dfd8183 Do not allow rename of top surface folder 2026-04-28 12:32:08 +02:00
Magne Sjaastad 3cec2a9078 Update vcpkg cache key in clang-tidy workflow to use specific identifier
Change the cache key prefix from `clang++-19` to `clang-tidy-19` to ensure the vcpkg cache for the clang-tidy job is isolated from standard build caches.
2026-04-28 08:08:36 +02:00
Magne Sjaastad 72b6aafa01 Correlation: Sync report plots, fix stale annotations and selection highlight, tune RFT defaults 2026-04-27 15:44:14 +02:00
jonjenssen bc7fbc7b76 Add valve keywords to list of well keywords to filter when exporting sector model 2026-04-27 15:09:39 +02:00
Kristian Bendiksen 0c949f2dc3 #13854 Sector export: Shift BCCON Z-face K indices when pad model is enabled
Pad-model extension assumed OPM-style "Z+" for the positive-Z exterior face,
but ResInsight emits "Z" (OPM-Flow short form). The K1/K2 shift never fired,
leaving the bottom boundary face at the original NZ instead of the new
padded NZ. Match both "Z" and "Z+" so the extension applies.

Adds a regression test verifying that with BCCON_BCPROP and padding the "Z"
exterior face is shifted by nzUpper + nzLower while the "Z-" face remains
at K=1, and documents the exterior-face semantics of the direction mapping.
2026-04-23 19:50:19 +02:00
Kristian Bendiksen 2d88be506d #13908 Python: Add API to read well log information
Expose well logs attached to a well path through the Python API. A new
`well_path.well_logs()` returns the list of well logs, and each
`WellLog` gains `channel_names()` and `well_log_data()` for reading
channel names, measured depth, optional TVD MSL/RKB, and channel
values.

The read methods are registered on the abstract `RimWellLog` base
class and use the common `RigWellLogData` interface so they work for
imported, LAS and OSDU well logs alike.
2026-04-23 19:50:05 +02:00
Magne Sjaastad f91f77d7db Use CeetronSolutions/vcpkg-cache with optimized cache storage structure and submodule-aware cache key 2026-04-20 22:07:23 +02:00
Magne Sjaastad 03409aed70 #13806 Python: Add category mapping API for discrete properties
Introduce set_discrete_property_category_names on Case to bind integer
result values to text labels and optional colors. Internally it creates a
custom ColorLegend, appends one item per value (with an auto-assigned
palette color when the caller does not provide one) and registers the
legend as the default for the (case, resultName) pair.

Also add Project.color_legend_collection() as a dedicated accessor for
the project's ColorLegendCollection, pytest coverage for legend creation
and the default-legend-for-result binding, and two PythonExamples
demonstrating the end-to-end discrete property + category label flow.

#13806 Python: Silence mypy warnings for category_mapping module
2026-04-20 18:55:36 +02:00
Magne Sjaastad 29fc0aeaf5 #13806 PdmScripting: Emit hex strings for cvf::Color3f default values
The Python class generator previously emitted cvf::Color3f defaults using
the raw QTextStream operator ("r g b" floats), which is not valid Python
and does not match the hex-string form that scriptable color fields
expect on writeToField.

Convert Color3f defaults to their QColor::name() hex representation and
quote any non-QString value mapped to "str" (e.g. Color3f, caf::FilePath)
so the generated Python is syntactically valid.
2026-04-20 18:55:36 +02:00
Magne Sjaastad cf62f07224 #13806 Python: Add color legend scripting API
Expose RimColorLegendCollection and RimColorLegend to Python via
CAF_PDM_OBJECT_METHOD entries that let callers create a legend, append
category items with a hex-string color, bind a legend to a (case,
resultName) pair and delete that binding.

Scriptable fields on RimColorLegend and RimColorLegendItem make the
created objects inspectable from Python.

The (case, resultName) binding interface in RimColorLegendCollection,
RimRegularLegendConfig and RimEclipseCellColors now takes a const RimCase*
instead of a case id, matching the caller patterns and avoiding ambiguity
when multiple cases share an id domain.
2026-04-20 18:55:36 +02:00
Magne Sjaastad 75c1cedaec #13806 Python: Add API for creating discrete grid properties
Add a data_type parameter to set_active_cell_property, set_active_cell_property_async
and set_grid_property so callers can upload INTEGER-typed discrete properties in
addition to the existing FLOAT properties. Previously a discrete property required
the result name to end with "NUM"; the explicit data type makes the intent
independent of the name.

The gRPC service now forwards the selected data type to
RigCaseCellResultsData::createCategoryResult, and the Python tests cover both
float and integer property uploads.
2026-04-20 18:55:36 +02:00
Magne Sjaastad bd3836ba25 #13901 ShowPlotData: Invert dependencies via capability mixins and text-dialog signal 2026-04-20 14:09:25 +02:00
Magne Sjaastad 99910c3d7d #13903 Harmonize correlation and tornado bar-chart behavior
Extract shared helpers into a new RimCorrelationBarChartTools
namespace so RimCorrelationPlot and RimRftTornadoPlot share a
single source of truth for:

- highlightSelectedParameterBar and the click-to-parameter-name
  lookup
- the axis-label format, abs/sort-value math, and the
  addBarEntry call (with the "legendText must equal parameter
  name" convention) via addCorrelationBar

Also enable click-to-select on RimCorrelationPlot: use the
parameter name as the bar chart title so click-to-select works,
and recolor the selected bar via a new HighlightBarColor field,
mirroring the pattern used in RimRftTornadoPlot.
2026-04-20 11:41:26 +02:00
Magne Sjaastad 4dfe238fef Summary: Keep curves in other ensembles unchanged when highlighting a realization 2026-04-20 10:52:02 +02:00
Magne Sjaastad c66d29e6ea #13894 PolygonInView: Refresh owning picker editors when toggling picking
After migrating m_enablePicking from a PdmField<bool> to a PdmUiButton callback, the RimPolygonFilter parent was no longer notified via childFieldChangedByUi, so its 3D editor did not register or unregister the pick event handler and the button label did not refresh. Route the toggle through a helper that also calls updateEditorsAndVisualization on the owning RimPolylinePickerInterface.
2026-04-17 21:19:20 +02:00
Kristian Bendiksen f881899815 #13855 Ensure BCPROP goes first in schedule section during sector export 2026-04-17 19:56:49 +02:00
JJ f1923333af Job improvements (#13895)
* Add job wait/queued state
* Add support for limiting number of jobs running
* Add job queue for jobs waiting to run
2026-04-17 19:55:50 +02:00
Magne Sjaastad 7d2d1b831a #13875 ElementPropertyReader: Fix MODULUS scaling bug and remove duplicated code
The range-based loop used the outer column index 'i' as the element index, causing only one slot to be written while all others remained zero. Extracted scaleColumnIfModulus() helper to remove duplication between both branches.
2026-04-16 17:10:16 +02:00
Magne Sjaastad 2b2a010775 #13875 ElementPropertyReader: Add test for readAllElementPropertiesInFileContainingField 2026-04-16 17:10:16 +02:00
Magne Sjaastad c5af814ba1 #12572 VTK: Display stress/strain as folder with component sub-items
Use field name constants S_VTK/E_VTK with a shared separator constant to
derive internal storage keys, filter them from the flat result list, and
expose them as folders with S11-S23 / E11-E23 sub-items in the UI.
2026-04-16 17:09:43 +02:00
Magne Sjaastad 387b19ef62 #12276 Add RFT correlation report plot with cross-plot and tornado plot
* Fix defensive guards and TVD interpolation

Guard against out-of-bounds IJK and invalid cells in RifReaderRftInterface.
Guard against null eclCase in RimDataSourceForRftPlt::address.
Guard against null plot widgets in RiuMultiPlotPage.
Fix interpolateMdFromTvd corrupting valid entries after infinity TVD values
by skipping infinity entries in the first pass and tracking only the last
two valid MD values for the startMD adjustment.

* Add RiuQwtCurveSelectorFilter for click-to-select realization in Qwt plots

New shared event filter class that installs on a QwtPlot canvas and calls a
user-supplied callback with the closest data point on each click.

Migrate the local CurveSelectorFilter in RimParameterResultCrossPlot to use
the new shared class. Add Z_HIGHLIGHTED_CURVE to ZIndex enum and replace all
raw z-order integers in RiuQwtPlotCurveDefines with named constants.

* Add RFT correlation report plot with cross-plot and tornado plot

New classes:
- RimRftCorrelationReportPlot: composite plot showing an RFT well log track
  alongside a parameter cross-plot and a tornado plot sub-plot.
- RimParameterRftCrossPlot: cross-plot of ensemble parameters vs RFT-derived
  measured depth values, with click-to-select realization support.
- RimRftTornadoPlot: tornado plot with correlation-sorted parameter list and
  click-to-select realization support.
- RicCreateRftCorrelationReportFeature: context menu command on RimWellRftPlot
  that creates a RimRftCorrelationReportPlot in the correlation plot collection.

Wire up in RimCorrelationPlotCollection and RimContextCommandBuilder.

* Add click-to-select and highlight selected realization in RFT plots

Install RiuQwtCurveSelectorFilter on RimWellRftPlot canvas to support
click-to-select realization. Highlight the selected realization using a
contrast color (orange-red) and increased line thickness. React to both
click-to-select in the plot and selection changes in the Data Sources panel.

Add Z_HIGHLIGHTED_CURVE z-order and replace raw z-order integers with
named constants in RimWellRftPlot.

Highlight selected realization with XCROSS symbol in RimParameterRftCrossPlot
via RimSummaryEnsembleTools::findSummaryCase.

* RimWellRftPlot: add Create RFT Correlation Report to canvas right-click menu

Override appendMenuItems in RimWellRftPlot to add RicCreateRftCorrelationReportFeature.
Call appendMenuItems from RiuMultiPlotPage::contextMenuEvent so any plot type
can contribute canvas menu items without modifying RiuMultiPlotPage.

* RicShowPlotDataFeature: support RimRftCorrelationReportPlot

Add RimRftCorrelationReportPlot to the isCommandEnabled check and expand
it into its cross-plot and tornado sub-plots in onActionTriggered, matching
the pattern used for RimCorrelationReportPlot.
2026-04-16 16:45:44 +02:00
Magne SjaastadandMagne Sjaastad 6d8092cd94 #13885 OpmCommonSummary: Add try/catch around summary value and time step reads to fix crash
Co-Authored-By: Magne Sjaastad <magne.sjaastad@yahoo.no>
2026-04-16 16:43:36 +02:00
Magne Sjaastad 01e0046a78 #13884 NncFluxData: Guard null grid/summaryView to fix crash during dynamic NNC transfer
ecl_file_get_restart_view can return null when a timestep has no restart
view, and the result was passed unchecked into ERT functions. Also added a
null guard for grid and summaryView at the entry of transferNncFluxData to
prevent a crash in ecl_nnc_geometry_alloc on null grid.
2026-04-16 16:43:36 +02:00
Magne Sjaastad 639024eca4 #13883 SummaryEnsemble: Replace deleteChildrenAsync with synchronous delete to fix race
deleteChildrenAsync() spawns a std::thread that deletes old RimFileSummaryCase
objects concurrently with the OpenMP parallel loop in loadFileSummaryCaseData().
#pragma omp critical only synchronizes OMP threads, not std::threads, so OPM/HDF5
library state was accessed simultaneously from both, causing crashes.

Replace with clearWithoutDelete() + synchronous delete to preserve the observer
signal disconnection fix from #12262 while eliminating the thread race.
2026-04-16 16:43:36 +02:00
Magne Sjaastad 5c35592f3a #13883 HDF5Exporter: Initialize m_hdfFile to nullptr to fix crash on exception
Uninitialized m_hdfFile caused a crash when the H5::H5File constructor
threw an exception, as the catch block called delete on a garbage pointer.
2026-04-16 16:43:36 +02:00
Magne Sjaastad b0799247c8 #13882 SimWellPipes: Guard out-of-bounds branch index to fix pipe visualization crash 2026-04-16 16:43:36 +02:00
Magne Sjaastad d37e50b55b #13876 WellPathGeometry: Return default values instead of assert and crash 2026-04-16 16:43:36 +02:00
Magne Sjaastad d119044854 #13881 GrpcServer: Fix crash from undefined behavior in queue shutdown and missing null guard 2026-04-16 16:43:36 +02:00
Magne Sjaastad 4564a28f06 #13878 ViewLinker: Guard null pointer use in addDependentView
Replace CVF_ASSERT with an early return guard to prevent crash when
view is null or equals the master view. Also guard null pointer use
in RicSetMasterViewFeature.
2026-04-16 16:43:36 +02:00
Magne Sjaastad ca658165bf #13877 ContourMap: Replace assert and crash with std::expected
Replace CVF_ASSERT with bounds checks returning std::unexpected with
descriptive error messages. Call site updated with TODO to propagate
the error when the receiving system is ready.
2026-04-16 16:43:36 +02:00
Magne Sjaastad c82ba05c1b #13876 WellPathGeometry: Return default values instead of assert and crash 2026-04-16 16:43:36 +02:00