Tags.hpp
Go to the documentation of this file.
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 /// \file
5 /// Defines tags related to domain quantities
6 
7 #pragma once
8 
9 #include <cstddef>
10 #include <memory>
11 #include <string>
12 #include <unordered_map>
13 #include <unordered_set>
14 
16 #include "DataStructures/Index.hpp"
19 #include "Domain/Creators/DomainCreator.hpp" // IWYU pragma: keep
20 #include "Domain/Direction.hpp"
21 #include "Domain/Element.hpp"
22 #include "Domain/ElementMap.hpp"
23 #include "Domain/IndexToSliceAt.hpp"
24 #include "Domain/LogicalCoordinates.hpp" // IWYU pragma: keep
25 #include "Domain/Mesh.hpp"
26 #include "Domain/Side.hpp"
27 #include "Options/Options.hpp"
28 #include "Utilities/GetOutput.hpp"
29 #include "Utilities/Gsl.hpp"
30 #include "Utilities/NoSuchType.hpp"
31 #include "Utilities/Requires.hpp"
32 #include "Utilities/TMPL.hpp"
33 #include "Utilities/TypeTraits.hpp"
34 
35 /// \cond
36 class DataVector;
37 /// \endcond
38 
39 namespace OptionTags {
40 /// \ingroup OptionTagsGroup
41 /// \ingroup ComputationalDomainGroup
42 /// The input file tag for the DomainCreator to use
43 template <size_t Dim, typename TargetFrame>
44 struct DomainCreator {
46  static constexpr OptionString help = {"The domain to create initially"};
47 };
48 } // namespace OptionTags
49 
50 namespace Tags {
51 /// \ingroup DataBoxTagsGroup
52 /// \ingroup ComputationalDomainGroup
53 /// The ::Domain.
54 template <size_t VolumeDim, typename Frame>
56  static std::string name() noexcept { return "Domain"; }
58 };
59 
60 /// \ingroup DataBoxTagsGroup
61 /// \ingroup ComputationalDomainGroup
62 /// The ::Element associated with the DataBox
63 template <size_t VolumeDim>
65  static std::string name() noexcept { return "Element"; }
66  using type = ::Element<VolumeDim>;
67 };
68 
69 /// \ingroup DataBoxTagsGroup
70 /// \ingroup ComputationalDomainGroup
71 /// \brief The computational grid of the Element in the DataBox
72 /// \details The corresponding interface tag uses Mesh::slice_through to compute
73 /// the mesh on the face of the element.
74 template <size_t VolumeDim>
75 struct Mesh : db::SimpleTag {
76  static std::string name() noexcept { return "Mesh"; }
77  using type = ::Mesh<VolumeDim>;
78 };
79 
80 /// \ingroup DataBoxTagsGroup
81 /// \ingroup ComputationalDomainGroup
82 /// The coordinate map from logical to grid coordinate
83 template <size_t VolumeDim, typename Frame = ::Frame::Inertial>
85  static std::string name() noexcept { return "ElementMap"; }
87 };
88 
89 /// \ingroup DataBoxTagsGroup
90 /// \ingroup ComputationalDomainGroup
91 /// The coordinates in a given frame.
92 ///
93 /// \snippet Test_CoordinatesTag.cpp coordinates_name
94 template <size_t Dim, typename Frame>
96  static std::string name() noexcept {
97  return get_output(Frame{}) + "Coordinates";
98  }
99  using type = tnsr::I<DataVector, Dim, Frame>;
100 };
101 
102 /// \ingroup DataBoxTagsGroup
103 /// \ingroup ComputationalDomainGroup
104 /// The coordinates in the target frame of `MapTag`. The `SourceCoordsTag`'s
105 /// frame must be the source frame of `MapTag`
106 template <class MapTag, class SourceCoordsTag>
108  : Coordinates<db::item_type<MapTag>::dim,
109  typename db::item_type<MapTag>::target_frame>,
111  static constexpr auto function(
112  const db::item_type<MapTag>& element_map,
113  const db::item_type<SourceCoordsTag>& source_coords) noexcept {
114  return element_map(source_coords);
115  }
116  using argument_tags = tmpl::list<MapTag, SourceCoordsTag>;
117 };
118 
119 /// \ingroup DataBoxTagsGroup
120 /// \ingroup ComputationalDomainGroup
121 /// Computes the inverse Jacobian of the map held by `MapTag` at the coordinates
122 /// held by `SourceCoordsTag`. The coordinates must be in the source frame of
123 /// the map.
124 template <typename MapTag, typename SourceCoordsTag>
126  using tag = MapTag;
127  static std::string name() noexcept { return "InverseJacobian"; }
128  static constexpr auto function(
129  const db::item_type<MapTag>& element_map,
130  const db::item_type<SourceCoordsTag>& source_coords) noexcept {
131  return element_map.inv_jacobian(source_coords);
132  }
133  using argument_tags = tmpl::list<MapTag, SourceCoordsTag>;
134 };
135 
136 /// \ingroup DataBoxTagsGroup
137 /// \ingroup DomainGroup
138 /// Base tag for boundary data needed for updating the variables.
140 
141 /// \ingroup DataBoxTagsGroup
142 /// \ingroup ComputationalDomainGroup
143 /// The set of directions to neighboring Elements
144 template <size_t VolumeDim>
146  static std::string name() noexcept { return "InternalDirections"; }
147  using argument_tags = tmpl::list<Element<VolumeDim>>;
148  static constexpr auto function(const ::Element<VolumeDim>& element) noexcept {
150  for (const auto& direction_neighbors : element.neighbors()) {
151  result.insert(direction_neighbors.first);
152  }
153  return result;
154  }
155 };
156 
157 /// \ingroup DataBoxTagsGroup
158 /// \ingroup ComputationalDomainGroup
159 /// The set of directions which correspond to external boundaries.
160 /// Used for representing data on the interior side of the external boundary
161 /// faces.
162 template <size_t VolumeDim>
164  static std::string name() noexcept { return "BoundaryDirectionsInterior"; }
165  using argument_tags = tmpl::list<Element<VolumeDim>>;
166  static constexpr auto function(const ::Element<VolumeDim>& element) noexcept {
167  return element.external_boundaries();
168  }
169 };
170 
171 /// \ingroup DataBoxTagsGroup
172 /// \ingroup ComputationalDomainGroup
173 /// The set of directions which correspond to external boundaries. To be used
174 /// to represent data which exists on the exterior side of the external boundary
175 /// faces.
176 template <size_t VolumeDim>
178  static std::string name() noexcept { return "BoundaryDirectionsExterior"; }
179  using argument_tags = tmpl::list<Element<VolumeDim>>;
180  static constexpr auto function(const ::Element<VolumeDim>& element) noexcept {
181  return element.external_boundaries();
182  }
183 };
184 
185 
186 /// \ingroup DataBoxTagsGroup
187 /// \ingroup ComputationalDomainGroup
188 /// \brief Tag which is either a SimpleTag for quantities on an
189 /// interface, base tag to a compute item which acts on tags on an interface, or
190 /// base tag to a compute item which slices a tag from the volume to an
191 /// interface.
192 ///
193 /// The contained object will be a map from ::Direction to the item type of
194 /// `Tag`, with the set of directions being those produced by `DirectionsTag`.
195 ///
196 /// If a SimpleTag is desired on the interface, then this tag can be added to
197 /// the DataBox directly. If a ComputeTag which acts on Tags on the interface is
198 /// desired, then the tag should be added using `InterfaceComputeItem`. If a
199 /// ComputeTag which slices a VariablesTag in the volume to an Interface is
200 /// desired, then it should be added using `Slice`. In all cases, the tag can
201 /// then be retrieved using `Tags::Interface<DirectionsTag, Tag>`.
202 ///
203 /// If using the base tag mechanism for an interface tag is desired,
204 /// then `Tag` can have a `base` type alias pointing to its base
205 /// class. (This requirement is due to the lack of a way to determine
206 /// a type's base classes in C++.)
207 ///
208 /// It must be possible to determine the type associated with `Tag`
209 /// without reference to a DataBox, i.e., `db::item_type<Tag>` must
210 /// work.
211 ///
212 /// \tparam DirectionsTag the item of directions
213 /// \tparam Tag the tag labeling the item
214 ///
215 /// \see InterfaceComputeItem, Slice
216 template <typename DirectionsTag, typename Tag>
217 struct Interface;
218 
219 namespace Interface_detail {
220 // Pull volume_tags from BaseComputeItem, defaulting to an empty list.
221 template <typename BaseComputeItem, typename = cpp17::void_t<>>
222 struct volume_tags {
223  using type = tmpl::list<>;
224 };
225 
226 template <typename BaseComputeItem>
227 struct volume_tags<BaseComputeItem,
228  cpp17::void_t<typename BaseComputeItem::volume_tags>> {
229  using type = typename BaseComputeItem::volume_tags;
230 };
231 
232 // Add an Interface wrapper to a tag if it is not listed as being
233 // taken from the volume.
234 template <typename DirectionsTag, typename Tag, typename VolumeTags>
235 struct interface_compute_item_argument_tag {
236  using type = tmpl::conditional_t<tmpl::list_contains_v<VolumeTags, Tag>, Tag,
238 };
239 
240 // Compute the argument tags for the interface version of a compute item.
241 template <typename DirectionsTag, typename BaseComputeItem>
242 using interface_compute_item_argument_tags = tmpl::transform<
243  typename BaseComputeItem::argument_tags,
244  interface_compute_item_argument_tag<
245  tmpl::pin<DirectionsTag>, tmpl::_1,
246  tmpl::pin<typename volume_tags<BaseComputeItem>::type>>>;
247 
248 // Pull the direction's entry from interface arguments, passing volume
249 // arguments through unchanged.
250 template <bool IsVolumeTag>
251 struct unmap_interface_args;
252 
253 template <>
254 struct unmap_interface_args<true> {
255  template <typename T>
256  using f = T;
257 
258  template <size_t VolumeDim, typename T>
259  static constexpr const T& apply(const ::Direction<VolumeDim>& /*direction*/,
260  const T& arg) noexcept {
261  return arg;
262  }
263 };
264 
265 template <>
266 struct unmap_interface_args<false> {
267  template <typename T>
268  using f = typename T::mapped_type;
269 
270  template <size_t VolumeDim, typename T>
271  static constexpr decltype(auto) apply(const ::Direction<VolumeDim>& direction,
272  const T& arg) noexcept {
273  return arg.at(direction);
274  }
275 };
276 
277 template <typename DirectionsTag, typename BaseComputeItem,
278  typename ArgumentTags>
279 struct evaluate_compute_item;
280 
281 template <typename DirectionsTag, typename BaseComputeItem,
282  typename... ArgumentTags>
283 struct evaluate_compute_item<DirectionsTag, BaseComputeItem,
284  tmpl::list<ArgumentTags...>> {
285  using volume_tags = typename volume_tags<BaseComputeItem>::type;
286  static_assert(
287  tmpl::size<tmpl::list_difference<
288  volume_tags, typename BaseComputeItem::argument_tags>>::value == 0,
289  "volume_tags contains tags not in argument_tags");
290 
291  private:
292  // Order matters so we mix public/private
293  template <class ComputeItem, bool = db::has_return_type_member_v<ComputeItem>>
294  struct ComputeItemType {
295  using type = std::decay_t<decltype(BaseComputeItem::function(
296  std::declval<typename unmap_interface_args<
297  tmpl::list_contains_v<volume_tags, ArgumentTags>>::
298  template f<db::item_type<ArgumentTags>>>()...))>;
299  };
300 
301  template <class ComputeItem>
302  struct ComputeItemType<ComputeItem, true> {
303  using type = typename BaseComputeItem::return_type;
304  };
305 
306  public:
307  using return_type =
309  typename ComputeItemType<BaseComputeItem>::type>;
310 
311  static constexpr void apply(
312  const gsl::not_null<return_type*> result,
313  const db::item_type<DirectionsTag>& directions,
314  const db::item_type<ArgumentTags>&... args) noexcept {
315  apply_helper(
317  db::has_return_type_member_v<BaseComputeItem>>{},
318  result, directions, args...);
319  }
320 
321  private:
322  static constexpr void apply_helper(
323  std::false_type /*has_return_type_member*/,
324  const gsl::not_null<return_type*> result,
325  const db::item_type<DirectionsTag>& directions,
326  const db::item_type<ArgumentTags>&... args) noexcept {
327  for (const auto& direction : directions) {
328  (*result)[direction] = BaseComputeItem::function(
329  unmap_interface_args<tmpl::list_contains_v<
330  volume_tags, ArgumentTags>>::apply(direction, args)...);
331  }
332  }
333 
334  static constexpr void apply_helper(
335  std::true_type /*has_return_type_member*/,
336  const gsl::not_null<return_type*> result,
337  const db::item_type<DirectionsTag>& directions,
338  const db::item_type<ArgumentTags>&... args) noexcept {
339  for (const auto& direction : directions) {
340  BaseComputeItem::function(
341  make_not_null(&(*result)[direction]),
342  unmap_interface_args<tmpl::list_contains_v<
343  volume_tags, ArgumentTags>>::apply(direction, args)...);
344  }
345  }
346 };
347 
348 template <typename DirectionsTag, typename Tag, typename = cpp17::void_t<>>
349 struct GetBaseTagIfPresent {};
350 
351 template <typename DirectionsTag, typename Tag>
352 struct GetBaseTagIfPresent<DirectionsTag, Tag,
353  cpp17::void_t<typename Tag::base>>
354  : Interface<DirectionsTag, typename Tag::base> {
355  static_assert(cpp17::is_base_of_v<typename Tag::base, Tag>,
356  "Tag `base` alias must be a base class of `Tag`.");
357 };
358 } // namespace Interface_detail
359 
360 /// \ingroup DataBoxTagsGroup
361 /// \ingroup ComputationalDomainGroup
362 /// ::Direction to an interface
363 template<size_t VolumeDim>
365  static std::string name() noexcept { return "Direction"; }
366  using type = ::Direction<VolumeDim>;
367 };
368 
369 /// \ingroup DataBoxTagsGroup
370 /// \ingroup ComputationalDomainGroup
371 /// Computes the `VolumeDim-1` dimensional mesh on an interface from the volume
372 /// mesh. `Tags::InterfaceComputeItem<Dirs, InterfaceMesh<VolumeDim>>` is
373 /// retrievable as Tags::Interface<Dirs, Mesh<VolumeDim>>` from the DataBox.
374 template<size_t VolumeDim>
375 struct InterfaceMesh : db::ComputeTag, Tags::Mesh<VolumeDim - 1> {
376  static constexpr auto function(
377  const ::Direction<VolumeDim> &direction,
378  const ::Mesh<VolumeDim> &volume_mesh) noexcept {
379  return volume_mesh.slice_away(direction.dimension());
380  }
381  using base = Tags::Mesh<VolumeDim - 1>;
382  using argument_tags = tmpl::list<Direction<VolumeDim>, Mesh<VolumeDim>>;
383  using volume_tags = tmpl::list<Mesh<VolumeDim>>;
384 };
385 
386 /// \ingroup DataBoxTagsGroup
387 /// \ingroup ComputationDomainGroup
388 /// Computes the coordinates in the frame `Frame` on the faces defined by
389 /// `Direction`. Intended to be prefixed by a `Tags::InterfaceComputeItem` to
390 /// define the directions on which to compute the coordinates.
391 template <size_t VolumeDim, typename Frame = ::Frame::Inertial>
393  Tags::Coordinates<VolumeDim, Frame> {
394  static constexpr auto function(
395  const ::Direction<VolumeDim> &direction,
396  const ::Mesh<VolumeDim - 1> &interface_mesh,
397  const ::ElementMap<VolumeDim, Frame> &map) noexcept {
398  return map(interface_logical_coordinates(interface_mesh, direction));
399  }
400  static std::string name() noexcept { return "BoundaryCoordinates"; }
402  using argument_tags = tmpl::list<Direction<VolumeDim>, Mesh<VolumeDim - 1>,
404  using volume_tags = tmpl::list<ElementMap<VolumeDim, Frame>>;
405 };
406 
407 // Virtual inheritance is used here to prevent a compiler warning: Derived class
408 // SimpleTag is inaccessible
409 template <typename DirectionsTag, typename Tag>
410 struct Interface : virtual db::SimpleTag,
411  Interface_detail::GetBaseTagIfPresent<DirectionsTag, Tag> {
412  static std::string name() noexcept {
413  return "Interface<" + DirectionsTag::name() + ", " + Tag::name() + ">";
414  };
415  using tag = Tag;
416  using type =
419 };
420 
421 /// \ingroup DataBoxTagsGroup
422 /// \ingroup ComputationalDomainGroup
423 /// \brief Derived tag for representing a compute item which acts on Tags on an
424 /// interface. Can be retrieved using Tags::Interface<DirectionsTag, Tag>
425 ///
426 /// The contained object will be a map from ::Direction to the item type of
427 /// `Tag`, with the set of directions being those produced by `DirectionsTag`.
428 /// `Tag::function` will be applied separately to the data on each interface. If
429 /// some of the compute item's inputs should be taken from the volume even when
430 /// applied on a slice, it may indicate them using `volume_tags`.
431 ///
432 /// If using the base tag mechanism for an interface tag is desired,
433 /// then `Tag` can have a `base` type alias pointing to its base
434 /// class. (This requirement is due to the lack of a way to determine
435 /// a type's base classes in C++.)
436 ///
437 /// \tparam DirectionsTag the item of Directions
438 /// \tparam Tag the tag labeling the item
439 template <typename DirectionsTag, typename Tag>
441  : Interface<DirectionsTag, Tag>,
443  virtual db::PrefixTag {
444  // Defining name here prevents an ambiguous function call when using base
445  // tags; Both Interface<Dirs, Tag> and Interface<Dirs, Tag::base> will have a
446  // name function and so cannot be disambiguated.
447  static std::string name() noexcept {
448  return "Interface<" + DirectionsTag::name() + ", " + Tag::name() + ">";
449  };
450  using tag = Tag;
451  using forwarded_argument_tags =
452  Interface_detail::interface_compute_item_argument_tags<DirectionsTag,
453  Tag>;
454  using argument_tags =
455  tmpl::push_front<forwarded_argument_tags, DirectionsTag>;
456 
457  using return_type = typename Interface_detail::evaluate_compute_item<
458  DirectionsTag, Tag, forwarded_argument_tags>::return_type;
459  static constexpr auto function =
460  Interface_detail::evaluate_compute_item<DirectionsTag, Tag,
461  forwarded_argument_tags>::apply;
462 };
463 
464 /// \ingroup DataBoxTagsGroup
465 /// \ingroup ComputationalDomainGroup
466 /// \brief Derived tag for representing a compute item which slices a Tag
467 /// containing a `Variables` from the volume to an interface. Retrievable from
468 /// the DataBox using `Tags::Interface<DirectionsTag, VarsTag>`
469 ///
470 /// The contained object will be a map from ::Direction to the item
471 /// type of `Tag`, with the set of directions being those produced by
472 /// `DirectionsTag`.
473 ///
474 /// \requires `Tag` correspond to a `Variables`
475 ///
476 /// \tparam DirectionsTag the item of Directions
477 /// \tparam VarsTag the tag labeling the item
478 template <typename DirectionsTag, typename VarsTag>
479 struct Slice : Interface<DirectionsTag, VarsTag>, db::ComputeTag {
480  static constexpr size_t volume_dim =
482 
483  using return_type =
485 
486  static constexpr void function(
487  const gsl::not_null<
488  std::unordered_map<::Direction<volume_dim>, db::item_type<VarsTag>>*>
489  sliced_vars,
490  const ::Mesh<volume_dim>& mesh,
492  const db::item_type<VarsTag>& variables) noexcept {
493  for (const auto& direction : directions) {
494  data_on_slice(make_not_null(&((*sliced_vars)[direction])), variables,
495  mesh.extents(), direction.dimension(),
496  index_to_slice_at(mesh.extents(), direction));
497  }
498  }
499  static std::string name() { return "Interface<" + VarsTag::name() + ">"; };
500  using argument_tags = tmpl::list<Mesh<volume_dim>, DirectionsTag, VarsTag>;
501  using volume_tags = tmpl::list<Mesh<volume_dim>, VarsTag>;
502 };
503 
504 /// \cond
505 template <typename DirectionsTag, size_t VolumeDim>
506 struct InterfaceComputeItem<DirectionsTag, Direction<VolumeDim>>
507  : db::PrefixTag,
509  Tags::Interface<DirectionsTag, Direction<VolumeDim>> {
510  static std::string name() noexcept { return "Interface"; }
511  using tag = Direction<VolumeDim>;
512  static constexpr auto function(
513  const std::unordered_set<::Direction<VolumeDim>>& directions) noexcept {
515  for (const auto& d : directions) {
516  result.emplace(d, d);
517  }
518  return result;
519  }
520  using argument_tags = tmpl::list<DirectionsTag>;
521 };
522 /// \endcond
523 } // namespace Tags
524 
525 namespace db {
526 namespace detail {
527 template <typename TagList, typename DirectionsTag, typename VariablesTag>
528 struct InterfaceSubitemsImpl {
529  using type = tmpl::transform<
530  typename item_type<VariablesTag>::tags_list,
531  tmpl::bind<Tags::Interface, tmpl::pin<DirectionsTag>, tmpl::_1>>;
532 
534 
535  template <typename Subtag>
536  static void create_item(
537  const gsl::not_null<item_type<tag>*> parent_value,
538  const gsl::not_null<item_type<Subtag>*> sub_value) noexcept {
539  sub_value->clear();
540  for (auto& direction_vars : *parent_value) {
541  const auto& direction = direction_vars.first;
542  auto& parent_vars = get<typename Subtag::tag>(direction_vars.second);
543  auto& sub_var = (*sub_value)[direction];
544  for (auto vars_it = parent_vars.begin(), sub_var_it = sub_var.begin();
545  vars_it != parent_vars.end(); ++vars_it, ++sub_var_it) {
546  sub_var_it->set_data_ref(&*vars_it);
547  }
548  }
549  }
550 
551  // The `return_type` can be anything for Subitems because the DataBox figures
552  // out the correct return type, we just use the `return_type` type alias to
553  // signal to the DataBox we want mutating behavior.
554  using return_type = NoSuchType;
555 
556  template <typename Subtag>
557  static void create_compute_item(
558  const gsl::not_null<item_type<Subtag>*> sub_value,
559  const item_type<tag>& parent_value) noexcept {
560  for (const auto& direction_vars : parent_value) {
561  const auto& direction = direction_vars.first;
562  const auto& parent_vars =
563  get<typename Subtag::tag>(direction_vars.second);
564  auto& sub_var = (*sub_value)[direction];
565  auto sub_var_it = sub_var.begin();
566  for (auto vars_it = parent_vars.begin();
567  vars_it != parent_vars.end(); ++vars_it, ++sub_var_it) {
568  // clang-tidy: do not use const_cast
569  // The DataBox will only give out a const reference to the
570  // result of a compute item. Here, that is a reference to a
571  // const map to Tensors of DataVectors. There is no (publicly
572  // visible) indirection there, so having the map const will
573  // allow only allow const access to the contained DataVectors,
574  // so no modification through the pointer cast here is
575  // possible.
576  sub_var_it->set_data_ref(const_cast<DataVector*>(&*vars_it)); // NOLINT
577  }
578  }
579  }
580 };
581 } // namespace detail
582 
583 template <typename TagList, typename DirectionsTag, typename VariablesTag>
584 struct Subitems<
585  TagList, Tags::Interface<DirectionsTag, VariablesTag>,
586  Requires<tt::is_a_v<Variables, item_type<VariablesTag, TagList>>>>
587  : detail::InterfaceSubitemsImpl<TagList, DirectionsTag, VariablesTag> {
588 };
589 template <typename TagList, typename DirectionsTag, typename VariablesTag>
590 struct Subitems<
591  TagList, Tags::InterfaceComputeItem<DirectionsTag, VariablesTag>,
592  Requires<tt::is_a_v<Variables, item_type<VariablesTag, TagList>>>>
593  : detail::InterfaceSubitemsImpl<TagList, DirectionsTag, VariablesTag> {};
594 
595 template <typename TagList, typename DirectionsTag, typename VariablesTag>
596 struct Subitems<
597  TagList, Tags::Slice<DirectionsTag, VariablesTag>,
598  Requires<tt::is_a_v<Variables, item_type<VariablesTag, TagList>>>>
599 : detail::InterfaceSubitemsImpl<TagList, DirectionsTag, VariablesTag> {};
600 } // namespace db
Defines class template Direction.
size_t index_to_slice_at(const Index< Dim > &extents, const Direction< Dim > &direction) noexcept
Finds the index in the perpendicular dimension of an element boundary.
Definition: IndexToSliceAt.hpp:15
The set of directions to neighboring Elements.
Definition: Tags.hpp:145
void void_t
Given a set of types, returns void
Definition: TypeTraits.hpp:214
Definition: Digraph.hpp:11
Base tag for boundary data needed for updating the variables.
Definition: Tags.hpp:139
Direction to an interface
Definition: Tags.hpp:364
Marks a DataBoxTag as being a compute item that executes a function.
Definition: DataBoxTag.hpp:155
Computes the coordinates in the frame Frame on the faces defined by Direction. Intended to be prefixe...
Definition: Tags.hpp:392
Defines classes and functions for making classes creatable from input files.
Tags for the DataBox inherit from this type.
Definition: DataBoxTag.hpp:65
The set of directions which correspond to external boundaries. Used for representing data on the inte...
Definition: Tags.hpp:163
Defines the type alias Requires.
constexpr auto apply(F &&f, const DataBox< BoxTags > &box, Args &&... args)
Apply the function f with argument Tags TagsList from DataBox box
Definition: DataBox.hpp:1595
std::string get_output(const T &t) noexcept
Get the streamed output of t as a std::string
Definition: GetOutput.hpp:14
Computes the VolumeDim-1 dimensional mesh on an interface from the volume mesh. Tags::InterfaceComput...
Definition: Tags.hpp:375
Defines class template Index.
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:27
Definition: Determinant.hpp:11
Used to mark "no type" or "bad state" for metaprogramming.
Definition: NoSuchType.hpp:10
Defines functions logical_coordinates and interface_logical_coordinates.
Derived tag for representing a compute item which acts on Tags on an interface. Can be retrieved usin...
Definition: Tags.hpp:440
Computes the inverse Jacobian of the map held by MapTag at the coordinates held by SourceCoordsTag...
Definition: Tags.hpp:125
Definition: Strahlkorper.hpp:167
Indicates the Frame that a TensorIndexType is in.
Definition: IndexType.hpp:36
Struct that can be specialized to allow DataBox items to have subitems. Specializations must define: ...
Definition: DataBoxTag.hpp:648
Derived tag for representing a compute item which slices a Tag containing a Variables from the volume...
Definition: Tags.hpp:479
Definition: DataBoxTag.hpp:29
Defines the class template Mesh.
Defines a list of useful type aliases for tensors.
The coordinates in a given frame.
Definition: Tags.hpp:95
The Element associated with the DataBox.
Definition: Tags.hpp:64
Namespace for DataBox related things.
Definition: DataBox.hpp:33
Variables< tmpl::list< TagsToSlice... > > data_on_slice(const db::DataBox< TagsList > &box, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index, tmpl::list< TagsToSlice... >) noexcept
Slices volume Tensors from a DataBox into a Variables
Definition: DataOnSlice.hpp:33
The Domain.
Definition: Tags.hpp:55
Stores a collection of function values.
Definition: DataVector.hpp:46
tnsr::I< DataVector, VolumeDim, Frame::Logical > interface_logical_coordinates(const Mesh< VolumeDim - 1 > &mesh, const Direction< VolumeDim > &direction) noexcept
Compute the logical coordinates on a face of an Element.
Definition: LogicalCoordinates.cpp:36
Wraps the template metaprogramming library used (brigand)
The coordinates in the target frame of MapTag. The SourceCoordsTag&#39;s frame must be the source frame o...
Definition: Tags.hpp:107
The computational grid of the Element in the DataBox.
Definition: Tags.hpp:75
typename DataBox_detail::item_type_impl< TagList, Tag >::type item_type
Get the type that is returned by the Tag. If it is a base tag then a TagList must be passed as a seco...
Definition: DataBoxTag.hpp:410
Defines functions and classes from the GSL.
gsl::not_null< T * > make_not_null(T *ptr) noexcept
Construct a not_null from a pointer. Often this will be done as an implicit conversion, but it may be necessary to perform the conversion explicitly when type deduction is desired.
Definition: Gsl.hpp:863
Marks an item as being a prefix to another tag.
Definition: DataBoxTag.hpp:112
typename Requires_detail::requires_impl< B >::template_error_type_failed_to_meet_requirements_on_template_parameters Requires
Express requirements on the template parameters of a function or class, replaces std::enable_if_t ...
Definition: Requires.hpp:67
C++ STL code present in C++17.
Definition: Array.hpp:16
Tags that are base tags, i.e. a simple or compute tag must derive off them for them to be useful...
Definition: DataBoxTag.hpp:83
Defines helper functions for use with Variables class.
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Defines type traits, some of which are future STL type_traits header.
The set of directions which correspond to external boundaries. To be used to represent data which exi...
Definition: Tags.hpp:177
Tag which is either a SimpleTag for quantities on an interface, base tag to a compute item which acts...
Definition: Tags.hpp:217
The coordinate map from logical to grid coordinate.
Definition: Tags.hpp:84
The input file tag for the DomainCreator to use.
Definition: Tags.hpp:44
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12
Defines class DomainCreator.
Defines class Element.
Defines enum class Side.