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 <string> 8 : 9 : #include "ControlSystem/Measurements/NonFactoryCreatable.hpp" 10 : #include "ControlSystem/Protocols/Measurement.hpp" 11 : #include "ControlSystem/Protocols/Submeasurement.hpp" 12 : #include "ControlSystem/RunCallbacks.hpp" 13 : #include "DataStructures/Tensor/IndexType.hpp" 14 : #include "Domain/Structure/ObjectLabel.hpp" 15 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/FailedHorizonFind.hpp" 16 : #include "ParallelAlgorithms/ApparentHorizonFinder/Destination.hpp" 17 : #include "ParallelAlgorithms/ApparentHorizonFinder/Events/FindApparentHorizon.hpp" 18 : #include "ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp" 19 : #include "ParallelAlgorithms/ApparentHorizonFinder/Protocols/HorizonMetavars.hpp" 20 : #include "ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp" 21 : #include "Time/Tags/TimeAndPrevious.hpp" 22 : #include "Utilities/ProtocolHelpers.hpp" 23 : #include "Utilities/TMPL.hpp" 24 : 25 : /// \cond 26 : class DataVector; 27 : template <size_t VolumeDim> 28 : class ElementId; 29 : template <size_t Dim> 30 : class Mesh; 31 : namespace Parallel { 32 : template <typename Metavariables> 33 : class GlobalCache; 34 : } // namespace Parallel 35 : namespace domain::Tags { 36 : template <size_t Dim> 37 : struct Mesh; 38 : } // namespace domain::Tags 39 : /// \endcond 40 : 41 : namespace control_system::measurements { 42 : /*! 43 : * \brief A `control_system::protocols::Measurement` that relies on only one 44 : * apparent horizon; the template parameter `Horizon`. 45 : */ 46 : template <::domain::ObjectLabel Horizon> 47 1 : struct SingleHorizon : tt::ConformsTo<protocols::Measurement> { 48 0 : static std::string name() { 49 : return "SingleHorizon" + ::domain::name(Horizon); 50 : } 51 : 52 : /*! 53 : * \brief A `control_system::protocols::Submeasurement` that starts the 54 : * interpolation to the interpolation target in order to find the apparent 55 : * horizon. 56 : */ 57 1 : struct Submeasurement : tt::ConformsTo<protocols::Submeasurement> { 58 0 : static std::string name() { return SingleHorizon::name(); } 59 : 60 : private: 61 : template <typename ControlSystems> 62 0 : struct HorizonMetavars : tt::ConformsTo<ah::protocols::HorizonMetavars> { 63 0 : static std::string name() { 64 : return "ControlSystemSingleAh" + ::domain::name(Horizon); 65 : } 66 : 67 0 : using time_tag = ::Tags::TimeAndPrevious<0>; 68 : 69 0 : using frame = ::Frame::Distorted; 70 : 71 0 : using horizon_find_callbacks = tmpl::list< 72 : control_system::RunCallbacks<Submeasurement, ControlSystems>>; 73 0 : using horizon_find_failure_callbacks = 74 : tmpl::list<ah::callbacks::FailedHorizonFind<HorizonMetavars, false>>; 75 : 76 0 : using compute_tags_on_element = 77 : tmpl::list<::Tags::TimeAndPreviousCompute<0>>; 78 : 79 0 : static constexpr ah::Destination destination = 80 : ah::Destination::ControlSystem; 81 : }; 82 : 83 : public: 84 : template <typename ControlSystems> 85 0 : using interpolation_target_tag = void; 86 : template <typename ControlSystems> 87 0 : using horizon_metavars = HorizonMetavars<ControlSystems>; 88 : 89 : template <typename ControlSystems> 90 0 : using event = NonFactoryCreatableWrapper< 91 : ah::Events::FindApparentHorizon<HorizonMetavars<ControlSystems>>>; 92 : }; 93 : 94 0 : using submeasurements = tmpl::list<Submeasurement>; 95 : }; 96 : } // namespace control_system::measurements