Commit Graph
32 Commits
Author SHA1 Message Date
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
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 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 4587ad4c98 #1044 Contour maps in 3d views: add topography sampling for draped rendering
Add RigContourMapTopography, a raster of the terrain/grid elevation a contour map is draped onto when shown inside a regular 3d view.
2026-09-07 09:32:04 +02:00
Magne Sjaastad 6c63c755e7 #14606 Contour Map: Use the cached ensemble statistics when the project is reloaded
The map size of the sample grid was recomputed from the expanded bounding box and the sample spacing stored in the project file. The expanded bounding box is an exact multiple of the sample spacing, but after the limited precision of the project file the division can land just above a whole number of cells, and the map size gets one extra cell. The cache files were then rejected, and the ensemble statistics recomputed.

Store the map size in the project file, and use it directly when the sample grid is restored from the cache.

Identify the input grids of the cache validity key by file path, size and modification time, so that the cache is also invalidated when a grid file is modified in place. Label and count the primary case and the ensemble cases, so that a primary case can not be mistaken for the first ensemble case.
2026-08-27 09:37:31 +02:00
Magne Sjaastad 4a6ebedade #14596 Name the remaining unnamed OpenMP critical sections
All unnamed critical regions map to the same implicit name, so a single process wide lock was shared by summary import, geometry generation, grid bounding box computation and NNC merging. Unrelated parallel loops therefore serialized against each other.

Give each region a critical_section_ name describing what it protects. The two regions guarding RifOpmCommonEclipseSummary::sm_createdEsmryFileCount deliberately share one name, as they protect the same counter.
2026-08-25 08:22:29 +02:00
Magne Sjaastad 56e98ba1c4 #14476 ApplicationLibCode: Replace CVF_ASSERT with CAF_ASSERT
Migrate all assert macros in ApplicationLibCode to CAF_ASSERT and remove every
use of cvfAssert.h.

CVF_ASSERT is replaced one to one. CVF_TIGHT_ASSERT is also replaced by
CAF_ASSERT, which is semantically exact: CVF_ENABLE_TIGHT_ASSERTS is 1 only
under _DEBUG, and that is what CAF_ASSERT now does. The two CVF_FAIL_MSG sites
become CAF_ASSERT( false && "message" ), preserving the message with the idiom
already used elsewhere in the code base.

Counts before and after: CVF_ASSERT 1044 to 0, CVF_TIGHT_ASSERT 66 to 0,
CVF_FAIL_MSG 2 to 0, cvfAssert.h references 154 to 0.

Include handling: files that included cvfAssert.h directly now include
cafAssert.h instead, includes left dead by the migration are removed, and files
that were relying on cvfAssert.h transitively get an explicit cafAssert.h. Files
that reach cafAssert.h through another caf header are left unchanged; a missing
include here is a compile error, not a silently disabled assert.

ResultStatisticsCache links only LibCore and therefore had no path to
cafAssert.h. Add the cafPdmCore directory as a private include path rather than
linking the library, since cafAssert.h is header only.

