GEOSX
EventManager.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
15 
16 #ifndef GEOSX_MANAGERS_EVENTMANAGER_HPP_
17 #define GEOSX_MANAGERS_EVENTMANAGER_HPP_
18 
19 #include "dataRepository/Group.hpp"
21 
22 
23 namespace geosx
24 {
25 namespace dataRepository
26 {
27 namespace keys
28 {
29 string const Events( "Events" );
30 }
31 }
32 
39 {
40 public:
46  EventManager( std::string const & name,
47  Group * const parent );
48 
52  virtual ~EventManager() override;
53 
60  virtual Group * CreateChild( string const & childKey, string const & childName ) override;
61 
65  virtual void ExpandObjectCatalogs() override;
66 
77  void Run( dataRepository::Group * domain );
78 
82  struct viewKeyStruct
85  {
86  static constexpr auto maxTimeString = "maxTime";
87  static constexpr auto maxCycleString = "maxCycle";
88 
89  static constexpr auto timeString = "time";
90  static constexpr auto dtString = "dt";
91  static constexpr auto cycleString = "cycle";
92  static constexpr auto currentSubEventString = "currentSubEvent";
93 
94  dataRepository::ViewKey time = { "time" };
95  dataRepository::ViewKey dt = { "dt" };
96  dataRepository::ViewKey cycle = { "cycle" };
97  dataRepository::ViewKey maxTime = { "maxTime" };
98  dataRepository::ViewKey maxCycle = { "maxCycle" };
99  dataRepository::ViewKey currentSubEvent = { "currentSubEvent" };
100  } viewKeys;
103 
106 
108  static CatalogInterface::CatalogType & GetCatalog();
109 
110 private:
112  real64 m_maxTime;
113 
115  integer m_maxCycle;
116 
118  real64 m_time;
119 
121  real64 m_dt;
122 
124  integer m_cycle;
125 
127  integer m_currentSubEvent;
128 };
129 
130 
131 } /* namespace geosx */
132 
133 #endif /* GEOSX_MANAGERS_EVENTMANAGER_HPP_ */
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1545
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
This class provides the base class/interface for the catalog value objects.
std::string string
String type.
Definition: DataTypes.hpp:131
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...