15 #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
16 #include "Time/TimeSequence.hpp"
18 #include "Time/Utilities.hpp"
19 #include "Utilities/Registration.hpp"
30 template <
typename TriggerRegistrars>
33 namespace Registrars {
44 template <
typename TriggerRegistrars = tmpl::list<Registrars::Times>>
49 explicit Times(CkMigrateMessage* ) noexcept {}
50 using PUP::able::register_constructor;
57 : times_(std::move(times)) {}
59 using argument_tags = tmpl::list<Tags::Time, Tags::TimeStepId>;
61 bool operator()(
const double now,
const TimeStepId& time_id)
const noexcept {
62 const auto& substep_time = time_id.substep_time();
67 const auto nearby_time = times_->times_near(now)[1];
68 return nearby_time and std::abs(*nearby_time - now) < sloppiness;
72 void pup(PUP::er& p) noexcept
override { p | times_; }
79 template <
typename TriggerRegistrars>
80 PUP::able::PUP_ID Times<TriggerRegistrars>::my_PUP_ID = 0;
84 template <
typename TriggerRegistrars>
86 template <
typename Metavariables>
double slab_rounding_error(const Time &time) noexcept
Definition: Utilities.cpp:12
Definition: Options.hpp:108
A template for defining a registrar.
Definition: Registration.hpp:42
Represents a sequence of times.
Definition: TimeSequence.hpp:31
#define WRAPPED_PUPable_decl_template(className)
Mark derived classes as serializable.
Definition: CharmPupable.hpp:22
Definition: MinmodType.hpp:11
Definition: Trigger.hpp:34
Definition: TimeStepId.hpp:25
T parse_as() const
Convert to an object of type T.
Definition: ParseOptions.hpp:92
const char *const String
The string used in option structs.
Definition: Options.hpp:32