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 
46  ExecutableGroup() = delete;
47 
49  ExecutableGroup( ExecutableGroup const & ) = delete;
50 
53 
55  ExecutableGroup & operator=( ExecutableGroup const & ) = delete;
56 
59 
63  virtual ~ExecutableGroup() override = default;
64 
78  virtual bool execute( real64 const time_n,
79  real64 const dt,
80  integer const cycleNumber,
81  integer const eventCounter,
82  real64 const eventProgress,
83  DomainPartition & domain ) = 0;
84 
92  virtual void signalToPrepareForExecution( real64 const time_n,
93  real64 const dt,
94  integer const cycle,
95  DomainPartition & domain );
104  virtual void cleanup( real64 const time_n,
105  integer const cycleNumber,
106  integer const eventCounter,
107  real64 const eventProgress,
108  DomainPartition & domain );
109 
115  virtual real64 getTimestepRequest( real64 const time )
116  {
117  GEOS_UNUSED_VAR( time );
118  return 1e99;
119  }
120 
125  {
128  };
129 
134  void setTimesteppingBehavior( TimesteppingBehavior const timesteppingBehavior ) { m_timesteppingBehavior = timesteppingBehavior; }
135 
140  TimesteppingBehavior getTimesteppingBehavior() const { return m_timesteppingBehavior; }
141 
142 private:
143 
145 };
146 
149  "DeterminesTimeStepSize",
150  "DoesNotDetermineTimeStepSize" );
153 }
154 
155 
156 #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...
ExecutableGroup(ExecutableGroup &&)=default
default move constructor
ExecutableGroup()=delete
deleted default constructor
virtual ~ExecutableGroup() override=default
Default destructor for the ExecutableGroup.
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.
ExecutableGroup & operator=(ExecutableGroup &&)=delete
deleted move operator
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.
ExecutableGroup(ExecutableGroup const &)=delete
deleted copy constructor
ExecutableGroup & operator=(ExecutableGroup const &)=delete
deleted assignment operator
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:98
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:81