GEOS
EventManager.hpp
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 
16 
17 #ifndef GEOS_EVENTS_EVENTMANAGER_HPP_
18 #define GEOS_EVENTS_EVENTMANAGER_HPP_
19 
20 #include "dataRepository/Group.hpp"
21 #include "EventBase.hpp"
23 
24 namespace geos
25 {
26 
27 class DomainPartition;
28 
29 namespace dataRepository
30 {
31 namespace keys
32 {
33 string const Events( "Events" );
34 }
35 }
36 
43 {
44 public:
50  EventManager( string const & name,
51  Group * const parent );
52 
56  virtual ~EventManager() override;
57 
64  virtual Group * createChild( string const & childKey, string const & childName ) override;
65 
69  virtual void expandObjectCatalogs() override;
70 
82  bool run( DomainPartition & domain );
83 
89  struct viewKeyStruct
90  {
91  static constexpr char const * minTimeString() { return "minTime"; }
92  static constexpr char const * maxTimeString() { return "maxTime"; }
93  static constexpr char const * maxCycleString() { return "maxCycle"; }
94 
95  static constexpr char const * timeString() { return "time"; }
96  static constexpr char const * dtString() { return "dt"; }
97  static constexpr char const * cycleString() { return "cycle"; }
98  static constexpr char const * currentSubEventString() { return "currentSubEvent"; }
99 
100  static constexpr char const * timeOutputFormat() { return "timeOutputFormat"; }
101 
102 
103  dataRepository::ViewKey time = { "time" };
104  dataRepository::ViewKey dt = { "dt" };
105  dataRepository::ViewKey cycle = { "cycle" };
106  dataRepository::ViewKey minTime = { "minTime" };
107  dataRepository::ViewKey maxTime = { "maxTime" };
108  dataRepository::ViewKey maxCycle = { "maxCycle" };
109  dataRepository::ViewKey currentSubEvent = { "currentSubEvent" };
110  } viewKeys;
113 
116 
119 
122  {
123  seconds,
124  minutes,
125  hours,
126  days,
127  years,
128  full
129  };
130 
131 private:
132 
133 
138  void outputTime( LogPart & section ) const;
139 
147  void logEndOfCycleInformation( LogPart & logpart,
148  integer const cycleNumber,
149  integer const numOfSubSteps,
150  std::vector< real64 > const & subStepDts ) const;
151 
153  real64 m_minTime;
154 
156  real64 m_maxTime;
157 
159  integer m_maxCycle;
160 
162  real64 m_time;
163 
165  real64 m_dt;
166 
168  integer m_cycle;
169 
171  integer m_currentSubEvent;
172 
174  TimeOutputFormat m_timeOutputFormat;
175 };
176 
179  "seconds",
180  "minutes",
181  "hours",
182  "days",
183  "years",
184  "full" );
185 
186 } /* namespace geos */
187 
188 #endif /* GEOS_EVENTS_EVENTMANAGER_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
static CatalogInterface::CatalogType & getCatalog()
Get the singleton catalog for this Group.
bool run(DomainPartition &domain)
The main execution loop for the code.
EventManager(string const &name, Group *const parent)
Constructor for the EventManager.
virtual ~EventManager() override
Default destructor for the EventManager.
virtual void expandObjectCatalogs() override
This method is used to expand any catalogs in the data structure.
TimeOutputFormat
enum class defining the format of the time output in the log
virtual Group * createChild(string const &childKey, string const &childName) override
Create a child EventManager.
Class for displaying section for different steps of simulation.
Definition: LogPart.hpp:34
This class provides the base class/interface for the catalog value objects.
std::unordered_map< std::string, std::unique_ptr< CatalogInterface< BASETYPE, ARGS... > > > CatalogType
This is the type that will be used for the catalog. The catalog is actually instantiated in the BASET...
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1664
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "preconditioner")
Declare strings associated with enumeration values.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:81
Structure to hold scoped key names.
Definition: Group.hpp:1444