Tags.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <string>
7 
8 #include "Options/Options.hpp"
9 
10 namespace OptionTags {
11 /*!
12  * \ingroup OptionGroupsGroup
13  * \brief Groups the filtering configurations in the input file.
14  */
16  static std::string name() noexcept { return "Filtering"; }
17  static constexpr OptionString help = "Options for filtering";
18 };
19 
20 /*!
21  * \ingroup OptionTagsGroup
22  * \brief The option tag that retrieves the parameters for the filter
23  * from the input file
24  */
25 template <typename FilterType>
26 struct Filter {
27  static std::string name() noexcept { return option_name<FilterType>(); }
28  static constexpr OptionString help = "Options for the filter";
29  using type = FilterType;
30  using group = FilteringGroup;
31 };
32 } // namespace OptionTags
33 
34 namespace Filters {
35 namespace Tags {
36 /*!
37  * \brief The global cache tag for the filter
38  */
39 template <typename FilterType>
41  static std::string name() noexcept { return "Filter"; }
42  using type = FilterType;
43  using option_tags = tmpl::list<::OptionTags::Filter<FilterType>>;
44  static FilterType create_from_options(const FilterType& filter) noexcept {
45  return filter;
46  }
47 };
48 } // namespace Tags
49 } // namespace Filters
The global cache tag for the filter.
Definition: Tags.hpp:40
Defines classes and functions for making classes creatable from input files.
Tags for the DataBox inherit from this type.
Definition: DataBoxTag.hpp:64
Groups the filtering configurations in the input file.
Definition: Tags.hpp:15
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:29
Definition: Strahlkorper.hpp:167
Definition: DataBoxTag.hpp:29
Definition: ExponentialFilter.hpp:20
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
The option tag that retrieves the parameters for the filter from the input file.
Definition: Tags.hpp:26