|
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 | DiscretizationSetPath |
| struct | MeshLevelSet |
| Allow to reference a set in a given MeshLevel structure. More... | |
| struct | StatsState |
| struct | ViewKeys |
| the associated view keys More... | |
Public Types | |
| using | SolverType = typename StatsAggregatorTraits< Impl >::SolverType |
| using | StatsGroupType = typename StatsAggregatorTraits< Impl >::StatsGroupType |
| using | SetType = SortedArray< localIndex > |
| using | SetViewType = SortedArrayView< localIndex const > |
| 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 &, string_view, bool) > |
| 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, explores the data structure to collect them. More... | |
| 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... | |
| bool | isComputed (real64 const timeRequest, StatsGroupType const &stats) |
| bool | isRestrictedToSets () |
| bool | isTargetingMultipleSets () |
| string const & | getOwnerName () const |
| stdVector< string > const & | getWarnings () const |
Data Structure Traversal Strategy | |
| void | forRegionStatistics (RegionStatsFunc< MeshLevel & > const &functor) const |
| Execute the given functor on each mesh-level (discretization) available for this instance. More... | |
| void | forRegionStatistics (MeshLevel &mesh, StatsGroupType &meshSetsStats, bool enableCompoundSet, RegionStatsFunc< MeshLevelSet > const &functor) const |
| Execute the given functor on each set present in the given mesh-level (discretization). More... | |
| void | forRegionStatistics (MeshLevelSet meshSet, StatsGroupType &setStats, RegionStatsFunc< CellElementRegion & > const &functor) const |
| Execute the given functor on each region available in the given mesh-level for the given set. More... | |
| void | forRegionStatistics (CellElementRegion ®ion, StatsGroupType &setRegionStats, RegionStatsFunc< CellElementSubRegion & > const &functor) const |
| Execute the given functor on each sub-region available in the given region for the given set. More... | |
| dataRepository::Group & | getInstanceStatisticsGroup (MeshLevel &mesh) const |
| Get the Instance Statistics Group for the given mesh-level. More... | |
| StatsGroupType & | getMeshLevelStatistics (MeshLevel &mesh) const |
| StatsGroupType & | getSetStatistics (MeshLevel &mesh, string_view setName="") const |
| StatsGroupType & | getRegionStatistics (MeshLevel &mesh, string_view regionName, string_view setName="") const |
Protected Types | |
| using | SetsCompound = stdMap< string, stdMap< string, SetType > > |
Protected Member Functions | |
| void | enableRegionStatisticsAggregation (RegionStatsRegisterFunc &®isterStatsFunc, string_array const &setNames) |
| 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 (DiscretizationSetPath const &path) const |
| StatsGroupType & | getCompoundSetStatistics (MeshLevel &mesh) const |
| bool | isCompoundSetStatistics (StatsGroupType const &stats) const |
| void | setTargetSets (string_array const &setNames) |
| Set the statstics target sets to restrict the statistics to. More... | |
| 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, SetType const &targetSet) 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... | |
Static Protected Member Functions | |
| static std::set< string > | getMeshLevelPartialSetNames (MeshLevel const &mesh, string_array const ®ionNames) |
| TODO. | |
Protected Attributes | |
| dataRepository::DataContext const & | m_ownerDataContext |
| bool const | m_dataOutputEnabled |
| If true, the stats are to save in the output HDF5. | |
| dataRepository::Group & | m_meshBodies |
| stdVector< DiscretizationSetPath > | m_discretizationsPaths |
| std::set< string > | m_setNames |
| bool | m_isAnySetsIntersecting |
| if true, at least ont set intersects with another, threfore we must compute mesh-level statistics with a coupound. | |
| 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 90 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 110 of file StatisticsAggregatorBase.hpp.
| using geos::StatsAggregatorBase< Impl >::RegionStatsRegisterFunc = std::function< StatsGroupType & ( dataRepository::Group &, string const &, string_view, bool ) > |
A functor that can be used to register a statistics Group instance. Parameters:
Definition at line 120 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 50 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 413 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 420 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 |
| targetSet |
Definition at line 402 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 |
| setNames | The list of mesh element sets to restrict the statistics to. If empty, the whole mesh-level is processed. |
Definition at line 123 of file StatisticsAggregatorBaseHelpers.hpp.
| void geos::StatsAggregatorBase< Impl >::forRegionStatistics | ( | CellElementRegion & | region, |
| StatsGroupType & | setRegionStats, | ||
| RegionStatsFunc< CellElementSubRegion & > const & | functor | ||
| ) | const |
Execute the given functor on each sub-region available in the given region for the given set.
| meshSet | the target region set. |
| setRegionStats | the region statistics data structure for the given set. |
| functor | the function to execute. |
Definition at line 385 of file StatisticsAggregatorBaseHelpers.hpp.
| void geos::StatsAggregatorBase< Impl >::forRegionStatistics | ( | MeshLevel & | mesh, |
| StatsGroupType & | meshSetsStats, | ||
| bool | enableCompoundSet, | ||
| RegionStatsFunc< MeshLevelSet > const & | functor | ||
| ) | const |
Execute the given functor on each set present in the given mesh-level (discretization).
| mesh | the target mesh-level. |
| meshSetsStats | the instance mesh-level statistics data structure. |
| enableCompoundSet | if true, the functor will also be applied on the compound set (which is an optional internal computation data structure). |
| functor | the function to execute. |
Definition at line 346 of file StatisticsAggregatorBaseHelpers.hpp.
| void geos::StatsAggregatorBase< Impl >::forRegionStatistics | ( | MeshLevelSet | meshSet, |
| StatsGroupType & | setStats, | ||
| RegionStatsFunc< CellElementRegion & > const & | functor | ||
| ) | const |
Execute the given functor on each region available in the given mesh-level for the given set.
| meshSet | the target mesh-level set. |
| setStats | the mesh-level statistics data structure for the given set. |
| functor | the function to execute. |
Definition at line 367 of file StatisticsAggregatorBaseHelpers.hpp.
| void geos::StatsAggregatorBase< Impl >::forRegionStatistics | ( | RegionStatsFunc< MeshLevel & > const & | functor | ) | const |
Execute the given functor on each mesh-level (discretization) available for this instance.
| functor | the function to execute. |
Definition at line 333 of file StatisticsAggregatorBaseHelpers.hpp.
|
protected |
| mesh | the mesh-level (discretization). |
| InputError | if no compound set exists, for instance if isSetsCompoundEnabled == false. |
Definition at line 295 of file StatisticsAggregatorBaseHelpers.hpp.
| dataRepository::Group & geos::StatsAggregatorBase< Impl >::getInstanceStatisticsGroup | ( | MeshLevel & | mesh | ) | const |
Get the Instance Statistics Group for the given mesh-level.
| mesh | the mesh-level (discretization). |
Definition at line 259 of file StatisticsAggregatorBaseHelpers.hpp.
|
protected |
| path | the path of the mesh-level group in the data-repository. |
Definition at line 250 of file StatisticsAggregatorBaseHelpers.hpp.
| StatsAggregatorBase< Impl >::StatsGroupType & geos::StatsAggregatorBase< Impl >::getMeshLevelStatistics | ( | MeshLevel & | mesh | ) | const |
| mesh | the mesh-level (discretization). |
Definition at line 269 of file StatisticsAggregatorBaseHelpers.hpp.
|
inline |
Definition at line 284 of file StatisticsAggregatorBase.hpp.
| StatsAggregatorBase< Impl >::StatsGroupType & geos::StatsAggregatorBase< Impl >::getRegionStatistics | ( | MeshLevel & | mesh, |
| string_view | regionName, | ||
| string_view | setName = "" |
||
| ) | const |
| mesh | The mesh-level (discretization) |
| setName | the name of element set. If none is specified (empty), "all" elements set is targeted. |
| regionName | The name of the desired region |
| InputError | - if no statistics data is found for the given region name.
|
Definition at line 317 of file StatisticsAggregatorBaseHelpers.hpp.
| StatsAggregatorBase< Impl >::StatsGroupType & geos::StatsAggregatorBase< Impl >::getSetStatistics | ( | MeshLevel & | mesh, |
| string_view | setName = "" |
||
| ) | const |
| mesh | the mesh-level (discretization). |
| setName | the name of element set. If none is specified (empty), "all" elements set is targeted. |
| InputError | if "all" is targeted, but the instance does not target "all" element set. |
Definition at line 279 of file StatisticsAggregatorBaseHelpers.hpp.
|
inline |
Definition at line 290 of file StatisticsAggregatorBase.hpp.
| void geos::StatsAggregatorBase< Impl >::initStatisticsAggregation | ( | SolverType & | solver | ) |
Enable the computation of any statistics, explores the data structure to collect them.
| solver | flow solver object to retrieve:
|
finding all sets in this mesh level
Definition at line 84 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 392 of file StatisticsAggregatorBase.hpp.
|
protected |
| stats | a statistics data structure |
Definition at line 310 of file StatisticsAggregatorBaseHelpers.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 400 of file StatisticsAggregatorBaseHelpers.hpp.
|
inline |
Definition at line 271 of file StatisticsAggregatorBase.hpp.
|
inline |
Definition at line 278 of file StatisticsAggregatorBase.hpp.
|
inlineprotected |
Aggregate all instance statistics with those of other ranks.
| stats | the statistics instance |
Definition at line 421 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 429 of file StatisticsAggregatorBase.hpp.
|
protected |
Set the statstics target sets to restrict the statistics to.
| setNames | the list of target sets. If "all" is included, or none is present, all the discretisation is targeted. |
|
protected |
Data repository paths of the element sets per mesh levels TODO: can it be generalized with the "all" set
Definition at line 327 of file StatisticsAggregatorBase.hpp.
|
protected |
Definition at line 318 of file StatisticsAggregatorBase.hpp.
|
protected |
The list of mesh element sets to restrict the region statistics to. Cannot be empty: if the whole mesh-level is to process, "all" must be targeted.
Definition at line 331 of file StatisticsAggregatorBase.hpp.
|
protected |
Definition at line 337 of file StatisticsAggregatorBase.hpp.