SpECTRE
v2025.01.30
|
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::size::update_averager
for this step.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.control_system::size::update_tuner
for this step.domain::Tags::FunctionsOfTime
and control_system::Tags::MeasurementTimescales
. Call the control_system::AggregateUpdate
simple action on the first control system in the component_list
of the metavariables. This simple action will mutate the global cache tags when it has enough data.