Commit Graph
1227 Commits
Author SHA1 Message Date
Magne Sjaastad cd315870f2 #14477 MSW: Sum WSEGVALV area for fishbones ICD subs sharing a grid cell
The legacy tree path gave every fishbones ICD sub connected to the same grid cell the sum of their areas, so the cell sees the total flow area of the ICDs completing it. That was part of updateDataForMultipleItemsInSameGridCell and disappeared with the rest of the tree code, leaving each ICD sub with its own area.

Record the grid cells each ICD sub connects to while the branches are built, and apply the summation together with the effective diameters. FishbonesDiameterContext now carries both, and is renamed to FishbonesExportContext.

An ICD sub connected to several cells takes part in the sum of each of them and ends up with the value of the last cell in ascending cell order. This is order dependent, and is kept because the tree implementation behaved the same way.

None of the projects in TestModels/msw-export has more than one ICD sub per cell, so the sweep against the stored reference output is unchanged. Added unit tests for applyIcdAreaPerCell and applyEffectiveDiameters instead, since neither function had coverage.
2026-08-07 13:29:32 +02:00
Magne Sjaastad a4713ed43b #14477 MSW: Compute effective diameter for fishbones laterals
The geometry path exported the raw equivalent diameter for every fishbones lateral segment. The legacy tree path replaced it with an effective diameter, computed in updateDataForMultipleItemsInSameGridCell, which was removed together with the rest of the tree code.

