InterpolationTargetSendPoints.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
8 #include "Evolution/DiscontinuousGalerkin/DgElementArray.hpp"
9 #include "NumericalAlgorithms/Interpolation/Actions/ElementReceiveInterpPoints.hpp"
10 #include "NumericalAlgorithms/Interpolation/InterpolationTargetDetail.hpp"
11 #include "Parallel/GlobalCache.hpp"
12 #include "Parallel/Invoke.hpp"
13 #include "Utilities/TMPL.hpp"
14 #include "Utilities/TaggedTuple.hpp"
15 
16 namespace intrp {
17 namespace Actions {
18 
19 /// \ingroup ActionsGroup
20 /// \brief Sends interpolation points to all the Elements.
21 ///
22 /// This action is for the case in which the points are time-independent.
23 ///
24 /// This action should be placed in the Registration PDAL for
25 /// InterpolationTarget.
26 ///
27 /// Uses:
28 /// - DataBox:
29 /// - Anything that the particular
30 /// InterpolationTargetTag::compute_target_points needs from the DataBox.
31 ///
32 /// DataBox changes:
33 /// - Adds: nothing
34 /// - Removes: nothing
35 /// - Modifies: nothing
36 template <typename InterpolationTargetTag>
38  template <typename DbTags, typename... InboxTags, typename ArrayIndex,
39  typename ActionList, typename Metavariables,
40  typename ParallelComponent>
41  static std::tuple<db::DataBox<DbTags>&&> apply(
43  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
45  const ArrayIndex& /*array_index*/, const ActionList /*meta*/,
46  const ParallelComponent* const /*meta*/) noexcept {
47  auto coords = InterpolationTarget_detail::block_logical_coords<
48  InterpolationTargetTag>(box, tmpl::type_<Metavariables>{});
49  auto& receiver_proxy = Parallel::get_parallel_component<
50  typename InterpolationTargetTag::interpolating_component>(cache);
51  Parallel::simple_action<ElementReceiveInterpPoints<InterpolationTargetTag>>(
52  receiver_proxy, std::move(coords));
53  return std::forward_as_tuple(std::move(box));
54  }
55 };
56 } // namespace Actions
57 } // namespace intrp
DataBoxTag.hpp
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:16
GlobalCache.hpp
Parallel::get_parallel_component
auto get_parallel_component(GlobalCache< Metavariables > &cache) noexcept -> Parallel::proxy_from_parallel_component< GlobalCache_detail::get_component_if_mocked< typename Metavariables::component_list, ParallelComponentTag >> &
Access the Charm++ proxy associated with a ParallelComponent.
Definition: GlobalCache.hpp:223
std::tuple
DataBox.hpp
tuples::TaggedTuple
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
intrp::Actions::InterpolationTargetSendTimeIndepPointsToElements
Sends interpolation points to all the Elements.
Definition: InterpolationTargetSendPoints.hpp:37
db::DataBox
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
TMPL.hpp