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"
22 
23 namespace geos
24 {
25 
26 class DomainPartition;
27 
28 namespace dataRepository
29 {
30 namespace keys
31 {
32 string const Events( "Events" );
33 }
34 }
35 
42 {
43 public:
49  EventManager( string const & name,
50  Group * const parent );
51 
55  virtual ~EventManager() override;
56 
63  virtual Group * createChild( string const & childKey, string const & childName ) override;
64 
68  virtual void expandObjectCatalogs() override;
69 
81  bool run( DomainPartition & domain );
82 
88  struct viewKeyStruct
89  {
90  static constexpr char const * minTimeString() { return "minTime"; }
91  static constexpr char const * maxTimeString() { return "maxTime"; }
92  static constexpr char const * maxCycleString() { return "maxCycle"; }
93 
94  static constexpr char const * timeString() { return "time"; }
95  static constexpr char const * dtString() { return "dt"; }
96  static constexpr char const * cycleString() { return "cycle"; }
97  static constexpr char const * currentSubEventString() { return "currentSubEvent"; }
98 
99  static constexpr char const * timeOutputFormat() { return "timeOutputFormat"; }
100 
101 
102  dataRepository::ViewKey time = { "time" };
103  dataRepository::ViewKey dt = { "dt" };
104  dataRepository::ViewKey cycle = { "cycle" };
105  dataRepository::ViewKey minTime = { "minTime" };
106  dataRepository::ViewKey maxTime = { "maxTime" };
107  dataRepository::ViewKey maxCycle = { "maxCycle" };
108  dataRepository::ViewKey currentSubEvent = { "currentSubEvent" };
109  } viewKeys;
112 
115 
118 
121  {
122  seconds,
123  minutes,
124  hours,
125  days,
126  years,
127  full
128  };
129 
130 private:
131 
132 
137  void outputTime() const;
138 
140  real64 m_minTime;
141 
143  real64 m_maxTime;
144 
146  integer m_maxCycle;
147 
149  real64 m_time;
150 
152  real64 m_dt;
153 
155  integer m_cycle;
156 
158  integer m_currentSubEvent;
159 
161  TimeOutputFormat m_timeOutputFormat;
162 };
163 
166  "seconds",
167  "minutes",
168  "hours",
169  "days",
170  "years",
171  "full" );
172 
173 } /* namespace geos */
174 
175 #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.
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:1662
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:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
Structure to hold scoped key names.
Definition: Group.hpp:1442