Skip to content

Reduce dependenies rig to rim#829

Open
magnesj wants to merge 38 commits intodevfrom
reduce-dependenies-rig-to-rim
Open

Reduce dependenies rig to rim#829
magnesj wants to merge 38 commits intodevfrom
reduce-dependenies-rig-to-rim

Conversation

@magnesj
Copy link
Copy Markdown
Owner

@magnesj magnesj commented Apr 1, 2026

No description provided.

magnesj added 10 commits April 1, 2026 09:00
… RimVisibleCategoriesCalculator

The class depends heavily on Rim* types and belongs in ProjectDataModel rather than ReservoirDataModel, which should not access Rim* classes.
…d rename to RimTofAccumulatedPhaseFractionsCalculator
…rename to RimEnsembleFractureStatisticsCalculator
…voirGridTools

The class depends on Rim* types and belongs in ProjectDataModel rather than ReservoirDataModel, which should not access Rim* classes.
…to RimEclipseCrossPlotDataExtractor

The class depends on Rim* types and belongs in ProjectDataModel rather than ReservoirDataModel, which should not access Rim* classes.
… RimCaseToCaseRangeFilterMapper

The class depends on Rim* types and belongs in ProjectDataModel rather than ReservoirDataModel, which should not access Rim* classes.
…o RimFlowDiagVisibleCellsStatCalc

The class depends on Rim* types and belongs in ProjectDataModel rather than ReservoirDataModel, which should not access Rim* classes.
Replace direct calls to RimCompletionCellIntersectionCalc, RimGridCalculation, and RimProject in computeCompletionTypeForTimeStep with a std::function callback set from RimEclipseCase::setReservoirData.

Change copyResultsMetaDataFromMainCase to accept std::vector<RigCaseCellResultsData*> instead of std::vector<RimEclipseCase*>, moving the Rim-specific filtering to callers in ProjectDataModel.
@qodo-code-review
Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

magnesj added 19 commits April 1, 2026 12:03
Replace the direct RimProject::current()->eclipseCases() lookup in computeDifference with a std::function<RigEclipseCaseData*(int)> parameter. RigCaseCellResultsData stores this as m_caseDataLookup and passes it through; the callback is set from RimEclipseCase::setReservoirData.
…tDefinition to RimEclipseResultDefinitionTools

Move createFromResultDefinition logic to RimEclipseResultDefinitionTools::createResultAccessor in ProjectDataModel. Remove the method and its Rim* includes from RigResultAccessorFactory. Fix RigDepthResultAccessor and RigTimeHistoryResultAccessor to take pre-built accessors instead of RimEclipseResultDefinition*. Update all 13 callers.
Move TracerStatusType enum to RigFlowDiagDefines namespace; add using alias in RimFlowDiagSolution for backward compat. Replace caf::PdmPointer<RimFlowDiagSolution> with a raw pointer in RigFlowDiagResults.h so the header no longer requires a Rim* include. Add a RigCaseCellResultsData* callback to RigFlowDiagStatCalc to remove its indirect Rim* dependency via flowDiagSolution().
Replace RimEclipseResultCase* member with RigEclipseCaseData* and QString gridFileName. Inline cross-flow string helpers to remove dependency on RimFlowDiagSolution static methods. Fix missing RimFlowDiagSolution includes in RimFlowDiagVisibleCellsStatCalc and RivWellConnectionsPartMgr exposed by prior decoupling of RigFlowDiagResults.
The header is located in ExportCommands/ subdirectory which is not in the Commands include path.
Move GridPart, BorderSurface, Boundary and ElementSets into a new RigFaultReactivationEnums.h in namespace RigFaultReactivation. RimFaultReactivationEnums.h now includes the Rig header and provides using-aliases in namespace RimFaultReactivation for backward compatibility with all Rim* callers.
Change postProcessElementSets to take RigMainGrid* and RigActiveCellInfo* directly instead of RimEclipseCase*. The Rim caller (RimFaultReactivationModel) now extracts these from eclipseCase() before calling.
Remove dead updateFilters method which was the only Rim* dependency. Also remove the now-unused RiaApplication include.
Replace RimFracture* constructor parameter with the four Rig/primitive values it extracted: fractureXf, wellRadius, perforationLength, fractureGrid. Callers in RimMeshFractureTemplate and RicExportFractureCompletionsImpl now unpack from RimFracture before calling.
Remove unused RimStimPlanFractureTemplate.h include. Add explicit RigFractureGrid.h include that was previously pulled in transitively.
Replace the RimSimWellInView* public entry point with explicit Rig/primitive parameters (eclipseCaseData, simWellData, timeStepIndex, shortBranchMergeThreshold). The former private wrapper is gone; the caller in RimSimWellInView::wellBranchesForVisualization now unpacks these values from the Rim objects before calling.
Replace the RimSimWellInView* entry point with explicit parameters (eclipseCaseData, simWellData, isAutoDetectBranches, useAllCellCenters). The static centerline method now delegates directly to calculateWellPipeCenterlineForTimeStep with timeStepIndex=-1. Both callers in RimSimWellInView unpack from the view/case before calling.
Remove unused RimWellLogCurve forward declaration from header and unused include from cpp.
…erpolationTools

