SpECTRE  v2025.04.21
control_system::ControlErrors Namespace Reference

All control errors that will be used in control systems. More...

Classes

struct  Expansion
 Control error in the 3D CubicScale coordinate map. More...
 
struct  GridCenters
 Tracks the grid-frame object centers. More...
 
struct  Rotation
 Control error in the 3D Rotation coordinate map. More...
 
struct  Shape
 Control error in the Shape coordinate map. More...
 
struct  Size
 Control error in the for the \(l=0\) component of the domain::CoordinateMaps::TimeDependent::Shape map. More...
 
struct  Skew
 Control error in the for the domain::CoordinateMaps::TimeDependent::Skew map. More...
 
struct  Translation
 Control error in the 3D Translation coordinate map. More...
 

Detailed Description

All control errors that will be used in control systems.

Details

A control error is a struct that conforms to the control_system::protocols::ControlError protocol. Control errors compute the error between current map parameters and what they are expected to be. See an example of a control error here:

struct ExampleControlError
: tt::ConformsTo<control_system::protocols::ControlError> {
std::optional<double> get_suggested_timescale() const {
return suggested_timescale_;
}
void reset() { suggested_timescale_ = std::nullopt; }
void pup(PUP::er& /*p*/) {}
template <typename Metavariables, typename... QueueTags>
DataVector operator()(const ::TimescaleTuner<true>& tuner,
const double time,
const std::string& function_of_time_name,
const tuples::TaggedTuple<QueueTags...>& measurements) {
const auto& functions_of_time =
Parallel::get<domain::Tags::FunctionsOfTime>(cache);
const double current_map_value =
functions_of_time.at(function_of_time_name)->func(time)[0][0];
const double measured_value = 0.0;
suggested_timescale_ = 1.0;
// Would do something like get<QueueTag>(measurements) here
(void)measurements;
// Size control needs the timescale tuner
(void)tuner;
return {current_map_value - measured_value};
}
private:
std::optional<double> suggested_timescale_;
};
Stores a collection of function values.
Definition: DataVector.hpp:48
A Charm++ chare that caches global data once per Charm++ node.
Definition: GlobalCache.hpp:223
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:264
Similar to a tmpl::list but for ObjectLabels.
Definition: ObjectLabel.hpp:28
Indicate a class conforms to the Protocol.
Definition: ProtocolHelpers.hpp:22