Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <optional> 8 : 9 : #include "DataStructures/DataBox/DataBox.hpp" 10 : #include "DataStructures/DataBox/ObservationBox.hpp" 11 : #include "Domain/Tags.hpp" 12 : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" 13 : #include "Parallel/AlgorithmExecution.hpp" 14 : #include "Parallel/GlobalCache.hpp" 15 : #include "Parallel/Invoke.hpp" 16 : #include "ParallelAlgorithms/Events/Tags.hpp" 17 : #include "ParallelAlgorithms/Interpolation/Events/InterpolateWithoutInterpComponent.hpp" 18 : #include "Utilities/Gsl.hpp" 19 : #include "Utilities/TMPL.hpp" 20 : 21 : /// \cond 22 : namespace tuples { 23 : template <typename... Tags> 24 : class TaggedTuple; 25 : } // namespace tuples 26 : /// \endcond 27 : 28 : namespace Cce { 29 : namespace Actions { 30 : /// \ingroup ActionsGroup 31 : /// \brief Interpolates and sends points to the `CceWorldtubeTarget` 32 : /// 33 : /// This is invoked on DgElementArray for the GH system. 34 : /// This action should appear only in the self-start action list, and 35 : /// is an unfortunate hack needed by the contradictory constraints 36 : /// of a locally-stepped CCE system and the events and dense triggers 37 : /// during the self start procedure. 38 : template <typename CceWorltubeTargetTag> 39 1 : struct SendGhVarsToCce { 40 : template <typename DbTags, typename Metavariables, typename... InboxTags, 41 : typename ArrayIndex, typename ActionList, 42 : typename ParallelComponent> 43 0 : static Parallel::iterable_action_return_t apply( 44 : db::DataBox<DbTags>& box, 45 : const tuples::TaggedTuple<InboxTags...>& /*inboxes*/, 46 : Parallel::GlobalCache<Metavariables>& cache, 47 : const ArrayIndex& array_index, const ActionList /*meta*/, 48 : const ParallelComponent* const component) { 49 : // not used by interpolation 50 : const Event::ObservationValue observation_value{}; 51 : auto interpolate_event = intrp::Events::InterpolateWithoutInterpComponent< 52 : Metavariables::volume_dim, CceWorltubeTargetTag, 53 : typename CceWorltubeTargetTag::vars_to_interpolate_to_target>{}; 54 : ::apply(interpolate_event, 55 : make_observation_box<db::AddComputeTags< 56 : Events::Tags::ObserverMeshCompute<Metavariables::volume_dim>>>( 57 : make_not_null(&box)), 58 : cache, array_index, component, observation_value); 59 : return {Parallel::AlgorithmExecution::Continue, std::nullopt}; 60 : } 61 : }; 62 : } // namespace Actions 63 : } // namespace Cce