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