#14555 Allow statistical grid cases to be used as source for grid calculator expressions - #14578
Merged
Merged
Conversation
…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.
jonjenssen
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 affectedRimReservoirGridEnsemble.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, soRimGridCalculation::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.