Statistics output refactoring
@arng40 is already working on this.
Since May 28, 2024.
- Dominant language
- C++
- Stars
- 287
- Forks
- 109
- Avg merge
- 4d 41m
- Merged PRs (30d)
- 5
Description
Describe the issue
In the future, outputs of the statistics classes would be done with PackCollection & TimeHistory & 2 events (3 in total), which is quite verbose and inconvenient for the user to maintain.
Proposed cleanup
I propose 2 alternatives but these suggestions could change:
Main Proposal:
We could only have 2 node to ask When and What is to output.
CompositionalMultiphaseStatistics would now be an output, with two optional attributes:
logLevelto enable the reporting in the log, necessary for the user to quickly see the simulation state,outputFile(s?), to allow the output of those statistics in a file (HDF5,CSV...).
Within the code, we would have:
- To gather the data,
CompositionalMultiphaseStatistics(and log it if requested), - To contain the data, a
CompositionalMultiphaseStatistics::RegionStatisticsGroup, as proposed by @untereiner in #2298, - To output the data, the
FieldStatisticsBase(a newStatisticsOutputclass) which would create automatically the necessaryTimeHistoryOutput,PackCollectionand their events.
<Outputs>
<CompositionalMultiphaseStatistics
name="compflowStatistics"
flowSolverName="compositionalMultiphaseFVMSolver"
logLevel="1"
computeCFLNumbers="1"
computeRegionStatistics="1"
outputFile="singlePhaseStats.hdf" />
</Outputs>
<Events>
<PeriodicEvent
name="myStatsOutputEvent"
timeFrequency="1e5"
targetExactTimestep="1"
target="/Outputs/compflowStatistics" />
</Events>
Alternative Proposal
Separate the output file from the statistics declaration, therefore we can have multiple statistics output files inside <Outputs>.
StatsOutput would be an observer of the statistics classes and wouldn't require additional events.
<Tasks>
<CompositionalMultiphaseStatistics
name="compflowStatistics"
flowSolverName="compositionalMultiphaseFVMSolver"
logLevel="1"
computeCFLNumbers="1"
computeRegionStatistics="1" />
</Tasks>
<Outputs>
<StatsOutput
name="myStatsOutput"
source="compflowStatistics"
outputFile="sourceFluxStats.csv" />
</Outputs>
<Events>
<PeriodicEvent
name="myStatsOutputEvent"
timeFrequency="1e5"
targetExactTimestep="1"
target="/Tasks/compflowStatistics" />
</Events>
co-authored with @MelReyCG.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.