SpECTRE  v2024.04.12
DenseTrigger Class Reference

Base class for checking whether to run an Event at arbitrary times. More...

#include <DenseTrigger.hpp>

Public Member Functions

template<typename DbTags , typename Metavariables , typename ArrayIndex , typename Component >
std::optional< bool > is_triggered (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const Component *const component)
 Check whether the trigger fires. Returns std::nullopt if insufficient data is available to make the decision. The trigger is not responsible for checking whether dense output of the evolved variables is possible, but may need to check things such as the availability of FunctionOfTime data.
 
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename Component >
std::optional< double > next_check_time (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const Component *component)
 Obtain the next time to check the trigger, or std::nullopt if the trigger is not ready to report yet.
 
std::optional< double > previous_trigger_time () const
 Reports the value of Tags::Time when the trigger most recently fired, except for the most recent call of is_triggered. More...
 
void pup (PUP::er &p) override
 

Detailed Description

Base class for checking whether to run an Event at arbitrary times.

The DataBox passed to the member functions will have Tags::Time, and therefore any compute tags depending on that value, set to the time to be tested. Any discrete properties of steps or slabs, such as the step size, may have the values from times off by one step. The evolved variables will be in an unspecified state.

Member Function Documentation

◆ previous_trigger_time()

std::optional< double > DenseTrigger::previous_trigger_time ( ) const
inline

Reports the value of Tags::Time when the trigger most recently fired, except for the most recent call of is_triggered.

Details

The most recent call of is_triggered is not used for reporting the previous trigger so that the time reported to the event is actually the previous time value on which the trigger fired and activated the event. Without ignoring the most recent call of is_triggered, we'd just always be reporting the current time to the event, because events always run after their associated triggers fire via a call to is_triggered.


The documentation for this class was generated from the following file: