Skip to content

#14555 Allow statistical grid cases to be used as source for grid calculator expressions - #14578

Merged
magnesj merged 2 commits into
devfrom
14555-statistics-case-as-grid-calculation-source
Aug 21, 2026
Merged

#14555 Allow statistical grid cases to be used as source for grid calculator expressions#14578
magnesj merged 2 commits into
devfrom
14555-statistics-case-as-grid-calculation-source

Conversation

@magnesj

@magnesj magnesj commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #14555.

Statistics cases can now be used as source for grid calculator expressions.

Case lists

Statistics cases were filtered out of the case lists used by the grid calculator, both in the "Grid Case" column of the variable table and in the case list of the "Select Result" dialog. Statistics cases belonging to a grid ensemble were in addition missing from RimProject::allGridCases(), as only the source cases of the ensemble were collected. Statistics cases in a grid case group were already included, so this only affected RimReservoirGridEnsemble.

Source only, never destination

A calculated result stored in a statistics case is interpreted as computed statistics by RimEclipseStatisticsCase::hasComputedStatistics(), and would block recomputation of the statistics. A statistics case is therefore never auto-assigned as destination case, and the destination case list is unchanged.

Opening the source case

A statistics case with no computed statistics is not necessarily opened, and eclipseCaseData() is then null. Source cases are now opened before the IJK dimensions are validated and before result data is read, so an uncomputed statistics case yields the existing "No data found for variable" message instead of dereferencing a null pointer.

View not updated after a calculation (second commit)

While verifying the above, a view displaying the calculated result showed no legend and no cell colors after loading the project from file, although the cell values were correct.

A case in a grid ensemble is displayed by views in the view collection of the grid ensemble, but RimEclipseCase::reservoirViews() only inspected the view collection of the case itself and the global view collection. No views were found for such a case, so RimGridCalculation::updateDependentObjects() had nothing to refresh and the view kept the display model built earlier in the load sequence, before the calculated result existed.

This part is not specific to statistics cases. It applies to any grid calculation with a destination case in a grid ensemble, and to the other users of reservoirViews() for such cases, for example result removal and case reload.

…culator expressions

Statistics cases were filtered out of the case lists used by the grid calculator, both in the variable table and in the Select Result dialog. Statistics cases belonging to a grid ensemble were also missing from RimProject::allGridCases(), as only the source cases of the ensemble were collected. Statistics cases in a grid case group were already included.

A statistics case can be used as source only. A calculated result stored in a statistics case is interpreted as computed statistics, and would block recomputation of the statistics, so a statistics case is never assigned as destination case.

A statistics case with no computed statistics is not necessarily opened. Make sure source cases are opened before grid dimensions are validated and before result data is read.
…culation is evaluated

A case in a grid ensemble is displayed by views in the view collection of the grid ensemble, but RimEclipseCase::reservoirViews() only inspected the view collection of the case itself and the global view collection. No views were found for such a case, so the display model was never rebuilt after a grid calculation was evaluated. When loading a project file, the view was left with the display model created before the calculation was evaluated, showing no legend and no cell colors.
@magnesj magnesj self-assigned this Aug 21, 2026
@magnesj
magnesj requested a review from jonjenssen August 21, 2026 12:38
@magnesj
magnesj merged commit 2a35edc into dev Aug 21, 2026
21 checks passed
@magnesj
magnesj deleted the 14555-statistics-case-as-grid-calculation-source branch August 21, 2026 12:53
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.

Allow statistical grid cases to be used as source for grid calculator expressions

2 participants