Tags.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <deque>
8 #include <string>
9 #include <type_traits>
10 #include <unordered_map>
11 #include <unordered_set>
12 
15 #include "Domain/Mesh.hpp"
16 #include "NumericalAlgorithms/Interpolation/InterpolatedVars.hpp"
18 
19 /// \cond
20 template <size_t VolumeDim>
21 class ElementId;
22 /// \endcond
23 
24 namespace intrp {
25 
26 /// Tags for items held in the `DataBox` of `InterpolationTarget` or
27 /// `Interpolator`.
28 namespace Tags {
29 
30 /// Keeps track of which points have been filled with interpolated data.
32  static std::string name() noexcept { return "IndicesOfFilledInterpPoints"; }
34 };
35 
36 /// `temporal_id`s on which to interpolate.
37 template <typename Metavariables>
38 struct TemporalIds : db::SimpleTag {
40  static std::string name() noexcept { return "TemporalIds"; }
41 };
42 
43 /// Volume variables at all `temporal_id`s for all local `Element`s.
44 template <typename Metavariables>
46  struct Info {
48  Variables<typename Metavariables::interpolator_source_vars> vars;
49  };
50  using type = std::unordered_map<
54  static std::string name() noexcept { return "VolumeVarsInfo"; }
55 };
56 
57 namespace holders_detail {
58 template <typename InterpolationTargetTag, typename Metavariables>
60 } // namespace holders_detail
61 
62 /// `TaggedTuple` containing all local `Vars::Holder`s for
63 /// all `InterpolationTarget`s.
64 ///
65 /// A particular `Vars::Holder` can be retrieved from this
66 /// `TaggedTuple` via a `Vars::HolderTag`. An `Interpolator` uses the
67 /// object in `InterpolatedVarsHolders` to iterate over all of the
68 /// `InterpolationTarget`s.
69 template <typename Metavariables>
71  using type = tuples::tagged_tuple_from_typelist<db::wrap_tags_in<
73  typename Metavariables::interpolation_target_tags, Metavariables>>;
74  static std::string name() noexcept { return "InterpolatedVarsHolders"; }
75 };
76 
77 /// Number of local `Element`s.
79  static std::string name() noexcept { return "NumberOfElements"; }
80  using type = size_t;
81 };
82 
83 } // namespace Tags
84 } // namespace intrp
Defines class tuples::TaggedTuple.
Definition: AddTemporalIdsToInterpolationTarget.hpp:17
An ElementId uniquely labels an Element. It is constructed from the BlockId of the Block to which the...
Definition: ElementId.hpp:36
Volume variables at all temporal_ids for all local Elements.
Definition: Tags.hpp:45
Tags for the DataBox inherit from this type.
Definition: DataBoxTag.hpp:65
tmpl::transform< TagList, tmpl::bind< Wrapper, tmpl::_1, tmpl::pin< Args >... > > wrap_tags_in
Create a new list of Tags by wrapping each tag in TagList using the Wrapper.
Definition: DataBoxTag.hpp:418
TaggedTuple containing all local Vars::Holders for all InterpolationTargets.
Definition: Tags.hpp:70
Keeps track of which points have been filled with interpolated data.
Definition: Tags.hpp:31
temporal_ids on which to interpolate.
Definition: InterpolationTargetWedgeSectionTorus.hpp:29
Defines class Variables.
Definition: DataBoxTag.hpp:29
Defines the class template Mesh.
Definition: Tags.hpp:46
Number of local Elements.
Definition: Tags.hpp:78
Identifies a step in the linear solver algorithm.
Definition: IterationId.hpp:25
Definition: SolvePoissonProblem.hpp:38
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Indexes a particular Holder in the TaggedTuple that is accessed from the Interpolator&#39;s DataBox with ...
Definition: InterpolatedVars.hpp:87