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/Executables/Cce/CharacteristicExtractBase.hpp"
11 : #include "Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp"
12 : #include "Evolution/Systems/Cce/Actions/SendGhVarsToCce.hpp"
13 : #include "Evolution/Systems/Cce/Callbacks/SendGhWorldtubeData.hpp"
14 : #include "Evolution/Systems/Cce/Components/CharacteristicEvolution.hpp"
15 : #include "Evolution/Systems/Cce/Components/WorldtubeBoundary.hpp"
16 : #include "Evolution/Systems/Cce/Initialize/ConformalFactor.hpp"
17 : #include "Evolution/Systems/Cce/Initialize/InitializeJ.hpp"
18 : #include "Evolution/Systems/Cce/Initialize/InverseCubic.hpp"
19 : #include "Evolution/Systems/Cce/Initialize/NoIncomingRadiation.hpp"
20 : #include "Evolution/Systems/Cce/Initialize/RegisterInitializeJWithCharm.hpp"
21 : #include "Evolution/Systems/Cce/Initialize/ZeroNonSmooth.hpp"
22 : #include "Evolution/Systems/Cce/IntegrandInputSteps.hpp"
23 : #include "Evolution/Systems/Cce/InterfaceManagers/GhInterfaceManager.hpp"
24 : #include "Evolution/Systems/Cce/InterfaceManagers/GhLocalTimeStepping.hpp"
25 : #include "Evolution/Systems/Cce/InterfaceManagers/GhLockstep.hpp"
26 : #include "Evolution/Systems/Cce/OptionTags.hpp"
27 : #include "Evolution/Systems/Cce/System.hpp"
28 : #include "Evolution/Systems/Cce/Tags.hpp"
29 : #include "Evolution/Systems/Cce/WorldtubeBufferUpdater.hpp"
30 : #include "Evolution/Systems/Cce/WorldtubeDataManager.hpp"
31 : #include "Evolution/Tags/Filter.hpp"
32 : #include "Options/FactoryHelpers.hpp"
33 : #include "Options/Protocols/FactoryCreation.hpp"
34 : #include "Options/String.hpp"
35 : #include "Parallel/MemoryMonitor/MemoryMonitor.hpp"
36 : #include "Parallel/PhaseControl/PhaseControlTags.hpp"
37 : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
38 : #include "ParallelAlgorithms/Interpolation/Actions/CleanUpInterpolator.hpp"
39 : #include "ParallelAlgorithms/Interpolation/Actions/ElementInitInterpPoints.hpp"
40 : #include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
41 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolationTargetReceiveVars.hpp"
42 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceivePoints.hpp"
43 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceiveVolumeData.hpp"
44 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorRegisterElement.hpp"
45 : #include "ParallelAlgorithms/Interpolation/Actions/TryToInterpolate.hpp"
46 : #include "ParallelAlgorithms/Interpolation/Events/Interpolate.hpp"
47 : #include "ParallelAlgorithms/Interpolation/Events/InterpolateWithoutInterpComponent.hpp"
48 : #include "ParallelAlgorithms/Interpolation/InterpolationTarget.hpp"
49 : #include "ParallelAlgorithms/Interpolation/Interpolator.hpp"
50 : #include "ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp"
51 : #include "ParallelAlgorithms/Interpolation/Targets/KerrHorizon.hpp"
52 : #include "ParallelAlgorithms/Interpolation/Targets/Sphere.hpp"
53 : #include "Time/ChangeSlabSize/Action.hpp"
54 : #include "Time/Tags/TimeStepId.hpp"
55 : #include "Utilities/ErrorHandling/Error.hpp"
56 : #include "Utilities/ProtocolHelpers.hpp"
57 :
58 : /// \cond
59 : namespace Frame {
60 :
61 : struct Inertial;
62 : } // namespace Frame
63 : namespace Parallel {
64 : template <typename Metavariables>
65 : class CProxy_GlobalCache;
66 : } // namespace Parallel
67 : /// \endcond
68 :
69 : template <bool EvolveCcm>
70 : struct EvolutionMetavars : public GeneralizedHarmonicTemplateBase<3, false>,
71 : public CharacteristicExtractDefaults<EvolveCcm> {
72 : static constexpr size_t volume_dim = 3;
73 0 : using cce_base = CharacteristicExtractDefaults<EvolveCcm>;
74 0 : using gh_base = GeneralizedHarmonicTemplateBase<volume_dim, false>;
75 0 : using typename gh_base::initialize_initial_data_dependent_quantities_actions;
76 0 : using cce_boundary_component = Cce::GhWorldtubeBoundary<EvolutionMetavars>;
77 :
78 0 : using TimeStepperBase = typename gh_base::TimeStepperBase;
79 : static constexpr bool local_time_stepping = gh_base::local_time_stepping;
80 :
81 : template <bool DuringSelfStart>
82 : struct CceWorldtubeTarget;
83 :
84 0 : using interpolator_source_vars =
85 : tmpl::list<::gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
86 : ::gh::Tags::Phi<DataVector, volume_dim>,
87 : ::gh::Tags::Pi<DataVector, volume_dim>>;
88 :
89 0 : using dg_registration_list =
90 : tmpl::push_back<typename gh_base::dg_registration_list,
91 : intrp::Actions::RegisterElementWithInterpolator>;
92 :
93 0 : using typename gh_base::system;
94 :
95 0 : using dg_step_choosers = tmpl::flatten<tmpl::list<
96 : StepChoosers::standard_step_choosers<system>,
97 : StepChoosers::standard_slab_choosers<system, local_time_stepping>>>;
98 :
99 : template <bool DuringSelfStart>
100 0 : using step_actions = tmpl::list<
101 : tmpl::conditional_t<
102 : DuringSelfStart,
103 : Cce::Actions::SendGhVarsToCce<CceWorldtubeTarget<true>>,
104 : Cce::Actions::SendGhVarsToCce<CceWorldtubeTarget<false>>>,
105 : evolution::dg::Actions::ComputeTimeDerivative<
106 : volume_dim, system, dg_step_choosers, local_time_stepping>,
107 : tmpl::conditional_t<
108 : local_time_stepping,
109 : tmpl::list<evolution::Actions::RunEventsAndDenseTriggers<
110 : tmpl::list<evolution::dg::ApplyBoundaryCorrections<
111 : local_time_stepping, system, volume_dim, true>>>,
112 : evolution::dg::Actions::ApplyLtsBoundaryCorrections<
113 : system, volume_dim, false>>,
114 : tmpl::list<
115 : evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
116 : system, volume_dim, false>,
117 : Actions::RecordTimeStepperData<system>,
118 : evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<>>,
119 : Actions::UpdateU<system>,
120 : dg::Actions::Filter<
121 : Filters::Exponential<0>,
122 : tmpl::list<gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
123 : gh::Tags::Pi<DataVector, volume_dim>,
124 : gh::Tags::Phi<DataVector, volume_dim>>>>>>;
125 :
126 : using typename cce_base::cce_step_choosers;
127 : struct factory_creation
128 : : tt::ConformsTo<Options::protocols::FactoryCreation> {
129 0 : using factory_classes = Options::add_factory_classes<
130 : typename gh_base::factory_creation::factory_classes,
131 : tmpl::pair<StepChooser<StepChooserUse::LtsStep>, cce_step_choosers>>;
132 : };
133 :
134 : // initialization actions are the same as the default, with the single
135 : // addition of initializing the interpolation points (second-to-last action).
136 0 : using initialization_actions = tmpl::list<
137 : Initialization::Actions::InitializeItems<
138 : Initialization::TimeStepping<EvolutionMetavars, TimeStepperBase>,
139 : evolution::dg::Initialization::Domain<volume_dim>,
140 : Initialization::TimeStepperHistory<EvolutionMetavars>>,
141 : Initialization::Actions::NonconservativeSystem<system>,
142 : Initialization::Actions::AddComputeTags<::Tags::DerivCompute<
143 : typename system::variables_tag,
144 : domain::Tags::Mesh<volume_dim>,
145 : domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
146 : Frame::Inertial>,
147 : typename system::gradient_variables>>,
148 : gh::Actions::InitializeGhAnd3Plus1Variables<volume_dim>,
149 : Initialization::Actions::AddComputeTags<
150 : tmpl::push_back<StepChoosers::step_chooser_compute_tags<
151 : EvolutionMetavars, local_time_stepping>>>,
152 : ::evolution::dg::Initialization::Mortars<volume_dim, system>,
153 : evolution::Actions::InitializeRunEventsAndDenseTriggers,
154 : intrp::Actions::ElementInitInterpPoints<
155 : intrp::Tags::InterpPointInfo<EvolutionMetavars>>,
156 : Parallel::Actions::TerminatePhase>;
157 :
158 0 : using gh_dg_element_array = DgElementArray<
159 : EvolutionMetavars,
160 : tmpl::flatten<tmpl::list<
161 : Parallel::PhaseActions<Parallel::Phase::Initialization,
162 : initialization_actions>,
163 : Parallel::PhaseActions<
164 : Parallel::Phase::RegisterWithElementDataReader,
165 : tmpl::list<importers::Actions::RegisterWithElementDataReader,
166 : Parallel::Actions::TerminatePhase>>,
167 : Parallel::PhaseActions<
168 : Parallel::Phase::ImportInitialData,
169 : tmpl::list<gh::Actions::SetInitialData,
170 : gh::Actions::ReceiveNumericInitialData,
171 : Parallel::Actions::TerminatePhase>>,
172 : Parallel::PhaseActions<
173 : Parallel::Phase::InitializeInitialDataDependentQuantities,
174 : initialize_initial_data_dependent_quantities_actions>,
175 : Parallel::PhaseActions<
176 : Parallel::Phase::InitializeTimeStepperHistory,
177 : SelfStart::self_start_procedure<step_actions<true>, system>>,
178 : Parallel::PhaseActions<Parallel::Phase::Register,
179 : tmpl::list<dg_registration_list,
180 : Parallel::Actions::TerminatePhase>>,
181 : Parallel::PhaseActions<
182 : Parallel::Phase::Evolve,
183 : tmpl::list<evolution::Actions::RunEventsAndTriggers,
184 : Actions::ChangeSlabSize, step_actions<false>,
185 : Actions::AdvanceTime,
186 : PhaseControl::Actions::ExecutePhaseChange>>>>>;
187 :
188 : template <bool DuringSelfStart>
189 0 : struct CceWorldtubeTarget
190 : : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
191 0 : using temporal_id = ::Tags::TimeStepId;
192 :
193 0 : static std::string name() {
194 : return DuringSelfStart ? "SelfStartCceWorldtubeTarget"
195 : : "CceWorldtubeTarget";
196 : }
197 0 : using compute_items_on_source = tmpl::list<>;
198 0 : using compute_items_on_target = tmpl::list<>;
199 0 : using compute_target_points =
200 : intrp::TargetPoints::Sphere<CceWorldtubeTarget, ::Frame::Inertial>;
201 0 : using post_interpolation_callbacks =
202 : tmpl::list<intrp::callbacks::SendGhWorldtubeData<
203 : Cce::CharacteristicEvolution<EvolutionMetavars>, CceWorldtubeTarget,
204 : DuringSelfStart, local_time_stepping>>;
205 0 : using vars_to_interpolate_to_target = interpolator_source_vars;
206 : template <typename Metavariables>
207 0 : using interpolating_component = gh_dg_element_array;
208 : };
209 :
210 0 : using interpolation_target_tags =
211 : tmpl::list<CceWorldtubeTarget<false>, CceWorldtubeTarget<true>>;
212 :
213 : struct registration
214 : : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
215 0 : using element_registrars =
216 : tmpl::map<tmpl::pair<gh_dg_element_array, dg_registration_list>>;
217 : };
218 :
219 0 : using component_list = tmpl::flatten<tmpl::list<
220 : observers::Observer<EvolutionMetavars>,
221 : observers::ObserverWriter<EvolutionMetavars>,
222 : mem_monitor::MemoryMonitor<EvolutionMetavars>,
223 : importers::ElementDataReader<EvolutionMetavars>, gh_dg_element_array,
224 : intrp::Interpolator<EvolutionMetavars>,
225 : tmpl::transform<interpolation_target_tags,
226 : tmpl::bind<intrp::InterpolationTarget,
227 : tmpl::pin<EvolutionMetavars>, tmpl::_1>>,
228 : cce_boundary_component, Cce::CharacteristicEvolution<EvolutionMetavars>>>;
229 :
230 : static constexpr Options::String help{
231 : "Evolve the Einstein field equations using the Generalized Harmonic "
232 : "formulation\n"
233 : "with a coupled CCE evolution for asymptotic wave data output.\n"
234 : "The system shouldn't have black holes."};
235 : };
|