SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
control_system::Systems Namespace Reference

All control systems. More...

Classes

struct  Expansion
 Controls the 3D CubicScale map. More...
struct  GridCenters
 Tracks the centers of two neutron stars. More...
struct  Rotation
 Controls the 3D Rotation map. More...
struct  Shape
 Controls the Shape map. More...
struct  Size
 Controls the \(l=0\) component of the Shape map. More...
struct  Skew
 Controls the 3D Skew map. More...
struct  Translation
 Controls the 3D Translation map. More...

Detailed Description

All control systems.

Details

A control system is a struct that conforms to the control_system::protocols::ControlSystem protocol. They are used to control the time dependent coordinate maps in an evolution. See an example of a control system here:

: tt::ConformsTo<control_system::protocols::ControlSystem> {
static std::string name() { return "ExampleControlSystem"; }
static std::optional<std::string> component_name(
const size_t i, const size_t num_components) {
ASSERT(num_components == 3,
"This control system expected 3 components but there are "
<< num_components << " instead.");
return i == 0 ? "X" : (i == 1 ? "Y" : "Z");
}
using measurement = ExampleMeasurement;
using simple_tags = tmpl::list<>;
static constexpr size_t deriv_order = 2;
using control_error = ExampleControlError;
// This is not part of the required interface, but is used by this
// control system to store the measurement data. Most control
// systems will do something like this.
using type = double;
};
// As with the previous struct, this is not part of the required
// interface.
struct MeasurementQueue : db::SimpleTag {
using type =
LinkedMessageQueue<double, tmpl::list<ExampleSubmeasurementQueueTag>>;
};
template <typename Submeasurement>
using argument_tags = tmpl::list<MeasurementResultTag>;
template <typename Metavariables>
static void apply(ExampleSubmeasurement /*meta*/,
const double measurement_result,
Parallel::GlobalCache<Metavariables>& cache,
const LinkedMessageId<double>& measurement_id) {
// Process the submeasurement results and send whatever is
// necessary to the control system component. Usually calls
// some simple action.
auto& control_system_proxy = Parallel::get_parallel_component<
ControlComponent<Metavariables, ExampleControlSystem>>(cache);
Parallel::simple_action<::Actions::UpdateMessageQueue<
MeasurementQueue, SomeControlSystemUpdater,
ExampleSubmeasurementQueueTag>>(control_system_proxy, measurement_id,
measurement_result);
}
};
};