SpECTRE  v2024.04.12
control_system::Systems Namespace Reference

All control systems. More...

Classes

struct  Expansion
 Controls the 3D CubicScale map. 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  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:

struct ExampleControlSystem
: 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.
struct ExampleSubmeasurementQueueTag {
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>>;
};
struct process_measurement {
template <typename Submeasurement>
using argument_tags = tmpl::list<MeasurementResultTag>;
template <typename Metavariables>
static void apply(ExampleSubmeasurement /*meta*/,
const double measurement_result,
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<
ExampleSubmeasurementQueueTag, MeasurementQueue,
SomeControlSystemUpdater>>(control_system_proxy, measurement_id,
measurement_result);
}
};
};
A Charm++ chare that caches global data once per Charm++ node.
Definition: GlobalCache.hpp:221
auto apply(F &&f, const ObservationBox< ComputeTagsList, DataBoxType > &observation_box, Args &&... args)
Apply the function object f using its nested argument_tags list of tags.
Definition: ObservationBox.hpp:238
#define ASSERT(a, m)
Assert that an expression should be true.
Definition: Assert.hpp:51
void simple_action(Proxy &&proxy)
Invoke a simple action on proxy
Definition: Invoke.hpp:86
auto get_parallel_component(GlobalCache< Metavariables > &cache) -> Parallel::proxy_from_parallel_component< GlobalCache_detail::get_component_if_mocked< typename Metavariables::component_list, ParallelComponentTag > > &
Access the Charm++ proxy associated with a ParallelComponent.
Definition: GlobalCache.hpp:755
std::string name()
Return the result of the name() member of a class. If a class doesn't have a name() member,...
Definition: PrettyType.hpp:733
Parallel::GlobalCache< Metavariables > & cache(MockRuntimeSystem< Metavariables > &runner, const ArrayIndex &array_index)
Returns the GlobalCache of Component with index array_index.
Definition: MockRuntimeSystemFreeFunctions.hpp:379
Add data to a LinkedMessageQueue.
Definition: UpdateMessageQueue.hpp:38
The singleton parallel component responsible for managing a single control system.
Definition: Component.hpp:31
An identifier for an element in a sequence.
Definition: LinkedMessageId.hpp:23
Mark a struct as a simple tag by inheriting from this.
Definition: Tag.hpp:36
Indicate a class conforms to the Protocol.
Definition: ProtocolHelpers.hpp:22