GEOS
CompositionalMultiphaseStatisticsTask.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_COMPOSITIONALMULTIPHASESTATISTICSTASK_HPP_
21 #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONALMULTIPHASESTATISTICSTASK_HPP_
22 
23 #include "common/DataTypes.hpp"
27 #include <memory>
28 
29 namespace geos
30 {
31 
32 class CompositionalMultiphaseBase;
33 
34 namespace compositionalMultiphaseStatistics
35 {
36 
40 class StatsTask : public FieldStatisticsBase< CompositionalMultiphaseBase >
41 {
42 public:
43 
49  StatsTask( const string & name, dataRepository::Group * const parent );
50 
52  static string catalogName() { return "CompositionalMultiphaseStatistics"; }
53 
61  virtual bool execute( real64 const time_n,
62  real64 const dt,
63  integer const cycleNumber,
64  integer const eventCounter,
65  real64 const eventProgress,
66  DomainPartition & domain ) override;
67 
70  StatsAggregator & getStatisticsAggregator()
71  { return *m_aggregator; }
72 
73  StatsAggregator const & getStatisticsAggregator() const
74  { return *m_aggregator; }
75 
76 private:
77 
79 
83  struct viewKeyStruct
84  {
86  constexpr static char const * setNamesString() { return "setNames"; }
88  constexpr static char const * computeCFLNumbersString() { return "computeCFLNumbers"; }
90  constexpr static char const * computeRegionStatisticsString() { return "computeRegionStatistics"; }
92  constexpr static char const * relpermThresholdString() { return "relpermThreshold"; }
93  };
94 
95  void postInputInitialization() override;
96 
97  void registerDataOnMesh( Group & meshBodies ) override;
98 
99  void prepareFluidMetaData();
100 
101  void prepareLogTableLayouts( string_view tableName );
102 
103  void prepareCsvTableLayouts( string_view tableName );
104 
105  string getCsvFileName( string_view meshName ) const;
106 
107  void outputLogStats( real64 statsTime,
108  MeshLevel & mesh,
109  RegionStatistics & meshSetsStatistics );
110 
111  void outputCsvStats( real64 statsTime,
112  MeshLevel & mesh,
113  RegionStatistics & meshSetsStatistics );
114 
116  stdMap< string, std::unique_ptr< TableTextFormatter > > m_logFormatters;
117 
119  stdMap< string, std::unique_ptr< TableCSVFormatter > > m_csvFormatters;
120 
121  // mesh statistics aggregator
122  std::unique_ptr< StatsAggregator > m_aggregator;
123 
125  string_array m_setNames;
126 
128  integer m_computeCFLNumbers;
129 
131  integer m_computeRegionStatistics;
132 
134  real64 m_relpermThreshold;
135 
136  struct FluidMetaData
137  {
138  integer m_numPhases;
139  integer m_numComps;
140  stdVector< string > m_phaseNames;
141  stdVector< string > m_compNames;
142  stdVector< string > m_phaseCompNames;
143 
149  string & phaseCompName( integer phaseId, integer compId )
150  { return m_phaseCompNames[phaseId * m_numComps + compId]; }
151 
152  } m_fluid;
153 
154 };
155 
156 } /* namespace compositionalMultiphaseStatistics */
157 
158 } /* namespace geos */
159 
160 #endif /* SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONALMULTIPHASESTATISTICSTASK_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
Reponsible of computing physical statistics over the grid, registering the result in the data reposit...
StatsTask(const string &name, dataRepository::Group *const parent)
Constructor for the statistics class.
Group()=delete
Deleted default constructor.
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