Commit Graph
3581 Commits
Author SHA1 Message Date
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 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
Magne Sjaastad 791a58c9a7 #13874 CorrelationPlot: Fix crash when text parameters are present in ensemble
Add parameter.isNumeric() guard and bounds check in RimCorrelationMatrixPlot::createMatrix(). Text parameters deduplicate values into fewer entries than ensemble cases, causing out-of-bounds access. Add defensive bounds check in RimParameterResultCrossPlot::createCaseData() for consistency.
2026-04-16 16:43:36 +02:00
Magne Sjaastad bc7341bcd0 #13872 WellLog: Fix crash when deleting ensemble well log curve sets
Detach m_qwtPlotCurveForLegendText before the viewer check so it is
always detached before deletion. Add null check for curves in
detachPlotCurves, and explicitly call detachPlotCurves from
RimWellLogTrack::detachAllPlotItems to ensure curves are detached
before the track is destroyed.
2026-04-16 16:43:36 +02:00
Magne Sjaastad e3d5b05125 VTK: Read geometry only on first timestep, log displacements per timestep
Move points and connectivity reading inside the isFirst guard to avoid redundant parsing on subsequent timesteps. Move displacements reading outside the guard so they are read for every timestep, and update the log message accordingly.
2026-04-14 14:56:43 +02:00
Magne Sjaastad 9ff69a2089 VTK: Add unit tests for RifVtkReader and RifVtkImportUtil
Tests cover readPoints/readDisplacements/readConnectivity/readProperties
in RifVtkImportUtil, and file open, step names, FEM part loading,
displacement reading, and field names in RifVtkReader.
2026-04-14 14:56:43 +02:00
Magne Sjaastad b4d0c92d74 GeoMech: Apply displacement to cell selection wireframe 2026-04-14 14:56:43 +02:00
Magne Sjaastad 5fef232b36 VTK: Negate z-component of displacements to match internal convention 2026-04-14 14:56:43 +02:00
Magne Sjaastad fb6a0624c8 VTK: Invert IJK indices to match ResInsight convention
VTK coordinates are negated (z positive downward) to match ResInsight
internal convention, which flips the IJK directions relative to what the
structured grid algorithm expects. Add invertIJK flag to RigFemPartGrid
and RigFemPart so the inversion is applied during struct grid construction.
2026-04-14 14:56:43 +02:00
Magne Sjaastad 1f0c47fb5f VTK: Add displacement field U with components U1/U2/U3 in RifVtkReader 2026-04-14 14:56:43 +02:00
Kristian Bendiksen b707c4588b #13841 Python: Add available_properties API for regular surfaces 2026-04-13 10:53:06 +02:00
Kristian BendiksenandVegard Kippe 0aee9033ac Fix monotonicity of depth values in extendDepthTable and add tests
Only prepend/append padding rows to RSVD/RVVD/RTEMPVD/PBVD/PDVD tables
when the existing table does not already cover the padding depth range.
This prevents non-monotonic depth sequences that caused issues in OPM.

Also expose extendDepthTable as a public static method on RigPadModel
and add unit tests for all extension scenarios.

Co-authored-by: Vegard Kippe <vkip@equinor.com>
2026-04-10 11:49:45 +02:00
Magne Sjaastad 20c8888cba Add unit tests for RiuQwtLinearScaleEngine scale division methods 2026-04-09 15:18:36 +02:00
Magne Sjaastad 2f63230c61 Refactor CorrelationReportPlot: replace showSummaryPlot/AddressSelector with child visibility and dock title bar toggle
- Remove RimSummaryAddressSelector; sync summary plot address directly from curve definitions
- Add defineUiTreeOrdering to expose sub-plots as tree children with showWindow toggle
- Dock widgets now reflect showWindow() state and close signal updates the model
- Add m_showDockTitleBars field to toggle dock area title bar visibility
- Update auto plot title for correlation matrix to 'Pearson Correlation'
2026-04-09 15:18:36 +02:00
Magne Sjaastad f96e509c05 Add click-to-select realization in ParameterResultCrossPlot
Clicking near a data point in the cross plot selects the closest
summary case in the plot main window data source tree view.
2026-04-09 15:18:36 +02:00
Kristian Bendiksen 7897e41c63 #11371 Remove GLEW dependency and use Qt's QOpenGLFunctions (#13631)
* #11371 Remove GLEW dependency and use Qt's QOpenGLFunctions

Replace embedded GLEW library with Qt's native OpenGL function loading
(QOpenGLFunctions/QOpenGLExtraFunctions) to resolve Qt 6 compatibility
warnings about GLEW conflicts with qopenglfunctions.h.

- Update CVF_CALLSITE_OPENGL macro to provide QOpenGLExtraFunctions pointer
- Replace GLEW initialization with Qt OpenGL context validation
- Keep direct calls for fixed-function GL (glBegin, glEnd, glMatrixMode, etc.)
- Remove glew/ directory containing embedded GLEW source

* #11371 Remove GLU dependency to fix Windows build error

