Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstdint>
7 : #include <vector>
8 :
9 : #include "Evolution/Actions/RunEventsAndTriggers.hpp"
10 : #include "Evolution/DiscontinuousGalerkin/InboxTags.hpp"
11 : #include "Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp"
12 : #include "Options/Protocols/FactoryCreation.hpp"
13 : #include "Options/String.hpp"
14 : #include "Parallel/ArrayCollection/DgElementCollection.hpp"
15 : #include "Parallel/MemoryMonitor/MemoryMonitor.hpp"
16 : #include "Parallel/PhaseControl/PhaseControlTags.hpp"
17 : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
18 : #include "ParallelAlgorithms/Amr/Projectors/CopyFromCreatorOrLeaveAsIs.hpp"
19 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugeWave.hpp"
20 : #include "Time/Actions/SelfStartActions.hpp"
21 : #include "Time/ChangeSlabSize/Action.hpp"
22 : #include "Time/ChangeSlabSize/Tags.hpp"
23 : #include "Time/Tags/StepperErrors.hpp"
24 : #include "Utilities/ErrorHandling/Error.hpp"
25 : #include "Utilities/ProtocolHelpers.hpp"
26 :
27 : template <size_t VolumeDim, bool UseLts>
28 : struct EvolutionMetavars
29 : : public GeneralizedHarmonicTemplateBase<VolumeDim, UseLts> {
30 : static constexpr size_t volume_dim = VolumeDim;
31 0 : using gh_base = GeneralizedHarmonicTemplateBase<volume_dim, UseLts>;
32 0 : using typename gh_base::const_global_cache_tags;
33 0 : using typename gh_base::dg_registration_list;
34 0 : using initialization_actions =
35 : typename gh_base::template initialization_actions<EvolutionMetavars,
36 : false>;
37 0 : using typename gh_base::initialize_initial_data_dependent_quantities_actions;
38 0 : using typename gh_base::observed_reduction_data_tags;
39 0 : using typename gh_base::system;
40 : static constexpr bool local_time_stepping = gh_base::local_time_stepping;
41 : static constexpr bool use_dg_element_collection =
42 : gh_base::use_dg_element_collection;
43 :
44 0 : using step_actions = typename gh_base::template step_actions<tmpl::list<>>;
45 :
46 0 : using gh_dg_element_array = DgElementArray<
47 : EvolutionMetavars,
48 : tmpl::flatten<tmpl::list<
49 : Parallel::PhaseActions<Parallel::Phase::Initialization,
50 : initialization_actions>,
51 : Parallel::PhaseActions<
52 : Parallel::Phase::RegisterWithElementDataReader,
53 : tmpl::list<importers::Actions::RegisterWithElementDataReader,
54 : Parallel::Actions::TerminatePhase>>,
55 : Parallel::PhaseActions<
56 : Parallel::Phase::ImportInitialData,
57 : tmpl::list<
58 : gh::Actions::SetInitialData,
59 : tmpl::conditional_t<VolumeDim == 3,
60 : gh::Actions::ReceiveNumericInitialData,
61 : tmpl::list<>>,
62 : Parallel::Actions::TerminatePhase>>,
63 : Parallel::PhaseActions<
64 : Parallel::Phase::InitializeInitialDataDependentQuantities,
65 : initialize_initial_data_dependent_quantities_actions>,
66 : Parallel::PhaseActions<
67 : Parallel::Phase::InitializeTimeStepperHistory,
68 : SelfStart::self_start_procedure<step_actions, system>>,
69 : Parallel::PhaseActions<Parallel::Phase::Register,
70 : tmpl::list<dg_registration_list,
71 : Parallel::Actions::TerminatePhase>>,
72 : Parallel::PhaseActions<Parallel::Phase::CheckDomain,
73 : tmpl::list<::amr::Actions::SendAmrDiagnostics,
74 : Parallel::Actions::TerminatePhase>>,
75 : Parallel::PhaseActions<
76 : Parallel::Phase::Evolve,
77 : tmpl::list<::evolution::Actions::RunEventsAndTriggers<
78 : local_time_stepping>,
79 : Actions::ChangeSlabSize, step_actions,
80 : Actions::AdvanceTime,
81 : PhaseControl::Actions::ExecutePhaseChange>>>>>;
82 :
83 : struct amr : tt::ConformsTo<::amr::protocols::AmrMetavariables> {
84 0 : using element_array = gh_dg_element_array;
85 :
86 0 : using projectors = tmpl::list<
87 : Initialization::ProjectTimeStepping<volume_dim>,
88 : evolution::dg::Initialization::ProjectDomain<volume_dim>,
89 : Initialization::ProjectTimeStepperHistory<EvolutionMetavars>,
90 : ::amr::projectors::ProjectVariables<volume_dim,
91 : typename system::variables_tag>,
92 : evolution::dg::Initialization::ProjectMortars<EvolutionMetavars>,
93 : evolution::Actions::ProjectRunEventsAndDenseTriggers,
94 : ::amr::projectors::DefaultInitialize<
95 : Initialization::Tags::InitialTimeDelta,
96 : Initialization::Tags::InitialSlabSize<local_time_stepping>,
97 : ::domain::Tags::InitialExtents<volume_dim>,
98 : ::domain::Tags::InitialRefinementLevels<volume_dim>,
99 : evolution::dg::Tags::Quadrature,
100 : Tags::StepperErrors<typename system::variables_tag>,
101 : SelfStart::Tags::InitialValue<typename system::variables_tag>,
102 : SelfStart::Tags::InitialValue<Tags::TimeStep>,
103 : SelfStart::Tags::InitialValue<Tags::Next<Tags::TimeStep>>,
104 : evolution::dg::Tags::BoundaryData<volume_dim>>,
105 : ::amr::projectors::CopyFromCreatorOrLeaveAsIs<
106 : Tags::ChangeSlabSize::NumberOfExpectedMessages,
107 : Tags::ChangeSlabSize::NewSlabSize>>;
108 : };
109 :
110 : struct registration
111 : : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
112 0 : using element_registrars =
113 : tmpl::map<tmpl::pair<gh_dg_element_array, dg_registration_list>>;
114 : };
115 :
116 0 : using component_list =
117 : tmpl::flatten<tmpl::list<::amr::Component<EvolutionMetavars>,
118 : observers::Observer<EvolutionMetavars>,
119 : observers::ObserverWriter<EvolutionMetavars>,
120 : mem_monitor::MemoryMonitor<EvolutionMetavars>,
121 : importers::ElementDataReader<EvolutionMetavars>,
122 : gh_dg_element_array>>;
123 :
124 : static constexpr Options::String help{
125 : "Evolve the Einstein field equations using the Generalized Harmonic "
126 : "formulation\n"};
127 : };
|