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 TotalEnergies
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 GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_
20 #define GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_
21 
22 #include "codingUtilities/EnumStrings.hpp"
23 #include "common/DataTypes.hpp"
24 #include "Group.hpp"
25 
26 
27 namespace geos
28 {
29 
30 class DomainPartition;
31 
39 {
40 public:
41 
43 
57  virtual bool execute( real64 const time_n,
58  real64 const dt,
59  integer const cycleNumber,
60  integer const eventCounter,
61  real64 const eventProgress,
62  DomainPartition & domain ) = 0;
63 
71  virtual void signalToPrepareForExecution( real64 const time_n,
72  real64 const dt,
73  integer const cycle,
74  DomainPartition & domain );
83  virtual void cleanup( real64 const time_n,
84  integer const cycleNumber,
85  integer const eventCounter,
86  real64 const eventProgress,
87  DomainPartition & domain );
88 
94  virtual real64 getTimestepRequest( real64 const time )
95  {
96  GEOS_UNUSED_VAR( time );
97  return 1e99;
98  }
99 
104  {
107  };
108 
113  void setTimesteppingBehavior( TimesteppingBehavior const timesteppingBehavior ) { m_timesteppingBehavior = timesteppingBehavior; }
114 
119  TimesteppingBehavior getTimesteppingBehavior() const { return m_timesteppingBehavior; }
120 
121 private:
122 
124 };
125 
128  "DeterminesTimeStepSize",
129  "DoesNotDetermineTimeStepSize" );
132 }
133 
134 
135 #endif /* GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_ */
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:83
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
TimesteppingBehavior getTimesteppingBehavior() const
Get the target's time step behavior.
virtual void cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain)
Called as the code exits the main run loop.
TimesteppingBehavior
Timestepping type.
@ DeterminesTimeStepSize
The group (say, the solver) does the timestepping.
@ DoesNotDetermineTimeStepSize
The event targetting this group does the timestepping.
virtual real64 getTimestepRequest(real64 const time)
Supplies the timestep request for this target to the event manager.
virtual bool execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain)=0
Main extension point of executable targets.
virtual void signalToPrepareForExecution(real64 const time_n, real64 const dt, integer const cycle, DomainPartition &domain)
Inform the object that it expects to execute during the next timestep.
void setTimesteppingBehavior(TimesteppingBehavior const timesteppingBehavior)
Set the timestep behavior for a target.
Group()=delete
Deleted default constructor.
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:139
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122