GEOSX
ExecutableGroup.hpp
Go to the documentation of this file.
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 
19 #ifndef GEOSX_DATAREPOSITORY_EXECUTABLEGROUP_HPP_
20 #define GEOSX_DATAREPOSITORY_EXECUTABLEGROUP_HPP_
21 
22 #include "common/DataTypes.hpp"
23 #include "Group.hpp"
24 
25 
26 namespace geosx
27 {
28 
36 {
37 public:
38 
40 
53  virtual void Execute( real64 const time_n,
54  real64 const dt,
55  integer const cycleNumber,
56  integer const eventCounter,
57  real64 const eventProgress,
58  dataRepository::Group * domain ) = 0;
59 
67  virtual void SignalToPrepareForExecution( real64 const time_n,
68  real64 const dt,
69  integer const cycle,
70  dataRepository::Group * domain );
79  virtual void Cleanup( real64 const time_n,
80  integer const cycleNumber,
81  integer const eventCounter,
82  real64 const eventProgress,
83  dataRepository::Group * domain );
84 
90  virtual real64 GetTimestepRequest( real64 const time )
91  {
92  GEOSX_UNUSED_VAR( time );
93  return 1e99;
94  }
95 
96 
101  void SetTimestepBehavior( integer const behavior ) { m_timestepType = behavior; }
102 
107  integer GetTimestepBehavior() { return m_timestepType; }
108 
109 
110 private:
111  integer m_timestepType = 0;
112 };
113 
114 
115 }
116 
117 
118 #endif /* GEOSX_DATAREPOSITORY_EXECUTABLEGROUP_HPP_ */
virtual void SignalToPrepareForExecution(real64 const time_n, real64 const dt, integer const cycle, dataRepository::Group *domain)
Inform the object that it expects to execute during the next timestep.
void SetTimestepBehavior(integer const behavior)
Set the timestep behavior for a target.
virtual real64 GetTimestepRequest(real64 const time)
Supplies the timestep request for this target to the event manager.
Group()=delete
Deleted default constructor.
virtual void Execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, dataRepository::Group *domain)=0
Main extension point of executable targets.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:78
integer GetTimestepBehavior()
Get the target's time step behavior.
virtual void Cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, dataRepository::Group *domain)
Called as the code exits the main run loop.