20 #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_STATISTICSAGGREGATOR_HPP_
21 #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_STATISTICSAGGREGATOR_HPP_
28 #include "mesh/MeshLevel.hpp"
58 bool dataOutputEnabled );
76 string const m_setName;
79 template<
typename T >
89 template<
typename Impl >
109 template<
typename OwnerType >
111 StatsGroupType & ) >;
157 bool statsOutputEnabled );
200 StatsGroupType & meshSetsStats,
201 bool enableCompoundSet,
211 StatsGroupType & setStats,
221 StatsGroupType & setRegionStats,
297 bool m_isEnabled =
false;
298 bool m_isDirty =
false;
393 {
static_cast< Impl
const *
>(
this)->
initStats( stats, time ); }
403 StatsGroupType & subRegionStats,
404 SetType
const & targetSet )
const
413 void aggregateStats( StatsGroupType & stats, StatsGroupType
const & other )
const
414 {
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....
RegionStatisticsBase(string const &targetName, dataRepository::Group *const parent, string_view setName, bool dataOutputEnabled)
Construct a new Region Statistics Base object.
string_view getSetName() const
string_view getTargetName() const
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...
stdVector< string > const & getWarnings() const
dataRepository::Group & getInstanceStatisticsGroup(MeshLevel &mesh) const
Get the Instance Statistics Group for the given mesh-level.
string const & getOwnerName() const
bool isTargetingMultipleSets()
void initStats(StatsGroupType &stats, real64 time) const
Initialize all statistics values to aggregable default values, before any computation / reduction for...
std::set< string > m_setNames
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, explores the data structure to collect them.
bool m_isAnySetsIntersecting
if true, at least ont set intersects with another, threfore we must compute mesh-level statistics wit...
StatsGroupType & getMeshLevelStatistics(MeshLevel &mesh) const
void mpiAggregateStats(StatsGroupType &stats) const
Aggregate all instance statistics with those of other ranks.
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.
StatsAggregatorBase(dataRepository::DataContext const &ownerDataContext, dataRepository::Group &meshBodies, bool statsOutputEnabled)
Construct a new Stats Aggregator object.
void enableRegionStatisticsAggregation(RegionStatsRegisterFunc &®isterStatsFunc, string_array const &setNames)
Enable the computation of region statistics, initialize data structure to collect them....
StatsGroupType & getRegionStatistics(MeshLevel &mesh, string_view regionName, string_view setName="") const
std::function< void(OwnerType, StatsGroupType &) > RegionStatsFunc
Standard function signature for any functor that applies on statistics group instances (StatsGroupTyp...
MeshLevel & getMeshLevel(DiscretizationSetPath const &path) const
void setDirty()
set the statistics as dirty, ensuring isComputed() will be false until the next computation.
stdVector< DiscretizationSetPath > m_discretizationsPaths
StatsGroupType & getSetStatistics(MeshLevel &mesh, string_view setName="") const
static std::set< string > getMeshLevelPartialSetNames(MeshLevel const &mesh, string_array const ®ionNames)
TODO.
bool isRestrictedToSets()
StatsState m_regionStatsState
The current state of the region statistics.
StatsGroupType & getCompoundSetStatistics(MeshLevel &mesh) const
bool isCompoundSetStatistics(StatsGroupType const &stats) const
std::function< StatsGroupType &(dataRepository::Group &, string const &, string_view, bool) > RegionStatsRegisterFunc
A functor that can be used to register a statistics Group instance. Parameters:
stdVector< string > m_warnings
bool const m_dataOutputEnabled
If true, the stats are to save in the output HDF5.
bool isComputed(real64 const timeRequest, StatsGroupType const &stats)
void forRegionStatistics(RegionStatsFunc< MeshLevel & > const &functor) const
Execute the given functor on each mesh-level (discretization) available for this instance.
void setTargetSets(string_array const &setNames)
Set the statstics target sets to restrict the statistics to.
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).
internal::StdMapWrapper< std::map< Key, T, Compare, Allocator >, USE_STD_CONTAINER_BOUNDS_CHECKING > stdMap
LvArray::SortedArray< T, localIndex, LvArray::ChaiBuffer > SortedArray
A sorted array of local indices.
LvArray::SortedArrayView< T, localIndex, LvArray::ChaiBuffer > SortedArrayView
A sorted array view of local indices.
std::string_view string_view
String type.
internal::StdVectorWrapper< T, Allocator, USE_STD_CONTAINER_BOUNDS_CHECKING > stdVector
localIndex m_meshLevel
The id of the mesh level in the mesh body.
string_array m_regionNames
the regions names in the mesh-level / mesh level
localIndex m_meshBody
The id of the mesh body in the "meshBodies" Group.
SetsCompound m_setsCompound
if at least one set intersects with another, a compound of (local element index) set is needed to com...
string_array m_setNames
The names of this mesh-level element sets. If none is specified (empty), "all" elements set is target...
Allow to reference a set in a given MeshLevel structure.
constexpr static string_view statisticsString()
String for the mesh-level statistics group.
constexpr static string_view setsStatisticsString()
String for the region statistics group.
constexpr static string_view compoundSetNameString()
on-purpose generated compound set name