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 { 19 : namespace Actions { 20 : 21 : /// \ingroup ActionsGroup 22 : /// \brief Receives interpolation points from an InterpolationTarget. 23 : /// 24 : /// Uses: nothing 25 : /// 26 : /// DataBox changes: 27 : /// - Adds: nothing 28 : /// - Removes: nothing 29 : /// - Modifies: 30 : /// - `intrp::Tags::InterpPointInfo<Metavariables>` 31 : template <typename InterpolationTargetTag> 32 1 : struct ElementReceiveInterpPoints { 33 : template <typename ParallelComponent, typename DbTags, typename Metavariables, 34 : typename ArrayIndex> 35 0 : static void apply( 36 : db::DataBox<DbTags>& box, 37 : const Parallel::GlobalCache<Metavariables>& /*cache*/, 38 : const ArrayIndex& /*array_index*/, 39 : tnsr::I<DataVector, Metavariables::volume_dim, 40 : typename InterpolationTargetTag::compute_target_points::frame>&& 41 : coords) { 42 : db::mutate<intrp::Tags::InterpPointInfo<Metavariables>>( 43 : [&coords](const gsl::not_null< 44 : typename intrp::Tags::InterpPointInfo<Metavariables>::type*> 45 : point_infos) { 46 : get<intrp::Vars::PointInfoTag<InterpolationTargetTag, 47 : Metavariables::volume_dim>>( 48 : *point_infos) = std::move(coords); 49 : }, 50 : make_not_null(&box)); 51 : } 52 : }; 53 : } // namespace Actions 54 : } // namespace intrp