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.
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
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
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
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.
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.
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.
* 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
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
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
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
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.
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.
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.
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.
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.
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.
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.
* #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.
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.
- RimContourMapPeaksCollection: clamp m_peakCount to [1,20] and m_minDistance to >= 0.0
- RigContourMapPeakFinder: assert z.size() matches nx*ny before indexing in computeProminenceAndRegionSize
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.
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.
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.
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.
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
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.
* #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
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.
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.
* 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
The grid calculator releases result data per time step to reduce memory
usage when calculating for many cases. If only some time steps are
released, findOrLoadKnownScalarResult() returned early because data was
present for other time steps, leaving the released time steps empty.
Results computed by ResInsight, like riOILVOLUME, then appeared as
undefined in the 3d view after running a calculation for a selected
time step.
Recompute results computed by ResInsight when data is missing for any
time step. Skip the delegation from the single time step variant when
the requested time step already has data, to avoid repeated
recomputation while the calculator releases other time steps.
findOrLoadKnownScalarResultForTimeStep() tried to read ResInsight-
calculated results like riOILVOLUME from the restart file. For lazily
loaded grid case group members these results are never computed, so
every cell ended up undefined and the grid calculator produced zero
sums for all additional cases.
Delegate to findOrLoadKnownScalarResult(), which dispatches to the
result calculators, for results flagged as must-be-calculated and for
the ri* volume results. Already computed data is not computed again.
Sector model export removed all ACTNUM and FAULTS keywords from the deck
and re-inserted the sector-specific replacements at the end of the GRID
section, which always lands in the main DATA file. Decks that keep these
keywords in separate include files lost their file organization, leaving
the original include files empty while the data was written inline.
Collapse duplicates to a single occurrence instead of removing all
occurrences, so the subsequent in-place replacement keeps the keyword in
its original file when the deck is saved with OutputMode::COPY. ACTNUM
keeps the last occurrence since a later ACTNUM overrides an earlier one;
FAULTS keeps the first so fault definitions do not move past keywords
referencing them.
RigWellTargetMappingTools accessed cellScalarResults() and result vectors without verifying the requested time step or index was within bounds, and without checking for null case data pointers. Add the missing guards.
A grid cell has a single COMPDAT connection and must be connected to exactly one segment, but the geometry-based export emitted one COMPSEGS row per branch intersecting the cell. Restore the well-global bookkeeping the removed tree path had: tag each branch with its origin and let the branch carrying most flow claim a shared cell, perforations before fishbones before fractures.