Section.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <optional>
7 #include <string>
8 
9 #include "DataStructures/DataBox/Tag.hpp"
10 #include "DataStructures/DataBox/TagName.hpp"
11 #include "Parallel/ParallelComponentHelpers.hpp"
12 #include "Parallel/PupStlCpp17.hpp"
13 #include "Parallel/Section.hpp"
14 
15 namespace Parallel::Tags {
16 
17 /*!
18  * \brief The `Parallel::Section<ParallelComponent, SectionIdTag>` that this
19  * element belongs to.
20  *
21  * The tag holds a `std::nullopt` if the element doesn't belong to a section of
22  * the `SectionIdTag`. For example, a section may describe a specific region in
23  * the computational domain and thus doesn't include all elements, so this tag
24  * would hold `std::nullopt` on the elements outside that region.
25  *
26  * \see Parallel::Section
27  */
28 template <typename ParallelComponent, typename SectionIdTag>
30  static std::string name() noexcept {
31  return "Section(" + db::tag_name<SectionIdTag>() + ")";
32  }
33  using type =
35  // Allow default-constructing the tag so sections can be created and assigned
36  // to the tag in a parallel component's `allocate_array` function.
37  constexpr static bool pass_metavariables = false;
38  using option_tags = tmpl::list<>;
39  static type create_from_options() noexcept { return {}; };
40 };
41 
42 } // namespace Parallel::Tags
std::string
db::SimpleTag
Mark a struct as a simple tag by inheriting from this.
Definition: Tag.hpp:36
optional
Parallel::Tags::Section
The Parallel::Section<ParallelComponent, SectionIdTag> that this element belongs to.
Definition: Section.hpp:29
string