GL/glu.h conflicts with Qt's OpenGL headers on Windows due to APIENTRY
redefinition. Replace gluBuild2DMipmaps with glTexImage2D + glGenerateMipmap,
and gluOrtho2D with glOrtho.
2026-04-09 10:34:15 +02:00
Kristian Bendiksen 68b193cd56 #13841 Python: Add get_property API for regular surfaces 2026-04-09 07:59:34 +02:00
Magne Sjaastad e8223485b1 Fix ADL lookup for cvf pdmToVariant/pdmFromVariant overloads
Move pdmToVariant/pdmFromVariant overloads for cvf::Color3f, Vec3d, Mat4d, and
Mat3d from namespace caf to namespace cvf. Templates in
cafInternalPdmFieldTypeSpecializations.h use "using caf::pdmToVariant" followed
by an unqualified call, so ADL searches the argument's namespace (cvf). With the
overloads only in caf, the default template was selected, causing cvf::Color3f to
be stored raw in a QVariant instead of as QColor — breaking color field editing
and producing QVariant::save warnings.

All call sites now use the unqualified "using caf::pdmXxx; pdmXxx(value)" pattern
so ADL finds the correct overload without depending on cvf:: as a visible prefix.
Add AdlVariantTest to cafPdmCoreColor3fTest.cpp that exercises this exact pattern.

Adds caf::toVariant<T> and caf::fromVariant<T> to cafPdmFieldTraits.h as
thin wrappers that encapsulate the ADL two-step internally. Client code can
now call caf::toVariant(x) directly instead of requiring a using-declaration
at every call site.
2026-04-08 23:12:49 +02:00
Magne Sjaastad ab97381d94 Add ADL-based field traits, migrate all call sites, remove cafInternalPdmValueFieldSpecializations.h
Introduce cafPdmFieldTraits.h with ADL-based pdmToVariant/pdmFromVariant/pdmVariantEqual
as a replacement for PdmValueFieldSpecialization. Migrate all types (AppEnum, FilePath,
PdmPointer, cvf types) and all call sites (PdmDataValueField, PdmProxyValueField, UI
framework, ApplicationLibCode). Delete cafInternalPdmValueFieldSpecializations.h.
Add cafPdmFieldTraits unit tests and fix std::optional support.
2026-04-08 12:37:36 +02:00
Magne Sjaastad 125200bf5b #8218 Mac: Pre-populate Windows menu to fix missing menu on macOS
On macOS, the native menu bar hides empty menus. The Windows menu was
populated lazily via aboutToShow, but since it was empty at creation
time macOS never rendered it, so the signal could never fire.

Fix by calling slotBuildWindowActions() after createDockPanels() in
both RiuMainWindow and RiuPlotMainWindow constructors.
2026-04-08 10:57:34 +02:00
Kristian Bendiksen a0dbbf6cb1 Remove deprecated size_t overloads from RigActiveCellInfo
Migrate all callers to use type-safe ReservoirCellIndex and
ActiveCellIndex wrappers, then remove the deprecated isActive(size_t),
cellResultIndex(size_t), and setCellResultIndex(size_t, size_t) methods.
2026-03-31 12:32:05 +02:00
Magne Sjaastad f9a081eb87 Migrate more classes to dynamic buttons 2026-03-31 10:52:29 +02:00
Magne Sjaastad a8ac98ce06 Replace PdmUiPushButtonEditor fields with dynamic buttons
Replace boolean push button fields used as UI triggers with dynamic buttons
added via addNewButton in defineUiOrdering, removing unnecessary field
boilerplate across multiple classes.
2026-03-31 09:16:52 +02:00
Magne Sjaastad 062fe388f7 #refactor Use RimNamedObject and RimCheckableNamedObject in annotation and cell filter classes 2026-03-31 08:58:26 +02:00
Kristian Bendiksen cbbcbb650c #2365 Replace PdmField<QString> with PdmField<caf::FilePath> for file path fields
Convert 11 file/directory path fields from QString to caf::FilePath across
ProjectDataModel classes for type safety and consistent path handling.

Fields converted: RimCalcScript::absoluteFileName,
RimScriptCollection::directory, RimBinaryExportSettings::fileName,
RimExportInputSettings::fileName, RimFractureExportSettings::fileName,
RimReservoirCellResultsStorage::m_resultCacheFileName,
RimProcess::m_workDir, RimWellIASettings::m_baseDir,
RimPlotTemplateFileItem::m_absoluteFileName,
RimWellMeasurement::m_filePath, RimFileWellPath::m_filePath.
2026-03-31 08:46:52 +02:00
Kristian Bendiksen 394bc6c3df #12489 Improve robustness of mean calculators
Replace asserts with early-return guards so zero or negative weights
are silently skipped instead of crashing. Add unit tests for zero-weight
and zero-value edge cases in all three calculator classes.

