SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/EventsAndTriggers - Tags.hpp Hit Total Coverage
Commit: b1342d46f40e2d46bbd11d0cef68fd973031a24b Lines: 3 10 30.0 %
Date: 2020-09-24 20:24:42
Legend: Lines: hit not hit

          Line data    Source code
       1           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 "DataStructures/DataBox/Tag.hpp"
      10             : #include "Options/Options.hpp"
      11             : #include "Parallel/Serialize.hpp"
      12             : #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
      13             : 
      14             : namespace OptionTags {
      15             : /// \ingroup OptionTagsGroup
      16             : /// \ingroup EventsAndTriggersGroup
      17             : /// Contains the events and triggers
      18             : ///
      19             : /// In yaml this is specified as a map of triggers to lists of events:
      20             : /// \code{.yaml}
      21             : /// EventsAndTriggers:
      22             : ///   ? TriggerA:
      23             : ///       OptionsForTriggerA
      24             : ///   : - Event1:
      25             : ///         OptionsForEvent1
      26             : ///     - Event2:
      27             : ///         OptionsForEvent2
      28             : ///   ? TriggerB:
      29             : ///       OptionsForTriggerB
      30             : ///   : - Event3:
      31             : ///         OptionsForEvent3
      32             : ///     - Event4:
      33             : ///         OptionsForEvent4
      34             : /// \endcode
      35             : template <typename EventRegistrars, typename TriggerRegistrars>
      36           1 : struct EventsAndTriggers {
      37           0 :   using type = ::EventsAndTriggers<EventRegistrars, TriggerRegistrars>;
      38           0 :   static constexpr Options::String help = "Events to run at triggers";
      39             :   // When the template arguments to this struct are sufficiently
      40             :   // complicated, pretty_type::short_name() run on this struct returns
      41             :   // something that is neither pretty nor short, and leads to an
      42             :   // OptionParser run-time error saying that an option name is greater
      43             :   // than 21 characters.  Adding the name() function below bypasses
      44             :   // pretty_type::short_name().
      45           0 :   static std::string name() noexcept { return "EventsAndTriggers"; }
      46             : };
      47             : }  // namespace OptionTags
      48             : 
      49             : namespace Tags {
      50             : /// \cond
      51             : struct EventsAndTriggersBase : db::BaseTag {};
      52             : /// \endcond
      53             : 
      54             : /// \ingroup EventsAndTriggersGroup
      55             : /// Contains the events and triggers
      56             : template <typename EventRegistrars, typename TriggerRegistrars>
      57           1 : struct EventsAndTriggers : EventsAndTriggersBase, db::SimpleTag {
      58           0 :   using type = ::EventsAndTriggers<EventRegistrars, TriggerRegistrars>;
      59           0 :   using option_tags = tmpl::list<
      60             :       ::OptionTags::EventsAndTriggers<EventRegistrars, TriggerRegistrars>>;
      61             : 
      62           0 :   static constexpr bool pass_metavariables = false;
      63           0 :   static type create_from_options(const type& events_and_triggers) noexcept {
      64             :     return deserialize<type>(serialize<type>(events_and_triggers).data());
      65             :   }
      66             : };
      67             : }  // namespace Tags

Generated by: LCOV version 1.14