Reinstate both rules. Laterals sharing a grid cell get Deff = sqrt(d1^2 + d2^2 + ..) over the lateral segments in that cell (#7686). The first segment of a lateral shares its cell with the main bore and with the first segment of every other lateral on the same sub, so it inherits the effective diameter of the second segment of the same lateral (#7731). A lateral contained in a single grid cell has no second segment and keeps the combined value, which is where the difference from the tree path was most visible.

Lateral segments are recorded while the branches are built, since the grid cell of a segment is not recoverable afterwards. COMPSEGS deduplication clears the cell intersections of segments in an already connected cell. The context is shared by the main bore and all tie-in laterals, and applied once the branches are assembled.

Verified against the twelve projects in TestModels/msw-export: every well with stored reference output now matches the legacy values, including the fishbones laterals that previously differed.
2026-08-07 13:29:32 +02:00
Magne Sjaastad c3801b268e #14477 MSW: Restore diameter and roughness for fishbones ICD subs
The fishbones ICD sub segment left RigMswSegment::diameter and roughness unset, and the formatter renders an empty optional as the 1* default marker. The legacy tree path emitted 0.15 and 5.0e-5 for these rows, taken from the RicMswSegment constructor defaults. RigMswSegment has never had such defaults, so the comment claiming the tree behaviour was matched was wrong.

Set both values explicitly, as buildFractureBranches already does. Verified against TestModels/msw-export/project-files/fishbones.rsp: the ICD sub WELSEGS row again exports 0.15000 and 0.0000500, matching the stored legacy reference output.
2026-08-07 13:29:32 +02:00
Magne Sjaastad 593f27dcf4 Guard against null case and view when painting overlay and creating intersections
Four crashes reported from release builds share the same shape: a pointer that
is null during teardown or before a view is fully created is dereferenced
without a check.

RiuViewer::paintOverlayItems() used the owner case of the view and of the
comparison view without checking it, and dereferenced the result of a
dynamic_cast directly. The owner case is null while a case is being closed.

RicIntersectionFeatureImpl::createIntersectionBoxSlize() checked
activeMainOrComparisonGridView() but dereferenced activeGridView(), which is a
different object and can be null or have no viewer.

RimEclipseContourMapView::onCreateDisplayModel() called viewer()->mainCamera()
before the viewer exists.

RimCorrelationPlotCollection::applyFirstEnsembleFieldAddressesToPlot() called
front() on the ensemble parameter vector, which is empty for an ensemble
without realization parameters.
2026-08-07 12:21:41 +02:00
Magne Sjaastad ebf75c09a1 #14411 Enforce name uniqueness for surfaces, polygons and folders
* #14411 Enforce name uniqueness for surfaces, polygons and folders

Names must be unique among siblings sharing the same parent folder. Items in different folders may keep identical names, and comparison is case sensitive.

Siblings are the objects held by the same caf::PdmChildArrayField. Items and folders live in two distinct child arrays in caf::PdmNestedCollection, so a folder and an item may share a name under the same parent.

The Python API gets an OnNameConflict flag on AddFolder, CreatePolygon, ImportSurface and NewRegularSurface, supporting FAIL (default), AUTO_RENAME and OVERWRITE. NewSurface is left out, as grid case surfaces derive their tree label from the case and K index and carry no name of their own.
2026-08-07 08:34:58 +02:00
Magne Sjaastad 5e791353b2 #14470 Do not truncate folder names containing a dot when removing file extension
The ensemble file set removed the file extension by searching for the last dot in the complete path. When the path pattern was already without extension, the last dot was found in a folder name, truncating the path pattern and causing the search for SMSPEC files to fail.

Add RiaFilePathTools::removeFileExtension based on std::filesystem::path::replace_extension, and use it both in RimEnsembleFileSet and in the grid and summary ensemble import, replacing a duplicated lambda doing the same operation.
2026-08-06 14:10:49 +02:00
Magne Sjaastad 0012a65922 #14436 Surface intersection curves and bands for Intersection Box and I/J/K Intersection
* Add RivSurfaceIntersectionCurveTools for shared surface intersection curve geometry
* Move the surface intersection collection to RimIntersection
* Add surface curtain footprints for the box and i/j/k intersections
* Build surface intersection curves for the box and i/j/k intersections
* Follow the pillar tilt when projecting a surface onto an intersection
* Estimate the surface intersection by continuing the pillar past the curtain
2026-08-06 08:06:53 +02:00
Kristian Bendiksen d87a0d3048 Refactor RifFormationNamesReader to return std::expected
Replace the QString* errorMessage out-parameter with std::expected<RigFormationNames, QString> in RifFormationNamesReader, and propagate the pattern to RimFormationNames::readFormationNamesFile() which now returns std::expected<void, QString>.

Fatal errors (file cannot be opened, FMU line-parse failure) return std::unexpected. Malformed .lyr lines are still skipped so the rest of the file loads, with warnings logged via RiaLogging instead of collected in the out-parameter. RimFormationNamesCollection::readAllFormationNames() now logs errors it previously discarded.
2026-08-05 16:03:42 +02:00
Magne Sjaastad 1aa95936fc #14362 Allow arbitrary Z-scale factor
Make the Z-scale combo boxes in the toolbar and property editor editable, so any positive scale value can be entered as text. Invalid input is rejected and the previous value is restored.

Add keyboard shortcuts Ctrl+Shift+Up and Ctrl+Shift+Down to step the Z-scale of the active view through the predefined scale values.
2026-08-04 12:50:34 +02:00
Magne Sjaastad 9ccca3e20a #14401 Introduce initAfterInsert() to combine resolveReferencesRecursively() and initAfterReadRecursively() 2026-08-03 15:34:10 +02:00
Magne Sjaastad 42aa580192 #14426 Export multiple surface properties to IRAP/GRI
Add a multi-select list of values to export in the export dialog, containing the surface depth and the properties available on the selected surfaces. IRAP/GRI files hold a single value per node, so each selected value is written to a separate file named <surface>--<value>. Exporting depth only keeps the plain surface name.

Property values are exported without resampling and require a regular surface with matching Nx and Ny. Values that cannot be exported are reported as warnings.

The export grid defaults are no longer rounded when they originate from a regular surface, and the grid rotation is added to the dialog. Both are required to export the surface without resampling.
2026-07-31 13:54:54 +02:00
Magne Sjaastad d48ecbdcdf #14426 Remember last used export folder when exporting surface to IRAP/GRI
The export folder was only applied to the dialog when a single regular surface was selected. Always seed the folder from the last used EXPORT_SURFACE directory by splitting setDefaults() into setExportFolder() and setGridDefaults().

A single non-regular surface now also falls into the bounding box estimation branch instead of keeping the 10x10 field defaults.
2026-07-31 13:54:54 +02:00
Magne Sjaastad f9c881e442 #14343 Add context menu for toggling selected cases in ensemble import dialog 2026-07-29 15:17:05 +02:00
Magne Sjaastad febea598dc #14379 Guard against missing intersection view in Show 2D Intersection View 2026-07-28 13:02:18 +02:00
Magne Sjaastad 4a06edea28 #14372 Resolve references when creating contour map from 3D view 2026-07-28 11:35:58 +02:00
Kristian Bendiksen 280763f4c0 #14203 Add cumulative curve option to Grid Statistics plot
A new "Show Cumulative Curve" checkbox on the grid statistics data source adds a cumulative curve on the right axis, in addition to the regular histogram curve. The cumulative curve shares the data source of its non-cumulative counterpart and follows all changes to it. The cumulative sum works with all frequency types and both graph types.

Remove the legacy Grid Statistics dialog (RicGridStatisticsDialog) and its context menu command, which provided the previous cumulative display.
2026-07-27 12:37:59 +02:00
Kristian Bendiksen 5dc3374733 #14226 intersection along ijk axis
* #14226 Add intersection along i/j/k axis

Add a new persistent intersection type that follows the grid pillars at a
fixed i, j or k index. Unlike the axis-aligned intersection box, the surface
is built from the grid cell faces and therefore steps along faults and curved
pillars, which is useful for structural restoration analysis.

The user selects the axis, the fixed index, the two perpendicular index
ranges and which cell face (front/back pillar) to use. The geometry generator
emits the chosen cell face of every cell in the index plane directly from the
native pillar corners, so cell result colors map exactly.

The feature is available from the Intersections context menu for Eclipse
views and supports 3D-view picking and cell result readout.
2026-07-27 11:21:05 +02:00
Magne Sjaastad 2ac1948abe #14245 Remove gsl functions and ThirdParty/gsl folder 2026-06-24 18:47:04 +02:00
JJ 82aa009378 Dock system selection improvements and fixes (#14305)
* Make sure we don't trigger another select when a view in the project tree is selected.
* Fix for #14255 and related issues
* Make sure we can close and open a main window, keeping the layout when reopened.
2026-06-24 16:07:21 +02:00
Magne Sjaastad 81f1aca0ba #14277 Hide property filter insert when not a collection child 2026-06-23 07:31:39 +02:00
Magne Sjaastad 3ae102ba6c #14241 MSW: Use valve segment MD for ICV COMPSEGS distances
ICV valve COMPSEGS rows used the cell overlap MD range within the valve coverage instead of the valve segment measured depth. The legacy tree export redirected the perforation intersections onto the ICV segment, so their COMPSEGS Start/End Length reflected the valve segment MD range. Restore that behavior by emitting the ICV COMPSEGS with the valve segment MD range while still selecting the overlapping cells. Fixes test_well_events test_wells_only_appear_at_their_event_dates.
2026-06-19 12:50:14 +02:00
Magne Sjaastad f4a7d2cb4a #14241 MSW: Fix dual-porosity perforation COMPSEGS over-reporting
The geometry-based MSW export emitted a COMPSEGS row for every cell a perforation overlaps in the whole-well geometric intersection. In dual-porosity models this splits a perforation across matrix cells at cell boundaries, producing extra connections that do not match the COMPDAT export. Restrict main-bore perforation COMPSEGS to the cells the perforation actually connects to, computed by clipping the well path to the perforation MD range and re-intersecting the grid, mirroring generatePerforationsCompdatValues. For single-porosity models the cell sets are identical, so this is a no-op.
2026-06-19 12:50:14 +02:00
Magne Sjaastad 3c5c160b93 #14241 MSW: Drop redundant FromGeometry suffix from branch builders
With the legacy tree-based path removed there is only one MSW branch construction approach, so the FromGeometry suffix is no longer needed. Rename buildMainBoreBranchFromGeometry, buildValveBranchesFromGeometry, buildFractureBranchesFromGeometry and buildFishbonesBranchesFromGeometry accordingly, and update the architecture diagrams.
2026-06-19 12:50:14 +02:00
Magne Sjaastad 3e0d2e22ff #14241 MSW: Remove obsolete TODO in buildMswWellExportData
The geometry-based MSW export now handles valve completions, fishbones laterals, fractures and tie-in laterals, so the comment describing these as unimplemented is no longer accurate.
2026-06-19 12:50:14 +02:00
Magne Sjaastad 5afdeac106 #14241 MSW: Update stale comments referencing deleted legacy classes
Remove references to the deleted RicMswItem/RicMswBranch/RicMswSegment tree and the removed collectWelsegsData collection functions from code comments in the geometry-based MSW export path.
2026-06-19 12:50:14 +02:00
Magne Sjaastad 313ed1e4fc #14241 MSW: Remove obsolete legacy MSW code and data structures
Remove the legacy tree-based MSW extraction path now that the geometry-based path is the only supported implementation. This deletes extractSingleWellMsw_Legacy and all unused tree-building helpers in RicWellPathExportMswTableData, trims RicMswTableDataTools to the shared helpers used by the geometry path, and removes the RicMswItem class family (RicMswBranch, RicMswSegment, RicMswCompletions, RicMswExportInfo, RicMswSegmentCellIntersection, RicMswValveAccumulators).

Also remove the useImprovedMswDataStructures preference and its keyword, and delete the obsolete legacy-vs-geometry comparison unit test.
2026-06-19 12:50:14 +02:00
JJ b187bf85a7 Add context menu to empty plot window area (#14243)
* Add context menu to empty plot window area
Improve drag'n'drop into empty plot window area
2026-06-19 09:25:33 +02:00
Jon Jenssen 0973dfd62b Some cleanup 2026-06-17 13:55:32 +02:00
Jon Jenssen 18cf162ce0 Some cleanup 2026-06-17 13:55:32 +02:00
jonjenssen 44488996f3 Clean up PDF snapshots a bit 2026-06-17 13:55:32 +02:00
jonjenssen 52df6fd283 Snapshot work in progress 2026-06-17 13:55:32 +02:00
Jon Jenssen 361b4bc3db Work in progress: Support capturing snapshots with a given size. 2026-06-17 13:55:32 +02:00
Jon Jenssen 9823f9c5a3 Update to latest qt adv docking version
Make sure copied 3d or plot views get a unique id
2026-06-17 13:55:32 +02:00
Jon Jenssen a1fe3739d1 Remove last traces of MDI 2026-06-17 13:55:32 +02:00
jonjenssen fce05bdb81 Work in progress 2026-06-17 13:55:32 +02:00
jonjenssen ff40662366 Work in progress 2026-06-17 13:55:32 +02:00
Jon Jenssen d2d7c6ac61 First non-MDI version. Still some missing links and features. 2026-06-17 13:55:32 +02:00
Jon Jenssen aa9edc43bb Work in progress 2026-06-17 13:55:32 +02:00
jonjenssen cc9a075fc6 Testing 2026-06-17 13:55:32 +02:00
Magne Sjaastad a4246bfebc Expand newly created property filter in tree view 2026-06-11 16:29:04 +02:00
Kristian Bendiksen d78d7cf430 #14192 Update color legend in place on roff property re-import
Reuse RimColorLegendCollection::updateColorLegend in the two roff import
sites that previously deleted and recreated the legend bound to a result,
so views referencing the legend keep their binding on re-import.

Extract the rock color matching from createColorLegendMatchDefaultRockColors
into matchDefaultRockColors so the facies branch can pass matched colors to
updateColorLegend. Remove the now-unused
RimColorLegendCollection::createColorLegend.
2026-06-10 18:02:07 +02:00
Kristian Bendiksen 417e515d3d #14167 Sector Model: Open BCPROP dropdowns on first click
The boundary conditions table required several clicks in each cell before
a value could be changed, because the table view used Qt's default edit
triggers. Add an opt-in editOnSingleClick attribute to the table view
editor that starts editing on a single click and opens combo box popups
immediately, and enable it for the BCPROP keywords table.
2026-06-10 18:01:00 +02:00
Kristian Bendiksen b274641e0c #14198 Exclude ResInsight-generated faults from default fault distance selection
When a new Fault Distance defaults to all faults, the ResInsight-generated
undefined grid faults were ticked by default. Add RimFaultInView::isGeneratedFault
and filter these faults out of the default selection in both the UI feature and
the Python command. An explicit fault selection is still honored.
2026-06-10 13:11:16 +02:00
Magne Sjaastad 63a1dc2b35 #14175 Summary: Fix crash when deleting summary ensemble
Delete the detached ensembles after rebuilding the connected editors instead of before. Updating the tree while the editors still referenced freed objects caused a use-after-free crash in PdmUiTreeItemEditor teardown. This matches the ordering used in caf::CmdDeleteItemExec.
2026-06-10 12:35:16 +02:00
Magne Sjaastad 6a5f19d5a0 #14172 Fix crash in 3D well target editor from null parent well geometry
Guard against a null wellPathGeometry() when configuring the 3D well target editor for the first target of a lateral. The parent well pointer can be non-null while its geometry is not yet available, which caused a null dereference when copying wellPathPoints().
2026-06-10 09:19:28 +02:00
Kristian Bendiksen 12cd173c62 #14101 Add Data Analytics PDM folder with right-click creation
Replace the transient Data Analytics tree label with a real
RimDataAnalyticsCollection object that owns the case-level fault distance
collection and the well target mappings. The folder shows its analytics
objects flattened and exposes a right-click menu to create a new Fault
Distance and a new Well Target Mapping.

Migrate case-level well target mappings from older project files into the
new collection via initAfterRead; fault distance is unreleased and needs
no migration. The case accessors faultDistanceCollection() and
addWellTargetMapping() now forward to the new object, and the creation
features resolve a selected Data Analytics folder.
2026-06-08 21:42:19 +02:00
Kristian Bendiksen c2b4f83643 #14101 Rename RimFaultDistanceResult/Collection classes and files to RimFaultDistance/RimFaultDistanceCollection
Carries the "Fault Distance" rename through to the C++ class names, file
names, PDM/scriptable keywords and the Python API (add_fault_distance,
class FaultDistance). The RicNewFaultDistanceResultFeature command class
keeps its name.
2026-06-08 21:42:19 +02:00
Kristian Bendiksen 74c507a5fa #14101 Move Fault Distance to a case-level Data Analytics folder above the first view 2026-06-08 21:42:19 +02:00
Kristian Bendiksen 2fc99a8ecb #14101 Rename Fault Distance Result object and collection to "Fault Distance" 2026-06-08 21:42:19 +02:00
Magne Sjaastad 59af9f51e9 #14153 Guard against empty well path geometry in MSW cell segment generation 2026-06-08 16:16:40 +02:00