Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include "DataStructures/DataBox/DataBox.hpp"
7 : #include "DataStructures/IdPair.hpp"
8 : #include "Domain/BlockLogicalCoordinates.hpp"
9 : #include "ParallelAlgorithms/Interpolation/PointInfoTag.hpp"
10 : #include "Utilities/Gsl.hpp"
11 : #include "Utilities/Requires.hpp"
12 :
13 : namespace Parallel {
14 : template <typename Metavariables>
15 : class GlobalCache;
16 : } // namespace Parallel
17 :
18 : namespace intrp::Actions {
19 :
20 : /// \ingroup ActionsGroup
21 : /// \brief Receives interpolation points from an InterpolationTarget.
22 : ///
23 : /// Uses: nothing
24 : ///
25 : /// DataBox changes:
26 : /// - Adds: nothing
27 : /// - Removes: nothing
28 : /// - Modifies:
29 : /// - `intrp::Tags::PointInfo`
30 : template <typename InterpolationTargetTag>
31 1 : struct ElementReceiveInterpPoints {
32 : template <typename ParallelComponent, typename DbTags, typename Metavariables,
33 : typename ArrayIndex, size_t Dim>
34 0 : static void apply(
35 : db::DataBox<DbTags>& box,
36 : const Parallel::GlobalCache<Metavariables>& /*cache*/,
37 : const ArrayIndex& /*array_index*/,
38 : tnsr::I<DataVector, Dim,
39 : typename InterpolationTargetTag::compute_target_points::frame>&&
40 : coords) {
41 : db::mutate<
42 : intrp::Tags::PointInfo<InterpolationTargetTag, tmpl::size_t<Dim>>>(
43 : [&coords](
44 : const gsl::not_null<tnsr::I<
45 : DataVector, Dim,
46 : typename InterpolationTargetTag::compute_target_points::frame>*>
47 : point_infos) { (*point_infos) = std::move(coords); },
48 : make_not_null(&box));
49 : }
50 : };
51 : } // namespace intrp::Actions
|