Skip to content

Add ERst::dataSize() - #5331

Open
kriben wants to merge 1 commit into
OPM:masterfrom
CeetronSolutions:erst-data-size
Open

Add ERst::dataSize()#5331
kriben wants to merge 1 commit into
OPM:masterfrom
CeetronSolutions:erst-data-size

Conversation

@kriben

@kriben kriben commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

ERst reports how many times a name occurs in a report step through occurrence_count(), but not how many elements those occurrences hold. A caller building a summary of the arrays of a restart file, for instance one that treats the global grid and the LGRs as a single result, therefore had to walk listOfRstArrays() for every grid and add the sizes up itself.

Add dataSize(), which returns the total number of elements stored under a name in a report step, counting every occurrence. An unknown name gives zero and a non existing report step throws, as in occurrence_count().

ERst reports how many times a name occurs in a report step through
occurrence_count(), but not how many elements those occurrences hold.
A caller building a summary of the arrays of a restart file, for
instance one that treats the global grid and the LGRs as a single
result, therefore had to walk listOfRstArrays() for every grid and add
the sizes up itself.

Add dataSize(), which returns the total number of elements stored under
a name in a report step, counting every occurrence.  An unknown name
gives zero and a non existing report step throws, as in
occurrence_count().

Co-authored-by: Kristian Bendiksen <kristian.bendiksen@gmail.com>
@bska

bska commented Sep 2, 2026

Copy link
Copy Markdown
Member

Add dataSize(), which returns the total number of elements stored under a name in a report step, counting every occurrence.

That's a very weird thing to compute. Why do you need it? In a run with LGRs, the total data size per array is just sum of the number of active cells per grid. That's a constant.

@kriben

kriben commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Add dataSize(), which returns the total number of elements stored under a name in a report step, counting every occurrence.

That's a very weird thing to compute. Why do you need it? In a run with LGRs, the total data size per array is just sum of the number of active cells per grid. That's a constant.

It is not the always sum of active cells, I think. As a counter-example: in the LGR_TESTMOD file FIPGAS/FIPOIL/FIPWAT are written for the global grid only: 30 values when the reservoir has 350 active cells.

In ResInsight we are classifying the arrays as a "cell result for the porosity model" if they are valueCount % reservoirActiveCellCount == 0. That is our way of excluding well and drilling related ones (e.g. IWEL and XCON) which don't exist on all time steps. So we need to know the sizes from the file for that. But it does not have to be ERst that adds them up: we can add a small method in ResInsight to do it instead.

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.

3 participants