20 #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_STATISTICSAGGREGATOR_HPP_
21 #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_STATISTICSAGGREGATOR_HPP_
28 #include "mesh/MeshLevel.hpp"
55 bool statsOutputEnabled );
66 template<
typename T >
76 template<
typename Impl >
92 template<
typename OwnerType >
125 bool statsOutputEnabled );
136 void forRegionStatistics( RegionStatsFunc< MeshLevel >
const & functor )
const;
138 void forRegionStatistics(
MeshLevel & mesh,
139 StatsGroupType & meshRegionsStatistics,
140 RegionStatsFunc< CellElementRegion >
const & functor )
const;
143 StatsGroupType & regionStatistics,
144 RegionStatsFunc< CellElementSubRegion >
const & functor )
const;
180 StatsGroupType & getRegionsStatistics(
MeshLevel & mesh )
const;
194 bool m_isEnabled =
false;
195 bool m_isDirty =
false;
243 {
static_cast< Impl
const *
>(
this)->
initStats( stats, time ); }
260 void aggregateStats( StatsGroupType & stats, StatsGroupType
const & other )
const
261 {
static_cast< Impl
const *
>(
this)->
aggregateStats( stats, other ); }
Class facilitating the representation of a multi-level discretization of a MeshBody.
Output data group to contain the result of a given stat aggregator on the dataRepository....
string_view getTargetName() const
RegionStatisticsBase(string const &targetName, dataRepository::Group *const parent, bool statsOutputEnabled)
Construct a new Region Statistics Base object.
real64 m_time
Time of statistics computation (std::numeric_limits< double >::lowest() if not initialized)
Reponsible of computing physical statistics over the grid, registering the result in the data reposit...
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.
stdVector< string > const & getWarnings() const
string const & getOwnerName() const
void initStats(StatsGroupType &stats, real64 time) const
Initialize all statistics values to aggregable default values, before any computation / reduction for...
void postAggregateStats(StatsGroupType &stats)
Do the final computations for the statistics. Must be called after computations & aggregations.
void initStatisticsAggregation(SolverType &solver)
Enable the computation of any statistics, initialize data structure to collect them....
void mpiAggregateStats(StatsGroupType &stats) const
Aggregate all instance statistics with those of other ranks.
std::function< StatsGroupType &(dataRepository::Group &, string const &) > RegionStatsRegisterFunc
A functor that can be used to register a statistics Group instance. Parameters:
StatsAggregatorBase(dataRepository::DataContext const &ownerDataContext, dataRepository::Group &meshBodies, bool statsOutputEnabled)
Construct a new Stats Aggregator object.
bool const m_statsOutputEnabled
If true, the stats are to save in the output HDF5.
void setDirty()
set the statistics as dirty, ensuring isComputed() will be false until the next computation.
MeshLevel & getMeshLevel(DiscretizationGroupPath const &path) const
StatsState m_regionStatsState
The current state of the region statistics.
std::function< void(OwnerType &, StatsGroupType &) > RegionStatsFunc
Standard function signature for any functor that applies on statistics group instances (StatsGroupTyp...
stdVector< string > m_warnings
StatsGroupType & getRegionStatistics(MeshLevel &mesh, string_view regionName) const
bool isComputed(real64 const timeRequest, StatsGroupType const &stats)
void enableRegionStatisticsAggregation(RegionStatsRegisterFunc &®isterStatsFunc)
Enable the computation of region statistics, initialize data structure to collect them....
dataRepository::DataContext const & m_ownerDataContext
void aggregateStats(StatsGroupType &stats, StatsGroupType const &other) const
Aggregate all instance statistics with those of another instance on the current rank.
bool computeRegionsStatistics(real64 const timeRequest)
Compute statistics on the mesh discretizations (average field pressure, etc) Results are reduced on r...
string const & getTargetName() const
string const & getName() const
Get group name.
stdVector< string > string_array
A 1-dimensional array of geos::string types.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
std::string_view string_view
String type.
internal::StdVectorWrapper< T, Allocator, USE_STD_CONTAINER_BOUNDS_CHECKING > stdVector
constexpr static char const * regionsStatisticsString()
String for the region statistics group.
constexpr static char const * statisticsString()
String for the discretization statistics group.