Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <vector> 7 : 8 : #include "Evolution/Executables/GrMhd/GhValenciaDivClean/GhValenciaDivCleanBase.hpp" 9 : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" 10 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/TimeDerivativeTerms.hpp" 11 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" 12 : #include "Evolution/VariableFixing/Tags.hpp" 13 : #include "NumericalAlgorithms/Strahlkorper/IO/InitialShapeFromFile.hpp" 14 : #include "NumericalAlgorithms/Strahlkorper/InitialShape.hpp" 15 : #include "Options/FactoryHelpers.hpp" 16 : #include "Options/Protocols/FactoryCreation.hpp" 17 : #include "Options/String.hpp" 18 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/FailedHorizonFind.hpp" 19 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/ObserveFieldsOnHorizon.hpp" 20 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/ObserveTimeSeriesOnHorizon.hpp" 21 : #include "ParallelAlgorithms/ApparentHorizonFinder/Component.hpp" 22 : #include "ParallelAlgorithms/ApparentHorizonFinder/Criteria/Criterion.hpp" 23 : #include "ParallelAlgorithms/ApparentHorizonFinder/Criteria/Factory.hpp" 24 : #include "ParallelAlgorithms/ApparentHorizonFinder/Events/FindApparentHorizon.hpp" 25 : #include "ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp" 26 : #include "ParallelAlgorithms/ApparentHorizonFinder/KerrSchild.hpp" 27 : #include "ParallelAlgorithms/ApparentHorizonFinder/Protocols/HorizonMetavars.hpp" 28 : #include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp" 29 : #include "PointwiseFunctions/Hydro/EquationsOfState/Factory.hpp" 30 : #include "Time/Tags/Time.hpp" 31 : #include "Utilities/ErrorHandling/Error.hpp" 32 : #include "Utilities/ProtocolHelpers.hpp" 33 : #include "Utilities/TMPL.hpp" 34 : 35 : template <bool UseControlSystems, bool UseParametrizedDeleptonization, 36 : typename... InterpolationTargetTags> 37 : struct EvolutionMetavars 38 : : public GhValenciaDivCleanTemplateBase< 39 : EvolutionMetavars<UseControlSystems, UseParametrizedDeleptonization, 40 : InterpolationTargetTags...>, 41 : false, false, UseParametrizedDeleptonization> { 42 : static_assert(not UseControlSystems, 43 : "GhValenciaWithHorizon doesn't support control systems yet."); 44 : static constexpr bool use_dg_subcell = false; 45 : 46 0 : using defaults = GhValenciaDivCleanDefaults<use_dg_subcell>; 47 0 : using base = GhValenciaDivCleanTemplateBase<EvolutionMetavars, use_dg_subcell, 48 : UseControlSystems, 49 : UseParametrizedDeleptonization>; 50 : static constexpr size_t volume_dim = defaults::volume_dim; 51 0 : using domain_frame = typename defaults::domain_frame; 52 : static constexpr bool use_damped_harmonic_rollon = 53 : defaults::use_damped_harmonic_rollon; 54 0 : using temporal_id = typename defaults::temporal_id; 55 : static constexpr bool local_time_stepping = defaults::local_time_stepping; 56 0 : using system = typename defaults::system; 57 0 : using analytic_variables_tags = typename defaults::analytic_variables_tags; 58 0 : using analytic_solution_fields = typename defaults::analytic_solution_fields; 59 0 : using ordered_list_of_primitive_recovery_schemes = 60 : typename defaults::ordered_list_of_primitive_recovery_schemes; 61 0 : using initialize_initial_data_dependent_quantities_actions = 62 : typename defaults::initialize_initial_data_dependent_quantities_actions; 63 : 64 : static constexpr Options::String help{ 65 : "Evolve the Valencia formulation of the GRMHD system with divergence " 66 : "cleaning, coupled to a dynamic spacetime evolved with the Generalized " 67 : "Harmonic formulation\n" 68 : "on a domain with a single horizon and corresponding excised region"}; 69 : 70 0 : struct AhA : tt::ConformsTo<ah::protocols::HorizonMetavars> { 71 0 : using time_tag = ah::Tags::ObservationTime<0>; 72 : 73 0 : using frame = domain_frame; 74 : 75 0 : using horizon_find_callbacks = 76 : tmpl::list<ah::callbacks::ObserveTimeSeriesOnHorizon< 77 : ::ah::tags_for_observing<domain_frame>, AhA>>; 78 0 : using horizon_find_failure_callbacks = 79 : tmpl::list<ah::callbacks::FailedHorizonFind<AhA, false>>; 80 : 81 0 : using compute_tags_on_element = 82 : tmpl::list<ah::Tags::ObservationTimeCompute<0>>; 83 : 84 0 : static constexpr ah::Destination destination = ah::Destination::Observation; 85 : 86 0 : static std::string name() { return "AhA"; } 87 : }; 88 : 89 0 : using interpolation_target_tags = tmpl::list<InterpolationTargetTags...>; 90 : 91 0 : using observe_fields = typename base::observe_fields; 92 : 93 : struct factory_creation 94 : : tt::ConformsTo<Options::protocols::FactoryCreation> { 95 0 : using factory_classes = Options::add_factory_classes< 96 : typename base::factory_creation::factory_classes, 97 : tmpl::pair<Event, tmpl::list<ah::Events::FindApparentHorizon<AhA>>>, 98 : tmpl::pair<ah::Criterion, ah::Criteria::standard_criteria>, 99 : tmpl::pair<ylm::InitialShape<domain_frame>, 100 : tmpl::list<ylm::InitialShapes::Sphere<domain_frame>, 101 : ylm::InitialShapes::FromFile<domain_frame>, 102 : ah::InitialShapes::KerrSchild<domain_frame>>>>; 103 : }; 104 : 105 0 : using initial_data_tag = typename base::initial_data_tag; 106 : 107 0 : using const_global_cache_tags = tmpl::flatten<tmpl::list< 108 : grmhd::ValenciaDivClean::Tags::PrimitiveFromConservativeOptions, 109 : gh::gauges::Tags::GaugeCondition, initial_data_tag, 110 : grmhd::ValenciaDivClean::Tags::ConstraintDampingParameter, 111 : typename base::equation_of_state_tag, 112 : gh::Tags::DampingFunctionGamma0<volume_dim, Frame::Grid>, 113 : gh::Tags::DampingFunctionGamma1<volume_dim, Frame::Grid>, 114 : gh::Tags::DampingFunctionGamma2<volume_dim, Frame::Grid>, 115 : ah::Tags::LMax>>; 116 : 117 0 : using observed_reduction_data_tags = observers::collect_reduction_data_tags< 118 : tmpl::at<typename factory_creation::factory_classes, Event>>; 119 : 120 0 : using registration = typename base::registration; 121 : 122 0 : using component_list = tmpl::push_back<typename base::component_list, 123 : ah::Component<EvolutionMetavars, AhA>>; 124 : };