Fixes #12489.
2026-03-31 08:46:20 +02:00
Magne Sjaastad ba1055fbc4 #13813 Remove duplicated snapshotWindowContent overrides that replicate base class behavior 2026-03-30 17:59:01 +02:00
Kristian Bendiksen 5921c44be0 #4529 Remove nextValidId fields and calculate on the fly
Remove cached next-valid-ID member variables and compute them on demand
by scanning existing objects, following the pattern already used by
RimUserDefinedCalculationCollection. This eliminates unnecessary state
and potential corruption risks.

Fixes #4529.
2026-03-30 17:03:06 +02:00
Kristian Bendiksen 2374301385 #3284 Mohr's Circle: fix off-by-one in IJK display
Use caf::VecIjk0 in MohrsCirclesInfo and convert to VecIjk1 for
display, matching the 1-based indexing used in the 3D view.

Fixes #3284.
2026-03-30 17:02:48 +02:00
Magne Sjaastad 4798a879d0 Refactor based on review
Harmonize plot title enablement for sub-plots
Encapsulate tracking annotation management in RimCorrelationReportPlot
Improve snapshot capture in RimCorrelationReportPlot
2026-03-30 12:06:57 +02:00
Magne Sjaastad c49b6986c0 CorrelationReportPlot: Refinements, fixes, and simplifications
- Use RimViewWindow in RiuCorrelationReportPlotWidget constructor
- Update default dock layout to match desired screenshot
- Generalize context menu selection fixer to use caf::PdmObject
- Simplify code, fix event filter lifetime, plot titles, and disable summary plot zoom

RiuSummaryQwtPlot: Add missing override keyword to setZoomEnabled
2026-03-30 12:06:57 +02:00
Magne Sjaastad 3fa91d2d6b CorrelationReportPlot: Add time readout, fix context menus, and improve layout
- Add time readout to summary plot with static and tracking lines
- Fix unstable context menus by setting selection before menu build
- Support global default dock layout and enable summary plot
- Fix snapshot and hide tracking annotation on mouse leave
2026-03-30 12:06:57 +02:00
Magne Sjaastad d64dcefc07 CorrelationReportPlot: Add optional summary plot with ADS dock manager layout
- Add optional summary plot in upper right corner
- Replace fixed grid layout with ADS dock manager for flexible layout
- Show plot titles and set splitter width to 1px
- Use setupBeforeSave to persist dock layout state
2026-03-30 12:06:57 +02:00
Kristian Bendiksen 94757e93e6 #12957 Sector Model Export: replace Enable checkbox with None refinement mode
Add NONE to RefinementMode enum as the default, removing the separate
m_refineGrid checkbox. The UI now shows refinement options only when
Uniform or Non-Uniform mode is selected.
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 49ea27ed62 #12957 Sector Model Export: require resolved max in RigGridExportAdapter
Move UNDEFINED max resolution to callers so it happens exactly once.
RigGridExportAdapter now asserts that max is resolved on construction.
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 3067823e71 #12957 Sector Model Export: introduce RigRefinement interface hierarchy
Replace the monolithic RigNonUniformRefinement class with a proper
polymorphic hierarchy: RigRefinement (abstract base), RigNoRefinement
(identity), RigUniformRefinement (O(1) uniform), and
RigNonUniformRefinement (per-cell custom fractions).

Ownership uses std::unique_ptr<RigRefinement>, consumers receive
const RigRefinement&. This eliminates the misleading class name,
removes effectiveRefinement() indirection, and gives each refinement
mode an appropriately optimized implementation.
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 4aa0910db3 #12957 Sector Model Export: add non-uniform refinement support to faults code path
Add RigNonUniformRefinement overloads for extractFaults and faultsKeyword,
following the existing dual-overload pattern. The Vec3st overloads now
delegate via fromUniform() to preserve backward compatibility. Update
addFaultsToDeckFile to call effectiveRefinement() instead of refinement().
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 5d6aba0f70 #12957 Sector Model Export: unified refinement abstraction via effectiveRefinement()
Add effectiveRefinement() to RicRefinementSettings, RicExportSectorModelUi, and
RigSimulationInputSettings, always returning RigNonUniformRefinement regardless of
whether uniform, non-uniform, or no refinement is active.

Merge the dual RigGridExportAdapter constructors into a single one taking
RigNonUniformRefinement, and unify transformIjkToSectorCoordinates to a single
overload. Eliminate all hasNonUniformRefinement() branching patterns in
RigSimulationInputTool.cpp in favour of effectiveRefinement().
2026-03-30 11:24:56 +02:00
Kristian Bendiksen e8a1431c36 #12957 Sector Model Export: extract refinement settings into RicRefinementSettings class
Move all refinement-related fields, enums, UI ordering, validation, and
logic from RicExportSectorModelUi into a dedicated RicRefinementSettings
PdmObject class to improve separation of concerns.
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 3e0b2b3fe8 #12957 Sector Model Export: fix off-by-one in WELSPECS HEAD coordinates for non-uniform refinement
The non-uniform path produced 0-based indices using subcellCount/2,
while WELSPECS expects 1-based values. Use (subcellCount+1)/2 to match
the uniform formula semantics of (ref+1)/2.
2026-03-30 11:24:56 +02:00