GEOS
SinglePhaseStatisticsTask.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASESTATISTICS_HPP_
21 #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASESTATISTICS_HPP_
22 
25 
26 namespace geos
27 {
28 
29 class SinglePhaseBase;
30 
31 namespace singlePhaseStatistics
32 {
33 
37 class StatsTask : public FieldStatisticsBase< SinglePhaseBase >
38 {
39 public:
40 
46  StatsTask( const string & name, dataRepository::Group * const parent );
47 
49  static string catalogName() { return "SinglePhaseStatistics"; }
50 
58  virtual bool execute( real64 const time_n,
59  real64 const dt,
60  integer const cycleNumber,
61  integer const eventCounter,
62  real64 const eventProgress,
63  DomainPartition & domain ) override;
64 
67  StatsAggregator & getStatisticsAggregator()
68  { return *m_aggregator; }
69 
70  StatsAggregator const & getStatisticsAggregator() const
71  { return *m_aggregator; }
72 
73 private:
74 
76 
80  struct viewKeyStruct
81  {
83  constexpr static char const * setNamesString() { return "setNames"; }
84  };
85 
86  void postInputInitialization() override;
87 
88  void registerDataOnMesh( Group & meshBodies ) override;
89 
90  void prepareLogTableLayouts( string_view tableName );
91 
92  void prepareCsvTableLayouts( string_view tableName );
93 
94  string getCsvFileName( string_view meshName ) const;
95 
96  void outputLogStats( real64 statsTime,
97  MeshLevel & mesh,
98  RegionStatistics & meshSetsStatistics );
99 
100  void outputCsvStats( real64 statsTime,
101  MeshLevel & mesh,
102  RegionStatistics & meshSetsStatistics );
103 
105  stdMap< string, std::unique_ptr< TableTextFormatter > > m_logFormatters;
106 
108  stdMap< string, std::unique_ptr< TableCSVFormatter > > m_csvFormatters;
109 
110  // mesh statistics aggregator
111  std::unique_ptr< StatsAggregator > m_aggregator;
112 
114  string_array m_setNames;
115 
116 };
117 
118 } /* namespace singlePhaseStatistics */
119 
120 } /* namespace geos */
121 
122 #endif /* SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASESTATISTICS_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
Group()=delete
Deleted default constructor.
Reponsible of computing physical statistics over the grid, registering the result in the data reposit...
static string catalogName()
Accessor for the catalog name.
StatsTask(const string &name, dataRepository::Group *const parent)
Constructor for the statistics class.
virtual bool execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Main extension point of executable targets.
stdVector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:361
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
int integer
Signed integer type.
Definition: DataTypes.hpp:81
std::string_view string_view
String type.
Definition: DataTypes.hpp:93