The class has no Ria/Rim dependencies — pure numeric utility — so it belongs in the Rig layer. All 12 call sites updated to use the new name and include path.
Remove include of RimEclipseCase.h by using the well path name directly as
error identifier, and an empty string where no name is available.
Replace all RimEclipseCase* / RimEclipseCase& parameters with
RigCaseCellResultsData* and RigMainGrid*. Callers in
RigWellTargetMapping extract these from RimEclipseCase before calling.
Replace RimEclipseCase* params with RigCaseCellResultsData* and
RigMainGrid*. Move UI operations (ensureReservoirCaseIsOpen, view
refresh, updateResultAddressCollection) to RimWellTargetMapping.
Split generateEnsembleCandidates into computeEnsembleBoundingBox and
aggregateEnsembleResults; RimRegularGridCase creation moves to caller.
Remove unused RimWellLogCurve and RimWellPath includes.
magnesj and others added 9 commits April 2, 2026 08:58
Get mainGrid via eclipseCaseData()->mainGrid() instead of
RimEclipseCase::mainGrid() which only has a const overload.
Replace all m_flowDiagSolution->... calls in RigFlowDiagResults.cpp with
std::function callbacks set up by RimFlowDiagSolution::flowDiagResults().
Removes RimEclipseCase.h, RimEclipseResultCase.h, RimFlowDiagSolution.h
and RigNumberOfFloodedPoreVolumesCalculator.h from RigFlowDiagResults.cpp.
Move and rename the following files from ReservoirDataModel to ProjectDataModel,
changing the Rig* prefix to Rim* to reflect that they depend on Rim* types:

- RigEclipseToStimPlanCalculator -> RimEclipseToStimPlanCalculator (Completions/)
- RigEclipseToStimPlanCellTransmissibilityCalculator -> RimEclipseToStimPlanCellTransmissibilityCalculator (Completions/)
- RigEclipseToThermalCellTransmissibilityCalculator -> RimEclipseToThermalCellTransmissibilityCalculator (Completions/)
- RigFishbonesGeometry -> RimFishbonesGeometry (Completions/)
- RigWellPathGeometryExporter -> RimWellPathGeometryExporter (WellPath/)
- RigEclipseResultTools -> RimEclipseResultTools (ProjectDataModel/)
- RigSimulationInputTool -> RimSimulationInputTool (ProjectDataModel/)

Update all callers and CMakeLists_files.cmake in both source and destination directories.
Replace RimEclipseCase* constructor parameter with RigEclipseCaseData*,
RigCaseCellResultsData*, and a std::function for uiToNativeTimeStepIndex.
Private methods now take RigActiveCellInfo* directly instead of going
through RimEclipseCase. Also removes RimEclipseCase.h from
RigFlowDiagResults.cpp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant