|
GEOS
|
Reponsible of computing physical statistics over the grid, registering the result in the data repository, but not storing / outputing it by itself. It does not have mutable state except the encountered issues. More...
#include <StatisticsAggregatorBase.hpp>
Classes | |
| struct | DiscretizationGroupPath |
| struct | StatsState |
| struct | ViewKeys |
| the associated view keys More... | |
Public Types | |
| using | SolverType = typename StatsAggregatorTraits< Impl >::SolverType |
| using | StatsGroupType = typename StatsAggregatorTraits< Impl >::StatsGroupType |
| template<typename OwnerType > | |
| using | RegionStatsFunc = std::function< void(OwnerType &, StatsGroupType &) > |
| Standard function signature for any functor that applies on statistics group instances (StatsGroupType) More... | |
| using | RegionStatsRegisterFunc = std::function< StatsGroupType &(dataRepository::Group &, string const &) > |
| A functor that can be used to register a statistics Group instance. Parameters: More... | |
Public Member Functions | |
| StatsAggregatorBase (dataRepository::DataContext const &ownerDataContext, dataRepository::Group &meshBodies, bool statsOutputEnabled) | |
| Construct a new Stats Aggregator object. More... | |
| void | initStatisticsAggregation (SolverType &solver) |
| Enable the computation of any statistics, initialize data structure to collect them. Register the resulting data wrappers so they will be targeted by TimeHistory output. More... | |
| void | forRegionStatistics (RegionStatsFunc< MeshLevel > const &functor) const |
| void | forRegionStatistics (MeshLevel &mesh, StatsGroupType &meshRegionsStatistics, RegionStatsFunc< CellElementRegion > const &functor) const |
| void | forRegionStatistics (CellElementRegion ®ion, StatsGroupType ®ionStatistics, RegionStatsFunc< CellElementSubRegion > const &functor) const |
| bool | isComputed (real64 const timeRequest, StatsGroupType const &stats) |
| void | setDirty () |
| set the statistics as dirty, ensuring isComputed() will be false until the next computation. | |
| bool | computeRegionsStatistics (real64 const timeRequest) |
| Compute statistics on the mesh discretizations (average field pressure, etc) Results are reduced on rank 0, and broadcasted over all ranks. More... | |
| string const & | getOwnerName () const |
| stdVector< string > const & | getWarnings () const |
| dataRepository::Group & | getInstanceStatisticsGroup (MeshLevel &mesh) const |
| StatsGroupType & | getRegionsStatistics (MeshLevel &mesh) const |
| StatsGroupType & | getRegionStatistics (MeshLevel &mesh, string_view regionName) const |
Protected Member Functions | |
| void | enableRegionStatisticsAggregation (RegionStatsRegisterFunc &®isterStatsFunc) |
| Enable the computation of region statistics, initialize data structure to collect them. Register the resulting data wrappers so they will be targeted by TimeHistory output. More... | |
| MeshLevel & | getMeshLevel (DiscretizationGroupPath const &path) const |
| void | initStats (StatsGroupType &stats, real64 time) const |
| Initialize all statistics values to aggregable default values, before any computation / reduction for the current timestep. More... | |
| void | computeSubRegionRankStats (CellElementSubRegion &subRegion, StatsGroupType &subRegionStats) const |
| Compute the rank-local stats for the given sub-region and store the results in the given stats group. More... | |
| void | aggregateStats (StatsGroupType &stats, StatsGroupType const &other) const |
| Aggregate all instance statistics with those of another instance on the current rank. More... | |
| void | mpiAggregateStats (StatsGroupType &stats) const |
| Aggregate all instance statistics with those of other ranks. More... | |
| void | postAggregateStats (StatsGroupType &stats) |
| Do the final computations for the statistics. Must be called after computations & aggregations. More... | |
Protected Attributes | |
| dataRepository::DataContext const & | m_ownerDataContext |
| bool const | m_statsOutputEnabled |
| If true, the stats are to save in the output HDF5. | |
| dataRepository::Group & | m_meshBodies |
| stdVector< DiscretizationGroupPath > | m_discretizationsPaths |
| stdVector< string > | m_warnings |
| StatsState | m_regionStatsState |
| The current state of the region statistics. | |
Reponsible of computing physical statistics over the grid, registering the result in the data repository, but not storing / outputing it by itself. It does not have mutable state except the encountered issues.
| Impl | the derived type of the statistics aggregator which contains all necessary implementations (CRTP) |
Definition at line 77 of file StatisticsAggregatorBase.hpp.
| using geos::StatsAggregatorBase< Impl >::RegionStatsFunc = std::function< void ( OwnerType &, StatsGroupType & ) > |
Standard function signature for any functor that applies on statistics group instances (StatsGroupType)
| OwnerType | the concrete type of the OwnerType param |
Definition at line 93 of file StatisticsAggregatorBase.hpp.
| using geos::StatsAggregatorBase< Impl >::RegionStatsRegisterFunc = std::function< StatsGroupType & ( dataRepository::Group &, string const & ) > |
A functor that can be used to register a statistics Group instance. Parameters:
Definition at line 101 of file StatisticsAggregatorBase.hpp.
| geos::StatsAggregatorBase< Impl >::StatsAggregatorBase | ( | dataRepository::DataContext const & | ownerDataContext, |
| dataRepository::Group & | meshBodies, | ||
| bool | statsOutputEnabled | ||
| ) |
Construct a new Stats Aggregator object.
| ownerName | the unique name of the entity requesting the statistics. An error is thrown if not unique in this context. |
| meshBodies | The Group containing the MeshBody objects |
| statsOutputEnabled | If true, the stats are saved in the output HDF5 (through dataRepository::RestartFlags, but not functional for this output for now). |
Definition at line 48 of file StatisticsAggregatorBaseHelpers.hpp.
|
inlineprotected |
Aggregate all instance statistics with those of another instance on the current rank.
| stats | the statistics instance |
| other | the other instance to aggregate with. |
Definition at line 260 of file StatisticsAggregatorBase.hpp.
| bool geos::StatsAggregatorBase< Impl >::computeRegionsStatistics | ( | real64 const | timeRequest | ) |
Compute statistics on the mesh discretizations (average field pressure, etc) Results are reduced on rank 0, and broadcasted over all ranks.
| [in] | timeRequest | The time for which we want to compute the statistics. |
Definition at line 193 of file StatisticsAggregatorBaseHelpers.hpp.
|
inlineprotected |
Compute the rank-local stats for the given sub-region and store the results in the given stats group.
| subRegion | |
| subRegionStats | the stats group instance for the subregion |
Definition at line 251 of file StatisticsAggregatorBase.hpp.
|
protected |
Enable the computation of region statistics, initialize data structure to collect them. Register the resulting data wrappers so they will be targeted by TimeHistory output.
| registerStatsFunc | The functor which register each statistics group whithin the regions hierarchy |
Definition at line 90 of file StatisticsAggregatorBaseHelpers.hpp.
|
protected |
| path | the path of the discretization group in the data-repository. |
Definition at line 254 of file StatisticsAggregatorBaseHelpers.hpp.
|
inline |
Definition at line 169 of file StatisticsAggregatorBase.hpp.
| StatsAggregatorBase< Impl >::StatsGroupType & geos::StatsAggregatorBase< Impl >::getRegionStatistics | ( | MeshLevel & | mesh, |
| string_view | regionName | ||
| ) | const |
| mesh | The desired mesh-level |
| regionName | The name of the desired region |
| InputError | if no statistics data is found for the given region name. |
Definition at line 283 of file StatisticsAggregatorBaseHelpers.hpp.
|
inline |
Definition at line 175 of file StatisticsAggregatorBase.hpp.
| void geos::StatsAggregatorBase< Impl >::initStatisticsAggregation | ( | SolverType & | solver | ) |
Enable the computation of any statistics, initialize data structure to collect them. Register the resulting data wrappers so they will be targeted by TimeHistory output.
| solver | flow solver object to retrieve:
|
Definition at line 58 of file StatisticsAggregatorBaseHelpers.hpp.
|
inlineprotected |
Initialize all statistics values to aggregable default values, before any computation / reduction for the current timestep.
| stats | the statistics instance |
| time | start time of the current timestep (s) |
Definition at line 242 of file StatisticsAggregatorBase.hpp.
| bool geos::StatsAggregatorBase< Impl >::isComputed | ( | real64 const | timeRequest, |
| StatsGroupType const & | stats | ||
| ) |
| [in] | timeRequest | The time for which we want to know if the statistics are computed. |
| [in] | stats | the statistics data structure we want to know if it has been computed |
Definition at line 173 of file StatisticsAggregatorBaseHelpers.hpp.
|
inlineprotected |
Aggregate all instance statistics with those of other ranks.
| stats | the statistics instance |
Definition at line 268 of file StatisticsAggregatorBase.hpp.
|
inlineprotected |
Do the final computations for the statistics. Must be called after computations & aggregations.
| stats | the statistics instance |
Definition at line 276 of file StatisticsAggregatorBase.hpp.
|
protected |
Definition at line 206 of file StatisticsAggregatorBase.hpp.
|
protected |
Definition at line 216 of file StatisticsAggregatorBase.hpp.