Note that this stops these asserts from firing in Release and RelWithDebInfo,
where CVF_ASSERT was previously active.
2026-08-07 15:05:57 +02:00
Magne Sjaastad 592fe88d5b #14296 Fix spelling: tesselated -> tessellated 2026-06-24 11:52:33 +02:00
Magne Sjaastad 4e229c55d1 #14296 Fix contour map crash on degenerate grid bounds 2026-06-24 11:52:33 +02:00
Magne Sjaastad 6baee431a7 #14209 Guard contour map aggregation against out-of-range result index 2026-06-12 08:32:32 +02:00
Magne Sjaastad ed96d155fc #14007 Contour Map: rebuild projection when cached case data is stale
Reloading a grid file frees and recreates RigEclipseCaseData. The contour map projection caches raw pointers into the case data and previously only refreshed them when reset explicitly via RimReloadCaseTools::updateAll3dViews(). Callers of RimEclipseCase::reloadEclipseGridFile() that bypass updateAll3dViews(), such as RimOpmFlowJob::onCompleted(), left the projection holding dangling pointers that crashed in generateResults/hasResultEntry on the next redraw. The projection now detects that its cached RigEclipseCaseData no longer matches the current case and rebuilds itself before the stale pointers are dereferenced.
2026-06-10 12:33:45 +02:00
Magne Sjaastad 071d6cc19e #14050 CMake: Remove dead variable definitions and references
* CMake: Remove dead CODE_HEADER_FILES variable
* CMake: Remove dead COMMAND_CODE_HEADER_FILES and COMMAND_MOC_SOURCE_FILES
* CMake: Remove dead MOC_SOURCE_FILES and FORM_FILES_CPP references
* CMake: Remove dead HEADER_FILES reference
* CMake: Delete unused CustomPCH.cmake superseded by target_precompile_headers
2026-05-26 13:10:20 +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
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 831751a903 ContourMapProjection: Replace references with naked pointers
Replace reference members and constructor parameters with raw pointers in
RigContourMapProjection and subclasses. Remove cvf::ref usage in
RigEclipseContourMapProjection. Add updateRealizationData() to allow
swapping active cell info and result data per realization without
rebuilding the grid mapping.
2026-03-19 15:10:43 +01:00
Magne Sjaastad d52f595c41 Refactor: Rename RiaStatisticsTools to RigStatisticsTools
Replaced all references to RiaStatisticsTools with RigStatisticsTools across the codebase, including header includes, static method calls, and test files. Updated CMake configuration to remove RiaStatisticsTools and add RigStatisticsTools. Renamed and updated related unit tests. No changes to logic or algorithms; this is a namespace and organizational refactor for consistency. Also added ApplicationLibCode include directories as PRIVATE to relevant targets.
2026-02-18 09:22:39 +01:00
Kristian Bendiksen 10182e99a7 Refactor: Change RigGridBase::cellCornerVertices to return std::array
Refactored RigGridBase::cellCornerVertices to return std::array<cvf::Vec3d, 8> by value instead of taking a reference to std::array as an output parameter. This change improves code readability and leverages modern C++ return value optimizations.

Updated all call sites across the codebase to reflect the new function signature.
2025-09-03 14:21:19 +02:00
Kristian Bendiksen da69eef72b #1584 Replace cvf::vec3d[8] with std::array<cvf::vec3d, 8> 2025-09-03 14:21:19 +02:00
Magne Sjaastad 7653bd80f3 Exclude inactive cells from contour map calculations
* Adds safety check for value index
* Filters inactive cells from contour map calculation
2025-08-29 16:33:34 +02:00
Magne Sjaastad 4135a743fe Release preparations
* Adds a bounds check on the node index to prevent accessing invalid memory locations.
This prevents potential crashes caused by out-of-bounds access when retrieving summary variable values.
* Updates warning message for incomplete deltas
* Plot based on a single realization from a file set ensemble is not restored correctly on project load
* Populate result addresses if no addresses are present
* Adds CNV_ (convergence) result name
* Avoid include of RiaResultNames.h in header file
2025-08-27 14:22:11 +02:00
Magne Sjaastad 37041ad0a6 clang-19-tidy and clang-19-format fixes 2025-05-19 14:31:30 +02:00
Magne Sjaastad fc79395ddd #12472 Fix flaky calculation of contour map top value 2025-05-09 08:22:55 +02:00
magnesj 77c2d624fc Fixes by clang-tidy 2025-04-19 08:26:02 +02:00
Magne Sjaastad 3715667e30 #12327 Small adjustments
* Remove unused volume sum
* Hide more log messages by default
* Allow stepping on top level plot
* Fix update of main plot title
2025-03-31 19:24:04 +02:00
Kristian Bendiksen 395e294b00 Refactor: Move residual oil/gas extraction to RigHydrocarbonTools. 2025-03-31 14:20:43 +02:00
Kristian Bendiksen 55bd7a6fdd Refactor: Move RigFloodSettings to reuse outside of contour map setting. 2025-03-31 14:20:43 +02:00
jonjenssen 02a521d23f Update GUI and calculations for ensemble stat contour map 2025-03-26 13:35:58 +01:00
Magne Sjaastad f4c31e0b28 Create multiple polygons from a contour map
* Fix overwrite of value thresholds
* Fix performance issue with filtered values
* Add "Delete All Polygons" from the polygon collection
* Add area threshold where user can specify area cutoff
2025-02-24 10:06:06 +01:00
jonjenssen 8567841b87 Add support for mobile oil/gas/hc columns (#12129)
* Add support for calculating mobile oil/gas/hc columns in contour maps
2025-02-07 07:24:54 +01:00