19 #ifndef GEOSX_MANAGERS_EVENTS_EVENTSBASE_HPP_ 20 #define GEOSX_MANAGERS_EVENTS_EVENTSBASE_HPP_ 43 Group *
const parent );
74 real64 const eventProgress,
103 virtual Group *
CreateChild(
string const & childKey,
string const & childName )
override;
184 static constexpr
auto eventTargetString =
"target";
185 static constexpr
auto beginTimeString =
"beginTime";
186 static constexpr
auto endTimeString =
"endTime";
187 static constexpr
auto forceDtString =
"forceDt";
188 static constexpr
auto maxEventDtString =
"maxEventDt";
189 static constexpr
auto lastTimeString =
"lastTime";
190 static constexpr
auto lastCycleString =
"lastCycle";
191 static constexpr
auto eventForecastString =
"eventForecast";
192 static constexpr
auto targetExactStartStopString =
"targetExactStartStop";
193 static constexpr
auto currentSubEventString =
"currentSubEvent";
194 static constexpr
auto isTargetExecutingString =
"isTargetExecuting";
195 static constexpr
auto finalDtStretchString =
"finalDtStretch";
242 {
return m_eventForecast; }
249 {
return m_eventForecast <= 0; }
256 {
return m_eventForecast == 1; }
263 {
return m_eventForecast > 1; }
271 { m_eventForecast = 0; }
277 { m_eventForecast = 1; }
294 { m_eventForecast = forecast; }
302 {
return ( time >= m_beginTime ) && ( time < m_endTime ); }
317 string m_eventTarget;
323 integer m_targetExactStartStop;
331 real64 m_currentEventDtRequest;
void SetExitFlag(integer flag)
Set this event objects exit flag.
void setReadyForExec()
Define the event as ready for execution.
integer getForecast() const
Get the forecast of the current event.
void SetProgressIndicator(array1d< integer > &eventCounters)
Update the event progress for the event/sub-events.
virtual Group * CreateChild(string const &childKey, string const &childName) override
Creates a new sub-Group using the ObjectCatalog functionality.
bool isActive(real64 const time) const
Is the event active?
void Step(real64 const time, real64 const dt, integer const cycle, dataRepository::Group *domain)
Call the execute method on the target and/or children if present.
real64 GetCurrentEventDtRequest() const
Get the current time increment request for this event.
integer m_lastCycle
The last cycle the event occurred.
virtual void EstimateEventTiming(real64 const time, real64 const dt, integer const cycle, dataRepository::Group *domain)=0
Perform the calculations to estimate the timing of the event.
double real64
64-bit floating point type.
virtual void Execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, dataRepository::Group *domain) override
If the event forecast is equal to 0, then call the step function on its target and/or children...
static string CatalogName()
Catalog name interface.
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
virtual void SignalToPrepareForExecution(real64 const time, real64 const dt, integer const cycle, dataRepository::Group *domain) override
If the event forecast is equal to 1, then signal the targets to prepare for execution during the next...
ExecutableGroup * GetEventTarget() const
Get the target of this event.
static CatalogInterface::CatalogType & GetCatalog()
Get the singleton catalog for this class.
virtual void CheckEvents(real64 const time, real64 const dt, integer const cycle, dataRepository::Group *domain)
Events are triggered based upon their forecast values, which are defined as the expected number of co...
virtual real64 GetTimestepRequest(real64 const time) override
Collect time-step size requests from targets and/or children.
bool isIdle() const
Check if the event is idle.
integer GetExitFlag()
Get the sum of the exit flags for the event/sub-events from the last execution.
bool isReadyForExec() const
Check if the event is ready for execution.
void GetExecutionOrder(array1d< integer > &eventCounters)
Count the number of events/sub-events.
std::int32_t integer
Signed integer type.
This class provides the base class/interface for the catalog value objects.
bool hasToPrepareForExec() const
Check if the event must be preparing for execution.
virtual real64 GetEventTypeDtRequest(real64 const time)
Get event-specifit dt requests.
void setForecast(integer forecast)
Sets the forecast.
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
void setPrepareForExec()
Define that the event should prepare for execution.
virtual void ExpandObjectCatalogs() override
Expand any catalogs in the data structure.
void setIdle()
Define the event as idle.
void GetTargetReferences()
Process input data to retrieve targeted objects internally. The target object for an event may be spe...
std::string string
String type.
virtual ~EventBase() override
Destructor.
real64 m_lastTime
The last time the event occurred.
constexpr std::enable_if_t< std::is_arithmetic< T >::value, T > max(T const a, T const b)
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
EventBase(std::string const &name, Group *const parent)
Main constructor.
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...