SpECTRE
v2024.12.16
|
Class that checks dense triggers and runs events. More...
#include <EventsAndDenseTriggers.hpp>
Classes | |
struct | TriggerAndEvents |
Public Types | |
enum class | TriggeringState { Ready , NeedsEvolvedVariables , NotReady } |
using | ConstructionType = std::vector< TriggerAndEvents > |
Public Member Functions | |
EventsAndDenseTriggers (ConstructionType events_and_triggers) | |
template<typename DbTags > | |
double | next_trigger (const db::DataBox< DbTags > &box) |
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ComponentPointer > | |
TriggeringState | is_ready (gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer component) |
Check triggers fire and whether all events to run are ready. If this function returns anything other than NotReady, then rerunning it will skip checks (except for Event::needs_evolved_variables) until a successful call to reschedule. | |
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ComponentPointer > | |
void | run_events (db::DataBox< DbTags > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer component) |
Run events associated with fired triggers. This must be called after is_ready returns something other then NotReady. Any repeated calls will be no-ops until a successful call to reschedule. | |
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ComponentPointer > | |
bool | reschedule (gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer component) |
Schedule the next check. This must be called after run_events for the current check. Returns true on success, false if insufficient data is available and the call should be retried later. | |
void | add_trigger_and_events (std::unique_ptr< DenseTrigger > trigger, std::vector< std::unique_ptr< Event > > events) |
Add a new trigger and set of events. This can only be called during initialization. | |
template<typename F > | |
void | for_each_event (F &&f) const |
void | pup (PUP::er &p) |
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ComponentPointer > | |
EventsAndDenseTriggers::TriggeringState | is_ready (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer component) |
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ComponentPointer > | |
bool | reschedule (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer component) |
Class that checks dense triggers and runs events.