InitializeInterpolator.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <tuple>
8 
11 #include "Domain/Tags.hpp" // IWYU pragma: keep
12 #include "Utilities/Literals.hpp"
13 #include "Utilities/TMPL.hpp"
15 
16 /// \cond
17 // IWYU pragma: no_forward_declare db::DataBox
18 namespace Parallel {
19 template <typename Metavariables>
20 class ConstGlobalCache;
21 } // namespace Parallel
22 namespace intrp {
23 namespace Tags {
24 struct NumberOfElements;
25 template <typename Metavariables>
26 struct InterpolatedVarsHolders;
27 template <typename Metavariables>
28 struct VolumeVarsInfo;
29 } // namespace Tags
30 } // namespace intrp
31 /// \endcond
32 
33 namespace intrp {
34 namespace Actions {
35 
36 /// \ingroup ActionsGroup
37 /// \brief Initializes an Interpolator
38 ///
39 /// Uses: nothing
40 ///
41 /// DataBox changes:
42 /// - Adds:
43 /// - `Tags::NumberOfElements`
44 /// - `Tags::VolumeVarsInfo<Metavariables>`
45 /// - `Tags::InterpolatedVarsHolders<Metavariables>`
46 /// - Removes: nothing
47 /// - Modifies: nothing
49  template <typename Metavariables>
50  using return_tag_list =
51  tmpl::list<Tags::NumberOfElements,
54  template <typename... InboxTags, typename Metavariables, typename ArrayIndex,
55  typename ActionList, typename ParallelComponent>
56  static auto apply(const db::DataBox<tmpl::list<>>& /*box*/,
57  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
59  const ArrayIndex& /*array_index*/,
60  const ActionList /*meta*/,
61  const ParallelComponent* const /*meta*/) noexcept {
62  return std::make_tuple(
63  db::create<db::get_items<return_tag_list<Metavariables>>>(
64  0_st,
65  db::item_type<Tags::VolumeVarsInfo<Metavariables>>{},
67  Tags::InterpolatedVarsHolders<Metavariables>>{}));
68  }
69 };
70 
71 } // namespace Actions
72 } // namespace intrp
Initializes an Interpolator.
Definition: InitializeInterpolator.hpp:48
Defines class tuples::TaggedTuple.
Definition: AddTemporalIdsToInterpolationTarget.hpp:17
Volume variables at all temporal_ids for all local Elements.
Definition: Tags.hpp:45
constexpr auto create(Args &&... args)
Create a new DataBox.
Definition: DataBox.hpp:1259
TaggedTuple containing all local Vars::Holders for all InterpolationTargets.
Definition: Tags.hpp:70
Contains functions that forward to Charm++ parallel functions.
Definition: Abort.hpp:13
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
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Defines classes and functions used for manipulating DataBox&#39;s.
Defines useful literals.
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
Definition: DataBoxTag.hpp:29
A Charm++ chare that caches constant data once per Charm++ node.
Definition: ConstGlobalCache.hpp:76
Number of local Elements.
Definition: Tags.hpp:78
tmpl::filter< TagList, tmpl::not_< tmpl::bind< db::is_compute_item, tmpl::_1 > >> get_items
Get all the Tags that are items from the TagList
Definition: DataBox.hpp:1807
Wraps the template metaprogramming library used (brigand)
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 tags related to domain quantities.
Definition: SolvePoissonProblem.hpp:38
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Definition: ComputeTimeDerivative.hpp:28