SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/EventsAndTriggers - Tags.hpp Hit Total Coverage
Commit: a48770a280d0d66bc04cb5df30de1e3cc4985437 Lines: 3 10 30.0 %
Date: 2021-06-17 20:55:50
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           1 : struct EventsAndTriggers {
      36           0 :   using type = ::EventsAndTriggers;
      37           0 :   static constexpr Options::String help = "Events to run at triggers";
      38             :   // When the template arguments to this struct are sufficiently
      39             :   // complicated, pretty_type::short_name() run on this struct returns
      40             :   // something that is neither pretty nor short, and leads to an
      41             :   // OptionParser run-time error saying that an option name is greater
      42             :   // than 21 characters.  Adding the name() function below bypasses
      43             :   // pretty_type::short_name().
      44           0 :   static std::string name() noexcept { return "EventsAndTriggers"; }
      45             : };
      46             : }  // namespace OptionTags
      47             : 
      48             : namespace Tags {
      49             : /// \ingroup EventsAndTriggersGroup
      50             : /// Contains the events and triggers
      51           1 : struct EventsAndTriggers : db::SimpleTag {
      52           0 :   using type = ::EventsAndTriggers;
      53           0 :   using option_tags = tmpl::list<::OptionTags::EventsAndTriggers>;
      54             : 
      55           0 :   static constexpr bool pass_metavariables = false;
      56           0 :   static type create_from_options(const type& events_and_triggers) noexcept {
      57             :     return deserialize<type>(serialize<type>(events_and_triggers).data());
      58             :   }
      59             : };
      60             : }  // namespace Tags

Generated by: LCOV version 1.14