SpECTRE
v2023.05.16
|
Functor for updating control systems when they are ready. More...
#include <UpdateControlSystem.hpp>
Static Public Member Functions | |
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename... TupleTags> | |
static void | apply (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &, const double time, tuples::TaggedTuple< TupleTags... > data) |
Static Public Attributes | |
static constexpr size_t | deriv_order = ControlSystem::deriv_order |
Functor for updating control systems when they are ready.
The apply operator of this struct is meant to be called by the UpdateMessageQueue action once an entire measurement has been made.
Requires a few tags to be in the DataBox of the ControlComponent that this is running on:
And the control_system::Tags::MeasurementsPerUpdate must be in the GlobalCache. If these tags are not present, a build error will occur.
The algorithm to determine whether or not to update the functions of time is as follows:
control_system::Tags::CurrentNumberOfMeasurements
. This keeps track of which measurement we are on out of control_system::Tags::MeasurementsPerUpdate
.control_system::Tags::WriteDataToDisk
tag is set to true
, write the time, function of time values, and the control error and its derivative to disk.domain::Tags::FunctionsOfTime
and control_system::Tags::MeasurementTimescales
. Update the MaxDeriv of the functions of time with the control signal and update the measurement timescales with the new measurement timescale (both of these are Parallel::mutate
calls).