GEOS
ExecutableGroup.hpp
Go to the documentation of this file.
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 
20 #ifndef GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_
21 #define GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_
22 
24 #include "common/DataTypes.hpp"
25 #include "Group.hpp"
26 
27 
28 namespace geos
29 {
30 
31 class DomainPartition;
32 
40 {
41 public:
42 
44 
58  virtual bool execute( real64 const time_n,
59  real64 const dt,
60  integer const cycleNumber,
61  integer const eventCounter,
62  real64 const eventProgress,
63  DomainPartition & domain ) = 0;
64 
72  virtual void signalToPrepareForExecution( real64 const time_n,
73  real64 const dt,
74  integer const cycle,
75  DomainPartition & domain );
84  virtual void cleanup( real64 const time_n,
85  integer const cycleNumber,
86  integer const eventCounter,
87  real64 const eventProgress,
88  DomainPartition & domain );
89 
95  virtual real64 getTimestepRequest( real64 const time )
96  {
97  GEOS_UNUSED_VAR( time );
98  return 1e99;
99  }
100 
105  {
108  };
109 
114  void setTimesteppingBehavior( TimesteppingBehavior const timesteppingBehavior ) { m_timesteppingBehavior = timesteppingBehavior; }
115 
120  TimesteppingBehavior getTimesteppingBehavior() const { return m_timesteppingBehavior; }
121 
122 private:
123 
125 };
126 
129  "DeterminesTimeStepSize",
130  "DoesNotDetermineTimeStepSize" );
133 }
134 
135 
136 #endif /* GEOS_DATAREPOSITORY_EXECUTABLEGROUP_HPP_ */
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:84
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:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82