Commit Graph
697 Commits
Author SHA1 Message Date
Magne Sjaastad 7728973ddc #12674: Export TVDMSL in the depth unit of the curve
TVDMSL was always written with unit M and the comment 'True vertical
depth in meters', also for a FIELD case whose values are in feet.
RigLasFileExporter now writes TVDMSL with the depth unit of the
curve, as it already does for DEPTH and TVDRKB.

Compute the LAS unit string once via a depthUnitString() helper and
reuse it for DEPTH, TVDMSL, TVDRKB and setDepthUnit, instead of
repeating the unit if/else chain for each quantity.
2026-10-23 16:23:58 +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
JJ 1581e06f2b Export ensemble parameters to file (#15012)
Export ensemble parameters to a comma separated text file provided by user
2026-10-23 07:17:48 +02:00
magnesj c41194e7cb Fixes by clang-tidy 2026-10-22 08:04:32 +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
Jon Jenssen 5293dbe015 Add preference setting to select which dynamic result to show as default (if available) 2026-10-20 19:02:32 +02:00
Magne Sjaastad 72df8a69f5 Fix crash when width data is missing in ensemble fracture statistics
Conductivity and width grids were built as separate lists; a missing width
grid shortened one list and widthGrids[i] went out of range. Build the grids
per definition so they stay paired.

Crash stack (signature 642357244e71):
[3] cvf::cref<RigFractureGrid>::cref(cvf::cref<RigFractureGrid> const&) at cvfObject.inl:410
[4] RigEnsembleFractureStatisticsCalculator::calculateProperty(...) at RigEnsembleFractureStatisticsCalculator.cpp:156
[5] RimStimPlanFractureTemplate::generatePropertiesTable() const at RimStimPlanFractureTemplate.cpp:791
[6] RimStimPlanFractureTemplate::loadDataAndUpdate() at RimStimPlanFractureTemplate.cpp:221
[7] RicMeshFractureTemplateHelper<RimStimPlanFractureTemplate>::createNewTemplatesFromFiles(...) at RicMeshFractureTemplateHelper.inl:149
[8] RicMeshFractureTemplateHelper<RimStimPlanFractureTemplate>::createNewTemplates(...) at RicMeshFractureTemplateHelper.inl:89
[9] RicNewStimPlanFractureTemplateFeature::createNewTemplates() at RicNewStimPlanFractureTemplateFeature.cpp:58
[10] RicNewStimPlanFractureTemplateFeature::onActionTriggered(bool) at RicNewStimPlanFractureTemplateFeature.cpp:78
2026-10-19 19:58:37 +02:00
Magne Sjaastad a7cecc2ecf Return nullptr from gridByIndex for an out-of-range index
A 3D pick can report a grid index that is not valid for the view grid,
which read past the end of the local grids in release builds.

Call stack:
[0] performCrashLogging at ResInsight/ApplicationExeCode/RiaMainTools.cpp:178
[1] manageSegFailureSA(int, siginfo_t*, void*) at ResInsight/ApplicationExeCode/RiaMainTools.cpp:310
[3] cvf::ref<RigLocalGrid>::p() at ResInsight/Fwk/VizFwk/LibCore/cvfObject.inl:307
[4] RiuCellAndNncPickEventHandler::handle3dPickEvent(Ric3dPickEvent const&) at ResInsight/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp:397
[5] RiuViewerCommands::handlePickAction(int, int, QFlags<Qt::KeyboardModifier>) at ResInsight/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp:756
[9] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879
[15] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879
[26] main at ResInsight/ApplicationExeCode/RiaMain.cpp:267
[27] __libc_start_main at :0
2026-10-19 09:41:18 +02:00
Magne Sjaastad 596bbb8fe1 Fix crash in sector model export of an inverted cell box
A view without visible cells gives min > max, which underflowed the
sector size and threw std::length_error when allocating the arrays.

Call stack:
[0] performCrashLogging at ResInsight/ApplicationExeCode/RiaMainTools.cpp:178
[1] manageSegFailureSA(int, siginfo_t*, void*) at ResInsight/ApplicationExeCode/RiaMainTools.cpp:310
[5] manageTerminate() at ResInsight/ApplicationExeCode/RiaMainTools.cpp:249
[12] RigResdataGridConverter::exportGrid(QString const&, RigEclipseCaseData*, bool, cvf::Array<unsigned char> const*, cvf::Vector3<unsigned long> const&, cvf::Vector3<unsigned long> const&, cvf::Vector3<unsigned long> const&) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigResdataGridConverter.cpp:83
[13] RicExportEclipseSectorModelFeature::exportGrid(RimEclipseView*, RicExportEclipseSectorModelUi const&) at ResInsight/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp:167
[14] RicExportEclipseSectorModelFeature::executeCommand(RimEclipseView*, RicExportEclipseSectorModelUi const&, QString const&) at ResInsight/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp:141
[15] RicExportEclipseSectorModelFeature::openDialogAndExecuteCommand(RimEclipseView*) at ResInsight/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp:118
[16] caf::CmdFeature::actionTriggered(bool) at ResInsight/Fwk/AppFwk/cafCommand/cafCmdFeature.cpp:176
[25] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879
[31] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879
[43] RiuViewerCommands::displayContextMenu(QMouseEvent*) at ResInsight/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp:702
[47] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879
[53] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879
[64] main at ResInsight/ApplicationExeCode/RiaMain.cpp:267
[65] __libc_start_main at :0
2026-10-19 09:41:18 +02:00
Magne Sjaastad 5d0c011779 Nested hybrid grid: reject active-cell-only grids and fix setCellResultIndex assert
Active-cell grids report a fixed total cell count, so appended LGR cells overflowed the active cell info array. Return an error instead, and assert on the reservoir cell index.
2026-10-15 13:21:55 +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
Magne Sjaastad c6927648e8 #11172: Add auto Arps decline curve type
Add auto Arps decline curve fitting, document the algorithm and reference the AutoDCA repository.
2026-10-13 12:44:00 +02:00
Magne Sjaastad 9f0b9d2840 #11172: Move decline curve math to RigDeclineCurveCalculator
Add least squares regression as an alternative to the start/end point fit.
2026-10-13 12:44:00 +02:00
Magne Sjaastad e217ffb5c6 Enable flow diagnostics for grids imported with opm-common
* Update flowdiag-app submodule with grid source abstraction
* Add opm-common grid source for flow diagnostics
* Enable flow diagnostics for grids imported with opm-common
* Test flow graph from opm-common matches resdata
* Test flow diagnostics results are equal for all grid readers
* Document EGrid constructor behavior in flow diagnostics grid source
2026-10-13 12:43:01 +02:00
Magne Sjaastad 2f7de9469f #13568 MSW export: Optionally export ISEG in COMPSEGS
Fixes #13568.
2026-10-12 19:12:08 +02:00
Magne Sjaastad 067c9c8880 Catch exceptions when reading INIT file for flow diagnostics
RigOpmFlowDiagStaticData reads the INIT file in its member initializer, outside the existing try blocks. A malformed INIT file throws std::invalid_argument, which escapes to std::terminate.

Catch the exception in ensureStaticDataObjectInstanceCreated(), log a warning and return false. All callers already handle false.

Call stack:
[5] manageTerminate() at ResInsight/ApplicationExeCode/RiaMainTools.cpp:249
[11] Opm::ECLInitFileData::ECLInitFileData(boost::filesystem::path) at ResInsight/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp:1650
[12] RigOpmFlowDiagStaticData::RigOpmFlowDiagStaticData(...) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp:51
[13] std::make_unique<RigOpmFlowDiagStaticData, ...>(...) at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/unique_ptr.h:1070
[14] RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesFvf(int, double, double, double, double*, double*) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp:859
[15] RiuPvtPlotUpdater::queryDataAndUpdatePlot(...) at ResInsight/ApplicationLibCode/UserInterface/RiuPvtPlotUpdater.cpp:137
[16] RiuPlotUpdater::doDelayedUpdate() at ResInsight/ApplicationLibCode/UserInterface/RiuPlotUpdater.cpp:86
[17] RiuPvtPlotPanel::showEvent(QShowEvent*) at ResInsight/ApplicationLibCode/UserInterface/RiuPvtPlotPanel.cpp:341
2026-10-12 19:00:45 +02:00
Magne Sjaastad c27f25ae8a Guard flow diag derived results against missing eclipse case data
RigFlowDiagResults::activeCellInfo() dereferences the ancestor RimEclipseResultCase and its eclipseCaseData() unchecked. The derived results (TOF, Cell Fraction, Communication, Max Fraction Tracer) crash when the solution is detached or the case data is released.

activeCellInfo() now returns nullptr when the case or its data is missing, and the derived-result calculations return nullptr in that case. New test RigFlowDiagResults.DerivedResultWithoutEclipseCase.

Call stack:
[4] RigFlowDiagResults::calculateDerivedResult(RigFlowDiagResultAddress const&, unsigned long) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagResults.cpp:211
[5] RigFlowDiagResults::findOrCalculateResult(RigFlowDiagResultAddress const&, unsigned long) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagResults.cpp:95
[6] RigFlowDiagStatCalc::minMaxCellScalarValues(unsigned long, double&, double&) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigFlowDiagStatCalc.cpp:49
[7] RigStatisticsDataCache::minMaxCellScalarValues(unsigned long, double&, double&) at ResInsight/ApplicationLibCode/ResultStatisticsCache/RigStatisticsDataCache.cpp:121
[8] RimEclipseResultDefinitionTools::updateLegendForFlowDiagnostics(...) at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinitionTools.cpp:422
[9] RimEclipseResultDefinition::updateRangesForExplicitLegends(...) at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp:1705
[10] RimEclipseView::updateLegendRangesTextAndVisibility(...) at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp:1699
[11] RimEclipseView::onUpdateLegends() at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp:1568
[12] RimEclipseView::onCreateDisplayModel() at ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp:854
2026-10-12 19:00:45 +02:00
Magne Sjaastad bdd10d5988 #14903: Avoid out-of-range time step for single time step contour map results 2026-10-12 18:49:08 +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
Magne Sjaastad bc62af3bb5 #14878: Fix stale well picks, import errors and overlapping zones 2026-10-08 12:44:14 +02:00
Magne Sjaastad 37cacc9a41 #14878: Add FMU well-picks data model (RigWellPathFormations, RimWellFormationsFile/Collection)
Parse depth-based FMU well-pick formations.csv files in RifWellPathFormationReader
and expose them as a project-level RimWellFormationsCollection of RimWellFormationsFile
objects. RigWellPathFormations becomes a value type with top/base MD and TVD depths
per formation, independent from the existing K-layer-index .lyr formation names.
2026-10-08 12:44:14 +02:00
Magne Sjaastad cf36012cd2 Modernize well pick reader and RigWellPathFormations, add tests
Return values instead of out-parameters, and move the error dialog
from the reader to the importer so the reader can be unit tested.
Fix crash in level detection when erasing while iterating.
2026-10-07 13:37:23 +02:00
Magne Sjaastad 91e2e4d575 Make RigWellPathFormations a value type
The object is immutable after construction and small, so reference
counting via cvf::Object adds nothing. Store it by value and use
std::optional where it may be absent.
2026-10-07 13:37:23 +02:00
Magne Sjaastad 07d8153852 #14803 Extract well log along radial grid axis by depth
A well in a radial grid is on the grid axis or on a face between angular cells, so no cells are intersected. Fall back to the innermost cell column placed by depth. Fixes empty PLT and RFT grid curves.
2026-10-07 13:37:02 +02:00
Magne Sjaastad a6a2f349b6 Fix crash in RigStimPlanFractureDefinition::minY/maxY on empty Ys 2026-10-05 19:56:10 +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
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
magnesj deda7c2ba5 Fixes by clang-tidy 2026-10-01 07:47:21 +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 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 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 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 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 d3ce3146fd Guard result metadata copy against a main case without results 2026-09-28 09:18:41 +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 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
Magne Sjaastad 2120a13d63 #14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG
* #14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG

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

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

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

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

Fixed missing initialization in VfpValueSelection and WellPathCellIntersectionInfo
2026-09-14 14:17:33 +02:00
Magne Sjaastad aee80deb30 #14698 Guard against NaN/Inf in ensemble parameter correlation
Realizations whose calculated summary vector value is NaN or Inf at
the selected timestep are now excluded from the Pearson correlation
computation instead of propagating NaN through the whole result,
which corrupted the correlation tornado plot. Also guard the final
correlation value against NaN, since the previous check only compared
against +Infinity.

RigEnsembleParameter::stdDeviation() sums squared parameter values,
which can overflow to +Inf for extreme (but finite) magnitudes,
turning normalizedStdDeviation() into NaN. Since NaN compares false
against the variation epsilon, such parameters were silently treated
as having no variation and dropped from parameterCorrelations(),
producing an empty tornado plot for that parameter and calculated
vector combination. Fall back to a range-based variation estimate
when the standard deviation calculation overflows, so the parameter
is retained and the Pearson correlation guard above can take over
instead.
2026-09-09 10:47:54 +02:00
Magne Sjaastad 561bb35bd5 #14704 Guard against zero time-step count in findOrLoadKnownScalarResultForTimeStep
The bounds check on timeStepIndex was only applied when timeStepCount
was greater than zero. When a DYNAMIC_NATIVE result has zero known
time steps for a case, the check was skipped entirely and the
function still returned scalarResultIndex as valid, even though
m_cellScalarResults for it was never resized. Callers such as
RigSoilResultCalculator::calculate then indexed it out of bounds via
a CAF_ASSERT-only check (a no-op in Release builds), causing a
segfault.
2026-09-08 13:14:24 +02:00
Magne Sjaastad de3996ee9e Fix four crashes found via automated stacktrace triage (#14702)
* Fail gracefully when exportSnapshots command has no main window
* Guard against unopened plot panels in selection change handler
* Guard ecl_rsthead_alloc against missing INTEHEAD_KW
* Guard against detached flow diag solution in solverInterface
* Never rewrite all crash-triage reports when updating registry
2026-09-08 11:16:38 +02:00