SpECTRE
v2024.09.29
|
Represents a 'state' of the size control system. More...
#include <State.hpp>
Public Member Functions | |
State (const State &)=default | |
State & | operator= (const State &)=default |
State (State &&)=default | |
State & | operator= (State &&)=default |
virtual std::string | name () const =0 |
Name of this state. More... | |
virtual size_t | number () const =0 |
Return a size_t that corresponds to the state number in SpEC. More... | |
virtual std::unique_ptr< State > | get_clone () const =0 |
virtual std::string | update (const gsl::not_null< Info * > info, const StateUpdateArgs &update_args, const CrossingTimeInfo &crossing_time_info) const =0 |
Updates the Info in info . More... | |
virtual double | control_error (const Info &info, const ControlErrorArgs &control_error_args) const =0 |
Returns the control signal, but does not modify the state or any parameters. More... | |
WRAPPED_PUPable_abstract (State) | |
State (CkMigrateMessage *msg) | |
Represents a 'state' of the size control system.
Each 'state' of the size control system has a different control signal, which has a different purpose, even though each state controls the same map quantity, namely the Y00 coefficient of the shape map. For example, state Label::AhSpeed controls the Y00 coefficient of the shape map so that the minimum characteristic speed is driven towards a target value, and state Label::DeltaR controls the Y00 coefficient of the shape map (or the Y00 coefficient of a separate spherically-symmetric size map) so that the minimum difference between the horizon radius and the excision boundary radius is driven towards a constant.
Each state has its own logic (the 'update' function) that determines values of certain parameters (i.e. the things in Info), including whether the control system should transition to a different state.
The different states are:
The reason that DeltaRDriftInward, DeltaRDriftOutward, and DeltaRTransition are separate states is to simplify the logic. In principle, all 3 of those states could be merged with state DeltaR, because the control error is the same for all four states (except for a velocity term that could be set to zero). But if that were done, then there would need to be additional complicated logic in determining transitions between different states, and that logic would depend not only on the current state, but also on the previous state.
|
pure virtual |
Returns the control signal, but does not modify the state or any parameters.
Implemented in control_system::size::States::AhSpeed, control_system::size::States::DeltaR, control_system::size::States::DeltaRDriftOutward, and control_system::size::States::Initial.
|
pure virtual |
Name of this state.
Implemented in control_system::size::States::AhSpeed, control_system::size::States::DeltaR, control_system::size::States::DeltaRDriftOutward, and control_system::size::States::Initial.
|
pure virtual |
Return a size_t that corresponds to the state number in SpEC.
Implemented in control_system::size::States::AhSpeed, control_system::size::States::DeltaR, control_system::size::States::DeltaRDriftOutward, and control_system::size::States::Initial.
|
pure virtual |
Updates the Info in info
.
info
includes a state, which might be different than the current state upon return. It is the caller's responsibility to check if the current state has changed.Returns: The return string is used as a helpful diagnostic that may be printed to determine what logic decisions the state is making (depends on the control_system::Tags::Verbosity
flag).
Implemented in control_system::size::States::AhSpeed, control_system::size::States::DeltaR, control_system::size::States::DeltaRDriftOutward, and control_system::size::States::Initial.