Definition of a control error.
A control error is used within a control system to compute how far off the the value you are controlling is from its expected value.
A conforming type must specify:
- a call operator that returns a DataVector with a signature the same as in the example shown here:
- a
static constexpr size_t expected_number_of_excisions
which specifies the number of excisions necessary in order to compute the control error.
- a type alias
object_centers
to a domain::object_list
of domain::ObjectLabel
s. These are the objects that will require the domain::Tags::ObjectCenter
s tags to be in the GlobalCache for this control system to work.
- Note
- The TimescaleTuner can have it's template parameter be either
true
or false
.
struct ExampleControlError
static constexpr size_t expected_number_of_excisions = 1;
void pup(PUP::er& ) {}
template <typename Metavariables, typename... QueueTags>
DataVector operator()(const ::TimescaleTuner<true>& tuner,
const double time,
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;
(void)measurements;
(void)tuner;
return {current_map_value - measured_value};
}
};
Stores a collection of function values.
Definition: DataVector.hpp:48
A Charm++ chare that caches global data once per Charm++ node.
Definition: GlobalCache.hpp:221
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:262
Similar to a tmpl::list but for ObjectLabels.
Definition: ObjectLabel.hpp:28