Tags.hpp
Go to the documentation of this file.
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 /// \file
5 /// Defines tags related to Events and Triggers
6 
7 #pragma once
8 
9 #include "Options/Options.hpp"
10 #include "Parallel/Serialize.hpp"
11 #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
12 
13 namespace OptionTags {
14 /// \ingroup OptionTagsGroup
15 /// \ingroup EventsAndTriggersGroup
16 /// Contains the events and triggers
17 ///
18 /// In yaml this is specified as a map of triggers to lists of events:
19 /// \code{.yaml}
20 /// EventsAndTriggers:
21 /// ? TriggerA:
22 /// OptionsForTriggerA
23 /// : - Event1:
24 /// OptionsForEvent1
25 /// - Event2:
26 /// OptionsForEvent2
27 /// ? TriggerB:
28 /// OptionsForTriggerB
29 /// : - Event3:
30 /// OptionsForEvent3
31 /// - Event4:
32 /// OptionsForEvent4
33 /// \endcode
34 template <typename EventRegistrars, typename TriggerRegistrars>
37  static constexpr OptionString help = "Events to run at triggers";
38 };
39 } // namespace OptionTags
40 
41 namespace Tags {
42 /// \cond
43 struct EventsAndTriggersBase : db::BaseTag {};
44 /// \endcond
45 
46 /// \ingroup EventsAndTriggersGroup
47 /// Contains the events and triggers
48 template <typename EventRegistrars, typename TriggerRegistrars>
49 struct EventsAndTriggers : EventsAndTriggersBase, db::SimpleTag {
50  static std::string name() noexcept { return "EventsAndTriggers"; }
52  using option_tags = tmpl::list<
54  static type create_from_options(const type& events_and_triggers) noexcept {
55  return deserialize<type>(serialize<type>(events_and_triggers).data());
56  }
57 };
58 } // namespace Tags
Contains the events and triggers.
Definition: Tags.hpp:49
Defines classes and functions for making classes creatable from input files.
Tags for the DataBox inherit from this type.
Definition: DataBoxTag.hpp:64
Defines the serialize and deserialize functions.
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:29
Definition: Strahlkorper.hpp:167
Definition: DataBoxTag.hpp:29
Contains the events and triggers.
Definition: Tags.hpp:35
Tags that are base tags, i.e. a simple or compute tag must derive off them for them to be useful...
Definition: DataBoxTag.hpp:82
tuples::TaggedTuple< Tags... > create_from_options(const tuples::TaggedTuple< OptionTags... > &options, tmpl::list< Tags... >) noexcept
Given a list of tags and a tagged tuple containing items created from input options, return a tagged tuple of items constructed by calls to create_from_options for each tag in the list.
Definition: ParallelComponentHelpers.hpp:182