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 <optional>
8 : #include <vector>
9 :
10 : #include "ControlSystem/Actions/InitializeMeasurements.hpp"
11 : #include "ControlSystem/Actions/LimitTimeStep.hpp"
12 : #include "ControlSystem/CleanFunctionsOfTime.hpp"
13 : #include "ControlSystem/Component.hpp"
14 : #include "ControlSystem/ControlErrors/Size/Factory.hpp"
15 : #include "ControlSystem/ControlErrors/Size/State.hpp"
16 : #include "ControlSystem/Measurements/BothHorizons.hpp"
17 : #include "ControlSystem/Metafunctions.hpp"
18 : #include "ControlSystem/Systems/Expansion.hpp"
19 : #include "ControlSystem/Systems/Rotation.hpp"
20 : #include "ControlSystem/Systems/Shape.hpp"
21 : #include "ControlSystem/Systems/Size.hpp"
22 : #include "ControlSystem/Systems/Skew.hpp"
23 : #include "ControlSystem/Systems/Translation.hpp"
24 : #include "ControlSystem/Trigger.hpp"
25 : #include "DataStructures/DataBox/PrefixHelpers.hpp"
26 : #include "DataStructures/DataBox/Tag.hpp"
27 : #include "DataStructures/LinkedMessageId.hpp"
28 : #include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp"
29 : #include "Domain/Creators/BinaryCompactObject.hpp"
30 : #include "Domain/Creators/CylindricalBinaryCompactObject.hpp"
31 : #include "Domain/Structure/ObjectLabel.hpp"
32 : #include "Domain/Tags.hpp"
33 : #include "Domain/TagsCharacteristicSpeeds.hpp"
34 : #include "Evolution/Actions/RunEventsAndDenseTriggers.hpp"
35 : #include "Evolution/Actions/RunEventsAndTriggers.hpp"
36 : #include "Evolution/BoundaryCorrection.hpp"
37 : #include "Evolution/ComputeTags.hpp"
38 : #include "Evolution/DiscontinuousGalerkin/Actions/ApplyBoundaryCorrections.hpp"
39 : #include "Evolution/DiscontinuousGalerkin/Actions/ComputeTimeDerivative.hpp"
40 : #include "Evolution/DiscontinuousGalerkin/CleanMortarHistory.hpp"
41 : #include "Evolution/DiscontinuousGalerkin/DgElementArray.hpp"
42 : #include "Evolution/DiscontinuousGalerkin/Initialization/Mortars.hpp"
43 : #include "Evolution/Executables/GeneralizedHarmonic/Deadlock.hpp"
44 : #include "Evolution/Initialization/DgDomain.hpp"
45 : #include "Evolution/Initialization/Evolution.hpp"
46 : #include "Evolution/Initialization/NonconservativeSystem.hpp"
47 : #include "Evolution/Systems/Cce/Callbacks/DumpBondiSachsOnWorldtube.hpp"
48 : #include "Evolution/Systems/GeneralizedHarmonic/Actions/SetInitialData.hpp"
49 : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Bjorhus.hpp"
50 : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/DemandOutgoingCharSpeeds.hpp"
51 : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/DirichletMinkowski.hpp"
52 : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Factory.hpp"
53 : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryCorrections/Factory.hpp"
54 : #include "Evolution/Systems/GeneralizedHarmonic/Characteristics.hpp"
55 : #include "Evolution/Systems/GeneralizedHarmonic/Equations.hpp"
56 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Factory.hpp"
57 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Gauges.hpp"
58 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/SetPiAndPhiFromConstraints.hpp"
59 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Tags/GaugeCondition.hpp"
60 : #include "Evolution/Systems/GeneralizedHarmonic/Initialize.hpp"
61 : #include "Evolution/Systems/GeneralizedHarmonic/System.hpp"
62 : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
63 : #include "Evolution/Tags/Filter.hpp"
64 : #include "Evolution/Triggers/SeparationLessThan.hpp"
65 : #include "Evolution/TypeTraits.hpp"
66 : #include "IO/Importers/Actions/RegisterWithElementDataReader.hpp"
67 : #include "IO/Importers/ElementDataReader.hpp"
68 : #include "IO/Observer/Actions/ObserverRegistration.hpp"
69 : #include "IO/Observer/Actions/RegisterEvents.hpp"
70 : #include "IO/Observer/Helpers.hpp"
71 : #include "IO/Observer/ObserverComponent.hpp"
72 : #include "IO/Observer/Tags.hpp"
73 : #include "NumericalAlgorithms/DiscontinuousGalerkin/Tags.hpp"
74 : #include "NumericalAlgorithms/LinearOperators/ExponentialFilter.hpp"
75 : #include "Options/Options.hpp"
76 : #include "Options/ParseOptions.hpp"
77 : #include "Options/Protocols/FactoryCreation.hpp"
78 : #include "Options/String.hpp"
79 : #include "Parallel/Algorithms/AlgorithmSingleton.hpp"
80 : #include "Parallel/ArrayCollection/DgElementCollection.hpp"
81 : #include "Parallel/ArrayCollection/SimpleActionOnElement.hpp"
82 : #include "Parallel/GlobalCache.hpp"
83 : #include "Parallel/Invoke.hpp"
84 : #include "Parallel/Local.hpp"
85 : #include "Parallel/MemoryMonitor/MemoryMonitor.hpp"
86 : #include "Parallel/Phase.hpp"
87 : #include "Parallel/PhaseControl/CheckpointAndExitAfterWallclock.hpp"
88 : #include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
89 : #include "Parallel/PhaseControl/Factory.hpp"
90 : #include "Parallel/PhaseControl/VisitAndReturn.hpp"
91 : #include "Parallel/PhaseDependentActionList.hpp"
92 : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
93 : #include "Parallel/Reduction.hpp"
94 : #include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
95 : #include "ParallelAlgorithms/Actions/FilterAction.hpp"
96 : #include "ParallelAlgorithms/Actions/FunctionsOfTimeAreReady.hpp"
97 : #include "ParallelAlgorithms/Actions/InitializeItems.hpp"
98 : #include "ParallelAlgorithms/Actions/MemoryMonitor/ContributeMemoryData.hpp"
99 : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
100 : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
101 : #include "ParallelAlgorithms/Amr/Actions/CollectDataFromChildren.hpp"
102 : #include "ParallelAlgorithms/Amr/Actions/Component.hpp"
103 : #include "ParallelAlgorithms/Amr/Actions/CreateChild.hpp"
104 : #include "ParallelAlgorithms/Amr/Actions/Initialize.hpp"
105 : #include "ParallelAlgorithms/Amr/Actions/SendAmrDiagnostics.hpp"
106 : #include "ParallelAlgorithms/Amr/Criteria/Constraints.hpp"
107 : #include "ParallelAlgorithms/Amr/Criteria/Criterion.hpp"
108 : #include "ParallelAlgorithms/Amr/Criteria/Factory.hpp"
109 : #include "ParallelAlgorithms/Amr/Events/ObserveAmrCriteria.hpp"
110 : #include "ParallelAlgorithms/Amr/Events/ObserveAmrStats.hpp"
111 : #include "ParallelAlgorithms/Amr/Events/RefineMesh.hpp"
112 : #include "ParallelAlgorithms/Amr/Projectors/CopyFromCreatorOrLeaveAsIs.hpp"
113 : #include "ParallelAlgorithms/Amr/Projectors/DefaultInitialize.hpp"
114 : #include "ParallelAlgorithms/Amr/Projectors/Tensors.hpp"
115 : #include "ParallelAlgorithms/Amr/Projectors/Variables.hpp"
116 : #include "ParallelAlgorithms/Amr/Protocols/AmrMetavariables.hpp"
117 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/ErrorOnFailedApparentHorizon.hpp"
118 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/FailedHorizonFind.hpp"
119 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/FindApparentHorizon.hpp"
120 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/IgnoreFailedApparentHorizon.hpp"
121 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/ObserveCenters.hpp"
122 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/ObserveFieldsOnHorizon.hpp"
123 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/ObserveTimeSeriesOnHorizon.hpp"
124 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/SendDependencyToObserverWriter.hpp"
125 : #include "ParallelAlgorithms/ApparentHorizonFinder/Component.hpp"
126 : #include "ParallelAlgorithms/ApparentHorizonFinder/ComputeExcisionBoundaryVolumeQuantities.hpp"
127 : #include "ParallelAlgorithms/ApparentHorizonFinder/ComputeExcisionBoundaryVolumeQuantities.tpp"
128 : #include "ParallelAlgorithms/ApparentHorizonFinder/ComputeHorizonVolumeQuantities.hpp"
129 : #include "ParallelAlgorithms/ApparentHorizonFinder/ComputeHorizonVolumeQuantities.tpp"
130 : #include "ParallelAlgorithms/ApparentHorizonFinder/Criteria/Criterion.hpp"
131 : #include "ParallelAlgorithms/ApparentHorizonFinder/Criteria/Factory.hpp"
132 : #include "ParallelAlgorithms/ApparentHorizonFinder/Destination.hpp"
133 : #include "ParallelAlgorithms/ApparentHorizonFinder/Events/FindApparentHorizon.hpp"
134 : #include "ParallelAlgorithms/ApparentHorizonFinder/Events/FindCommonHorizon.hpp"
135 : #include "ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp"
136 : #include "ParallelAlgorithms/ApparentHorizonFinder/InterpolationTarget.hpp"
137 : #include "ParallelAlgorithms/ApparentHorizonFinder/Protocols/HorizonMetavars.hpp"
138 : #include "ParallelAlgorithms/ApparentHorizonFinder/Tags.hpp"
139 : #include "ParallelAlgorithms/Events/Completion.hpp"
140 : #include "ParallelAlgorithms/Events/Factory.hpp"
141 : #include "ParallelAlgorithms/Events/MonitorMemory.hpp"
142 : #include "ParallelAlgorithms/Events/ObserveTimeStepVolume.hpp"
143 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTrigger.hpp"
144 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTriggers/Factory.hpp"
145 : #include "ParallelAlgorithms/EventsAndTriggers/Actions/RunEventsOnFailure.hpp"
146 : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
147 : #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
148 : #include "ParallelAlgorithms/EventsAndTriggers/LogicalTriggers.hpp"
149 : #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
150 : #include "ParallelAlgorithms/Interpolation/Actions/CleanUpInterpolator.hpp"
151 : #include "ParallelAlgorithms/Interpolation/Actions/ElementInitInterpPoints.hpp"
152 : #include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
153 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolationTargetReceiveVars.hpp"
154 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceivePoints.hpp"
155 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceiveVolumeData.hpp"
156 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorRegisterElement.hpp"
157 : #include "ParallelAlgorithms/Interpolation/Actions/TryToInterpolate.hpp"
158 : #include "ParallelAlgorithms/Interpolation/Callbacks/ObserveSurfaceData.hpp"
159 : #include "ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp"
160 : #include "ParallelAlgorithms/Interpolation/Events/Interpolate.hpp"
161 : #include "ParallelAlgorithms/Interpolation/Events/InterpolateWithoutInterpComponent.hpp"
162 : #include "ParallelAlgorithms/Interpolation/InterpolationTarget.hpp"
163 : #include "ParallelAlgorithms/Interpolation/Interpolator.hpp"
164 : #include "ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp"
165 : #include "ParallelAlgorithms/Interpolation/Tags.hpp"
166 : #include "ParallelAlgorithms/Interpolation/Targets/Sphere.hpp"
167 : #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp"
168 : #include "PointwiseFunctions/GeneralRelativity/DerivativeSpatialMetric.hpp"
169 : #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp"
170 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp"
171 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/DerivSpatialMetric.hpp"
172 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp"
173 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpatialDerivOfLapse.hpp"
174 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpatialDerivOfShift.hpp"
175 : #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp"
176 : #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp"
177 : #include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
178 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
179 : #include "PointwiseFunctions/GeneralRelativity/WeylElectric.hpp"
180 : #include "PointwiseFunctions/GeneralRelativity/WeylTypeD1.hpp"
181 : #include "PointwiseFunctions/InitialDataUtilities/InitialData.hpp"
182 : #include "Time/Actions/SelfStartActions.hpp"
183 : #include "Time/AdvanceTime.hpp"
184 : #include "Time/ChangeSlabSize/Action.hpp"
185 : #include "Time/ChangeSlabSize/Tags.hpp"
186 : #include "Time/ChangeTimeStepperOrder.hpp"
187 : #include "Time/CleanHistory.hpp"
188 : #include "Time/RecordTimeStepperData.hpp"
189 : #include "Time/StepChoosers/Factory.hpp"
190 : #include "Time/StepChoosers/StepChooser.hpp"
191 : #include "Time/Tags/StepperErrors.hpp"
192 : #include "Time/Tags/Time.hpp"
193 : #include "Time/Tags/TimeStepId.hpp"
194 : #include "Time/TimeSequence.hpp"
195 : #include "Time/TimeSteppers/Factory.hpp"
196 : #include "Time/TimeSteppers/LtsTimeStepper.hpp"
197 : #include "Time/TimeSteppers/TimeStepper.hpp"
198 : #include "Time/Triggers/TimeTriggers.hpp"
199 : #include "Time/UpdateU.hpp"
200 : #include "Utilities/Algorithm.hpp"
201 : #include "Utilities/ErrorHandling/Error.hpp"
202 : #include "Utilities/Functional.hpp"
203 : #include "Utilities/GetOutput.hpp"
204 : #include "Utilities/NoSuchType.hpp"
205 : #include "Utilities/ProtocolHelpers.hpp"
206 : #include "Utilities/TMPL.hpp"
207 :
208 : // Check if SpEC is linked and therefore we can load SpEC initial data
209 : #ifdef HAS_SPEC_EXPORTER
210 : #include "PointwiseFunctions/AnalyticData/GeneralRelativity/SpecInitialData.hpp"
211 : using SpecInitialData = gr::AnalyticData::SpecInitialData;
212 : #else
213 0 : using SpecInitialData = NoSuchType;
214 : #endif
215 :
216 : /// \cond
217 : namespace Frame {
218 :
219 : struct Inertial;
220 : } // namespace Frame
221 : namespace PUP {
222 : class er;
223 : } // namespace PUP
224 : namespace Parallel {
225 : template <typename Metavariables>
226 : class CProxy_GlobalCache;
227 : } // namespace Parallel
228 : /// \endcond
229 :
230 : // Note: this executable does not use GeneralizedHarmonicBase.hpp, because
231 : // using it would require a number of changes in GeneralizedHarmonicBase.hpp
232 : // that would apply only when evolving binary black holes. This would
233 : // require adding a number of compile-time switches, an outcome we would prefer
234 : // to avoid.
235 : struct EvolutionMetavars {
236 : struct BondiSachs;
237 :
238 : static constexpr size_t volume_dim = 3;
239 0 : static constexpr bool use_damped_harmonic_rollon = false;
240 0 : using system = gh::System<volume_dim>;
241 0 : using temporal_id = Tags::TimeStepId;
242 0 : using TimeStepperBase = LtsTimeStepper;
243 :
244 : static constexpr bool local_time_stepping =
245 : TimeStepperBase::local_time_stepping;
246 : static constexpr bool use_dg_element_collection = false;
247 :
248 0 : using initialize_initial_data_dependent_quantities_actions =
249 : tmpl::list<gh::gauges::SetPiAndPhiFromConstraints<
250 : gh::Solutions::all_solutions<volume_dim>, volume_dim>,
251 : Parallel::Actions::TerminatePhase>;
252 :
253 : // NOLINTNEXTLINE(google-runtime-references)
254 0 : void pup(PUP::er& /*p*/) {}
255 :
256 : template <::domain::ObjectLabel Horizon, typename Frame>
257 0 : struct Ah : tt::ConformsTo<ah::protocols::HorizonMetavars> {
258 0 : static constexpr size_t index = 10 + static_cast<size_t>(Horizon);
259 :
260 0 : using time_tag = ah::Tags::ObservationTime<index>;
261 :
262 0 : using frame = Frame;
263 :
264 0 : using horizon_find_callbacks = tmpl::append<
265 : tmpl::conditional_t<
266 : Horizon == ::domain::ObjectLabel::C,
267 : tmpl::list<ah::callbacks::SendDependencyToObserverWriter<Ah, true>>,
268 : tmpl::list<>>,
269 : tmpl::list<ah::callbacks::ObserveFieldsOnHorizon<
270 : ::ah::surface_tags_for_observing, Ah>,
271 : ah::callbacks::ObserveTimeSeriesOnHorizon<
272 : ::ah::tags_for_observing<Frame>, Ah>>>;
273 0 : using horizon_find_failure_callbacks = tmpl::append<
274 : // Only ignore errors for AhC
275 : tmpl::list<ah::callbacks::FailedHorizonFind<
276 : Ah, Horizon == ::domain::ObjectLabel::C>>,
277 : tmpl::conditional_t<
278 : Horizon == ::domain::ObjectLabel::C,
279 : tmpl::list<
280 : ah::callbacks::SendDependencyToObserverWriter<Ah, false>>,
281 : tmpl::list<>>>;
282 :
283 0 : using compute_tags_on_element =
284 : tmpl::list<ah::Tags::ObservationTimeCompute<index>>;
285 :
286 0 : static constexpr ah::Destination destination = ah::Destination::Observation;
287 :
288 0 : static std::string name() {
289 : return "ObservationAh" + ::domain::name(Horizon);
290 : }
291 : };
292 :
293 0 : using AhA = Ah<::domain::ObjectLabel::A, ::Frame::Distorted>;
294 0 : using AhB = Ah<::domain::ObjectLabel::B, ::Frame::Distorted>;
295 0 : using AhC = Ah<::domain::ObjectLabel::C, ::Frame::Inertial>;
296 :
297 : template <::domain::ObjectLabel Excision>
298 0 : struct ExcisionBoundary
299 : : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
300 0 : using temporal_id = ::Tags::Time;
301 0 : using tags_to_observe =
302 : tmpl::list<gr::Tags::Lapse<DataVector>,
303 : gr::Tags::Shift<DataVector, 3, Frame::Grid>>;
304 0 : using compute_vars_to_interpolate =
305 : ah::ComputeExcisionBoundaryVolumeQuantities;
306 0 : using vars_to_interpolate_to_target = tags_to_observe;
307 0 : using compute_items_on_source = tmpl::list<>;
308 0 : using compute_items_on_target = tmpl::list<>;
309 0 : using compute_target_points =
310 : intrp::TargetPoints::Sphere<ExcisionBoundary<Excision>, ::Frame::Grid>;
311 0 : using post_interpolation_callbacks =
312 : tmpl::list<intrp::callbacks::ObserveSurfaceData<
313 : tags_to_observe, ExcisionBoundary<Excision>, ::Frame::Grid>>;
314 : // run_callbacks
315 : template <typename metavariables>
316 0 : using interpolating_component = typename metavariables::gh_dg_element_array;
317 0 : static std::string name() {
318 : return "ObservationExcisionBoundary" + ::domain::name(Excision);
319 : }
320 : };
321 :
322 0 : using ExcisionBoundaryA = ExcisionBoundary<::domain::ObjectLabel::A>;
323 0 : using ExcisionBoundaryB = ExcisionBoundary<::domain::ObjectLabel::B>;
324 0 : using both_horizons = control_system::measurements::BothHorizons;
325 0 : using control_systems =
326 : tmpl::list<control_system::Systems::Rotation<3, both_horizons>,
327 : control_system::Systems::Expansion<2, both_horizons>,
328 : control_system::Systems::Translation<2, both_horizons, 2>,
329 : control_system::Systems::Skew<2, both_horizons>,
330 : control_system::Systems::Shape<::domain::ObjectLabel::A, 2,
331 : both_horizons>,
332 : control_system::Systems::Shape<::domain::ObjectLabel::B, 2,
333 : both_horizons>,
334 : control_system::Systems::Size<::domain::ObjectLabel::A, 2>,
335 : control_system::Systems::Size<::domain::ObjectLabel::B, 2>>;
336 :
337 0 : static constexpr bool use_control_systems =
338 : tmpl::size<control_systems>::value > 0;
339 :
340 0 : using source_vars_no_deriv =
341 : tmpl::list<gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
342 : gh::Tags::Pi<DataVector, volume_dim>,
343 : gh::Tags::Phi<DataVector, volume_dim>>;
344 :
345 0 : struct BondiSachs : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
346 0 : static std::string name() { return "BondiSachsInterpolation"; }
347 0 : using temporal_id = ::Tags::Time;
348 0 : using vars_to_interpolate_to_target = source_vars_no_deriv;
349 0 : using compute_target_points =
350 : intrp::TargetPoints::Sphere<BondiSachs, ::Frame::Inertial>;
351 0 : using post_interpolation_callbacks =
352 : tmpl::list<intrp::callbacks::DumpBondiSachsOnWorldtube<BondiSachs>>;
353 0 : using compute_items_on_target = tmpl::list<>;
354 : template <typename metavariables>
355 0 : using interpolating_component = typename metavariables::gh_dg_element_array;
356 : };
357 :
358 0 : using interpolation_target_tags = tmpl::push_back<
359 : control_system::metafunctions::interpolation_target_tags<control_systems>,
360 : BondiSachs, ExcisionBoundaryA, ExcisionBoundaryB>;
361 :
362 0 : using observe_fields = tmpl::append<
363 : tmpl::list<
364 : gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
365 : gh::Tags::Pi<DataVector, volume_dim>,
366 : gh::Tags::Phi<DataVector, volume_dim>,
367 : gh::Tags::GaugeH<DataVector, volume_dim>,
368 : gh::Tags::SpacetimeDerivGaugeH<DataVector, volume_dim>,
369 : gr::Tags::Lapse<DataVector>, gr::Tags::Shift<DataVector, volume_dim>,
370 : gr::Tags::SpatialMetric<DataVector, volume_dim>,
371 : gr::Tags::DetSpatialMetric<DataVector>,
372 : gr::Tags::InverseSpatialMetric<DataVector, volume_dim>,
373 : gr::Tags::SqrtDetSpatialMetricCompute<DataVector, volume_dim,
374 : ::Frame::Inertial>,
375 : gr::Tags::SpacetimeNormalOneFormCompute<DataVector, volume_dim,
376 : ::Frame::Inertial>,
377 : gr::Tags::SpacetimeNormalVectorCompute<DataVector, volume_dim,
378 : ::Frame::Inertial>,
379 : gr::Tags::InverseSpacetimeMetricCompute<DataVector, volume_dim,
380 : ::Frame::Inertial>,
381 : gh::Tags::DerivLapseCompute<volume_dim, Frame::Inertial>,
382 : gh::Tags::DerivShiftCompute<volume_dim, Frame::Inertial>,
383 : gh::Tags::DerivSpatialMetricCompute<volume_dim, Frame::Inertial>,
384 : gr::Tags::DerivInverseSpatialMetricCompute<volume_dim,
385 : Frame::Inertial>,
386 : gh::Tags::GaugeConstraintCompute<volume_dim, ::Frame::Inertial>,
387 : gh::Tags::TwoIndexConstraintCompute<volume_dim, ::Frame::Inertial>,
388 : gh::Tags::ThreeIndexConstraintCompute<volume_dim, ::Frame::Inertial>,
389 : gh::Tags::DerivSpatialMetricCompute<volume_dim, ::Frame::Inertial>,
390 : gr::Tags::SpatialChristoffelFirstKindCompute<DataVector, volume_dim,
391 : ::Frame::Inertial>,
392 : gr::Tags::SpatialChristoffelSecondKindCompute<DataVector, volume_dim,
393 : ::Frame::Inertial>,
394 : ::Tags::DerivTensorCompute<
395 : gr::Tags::SpatialChristoffelSecondKind<DataVector, volume_dim>,
396 : ::domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
397 : Frame::Inertial>,
398 : ::domain::Tags::Mesh<volume_dim>>,
399 : gr::Tags::SpatialRicciCompute<DataVector, volume_dim,
400 : ::Frame::Inertial>,
401 : gr::Tags::SpatialRicciScalarCompute<DataVector, volume_dim,
402 : ::Frame::Inertial>,
403 : // observe norms of tensors
404 : ::Tags::PointwiseL2NormCompute<
405 : gr::Tags::Shift<DataVector, volume_dim>>,
406 : ::Tags::PointwiseL2NormCompute<
407 : gr::Tags::SpatialMetric<DataVector, volume_dim>>,
408 : ::Tags::PointwiseL2NormCompute<
409 : gr::Tags::SpacetimeMetric<DataVector, volume_dim>>,
410 : ::Tags::PointwiseL2NormCompute<gh::Tags::Pi<DataVector, volume_dim>>,
411 : ::Tags::PointwiseL2NormCompute<gh::Tags::Phi<DataVector, volume_dim>>,
412 : ::Tags::PointwiseL2NormCompute<
413 : gh::Tags::GaugeH<DataVector, volume_dim>>,
414 : ::Tags::PointwiseL2NormCompute<
415 : gh::Tags::SpacetimeDerivGaugeH<DataVector, volume_dim>>,
416 : // following tags added to observe constraints
417 : ::Tags::PointwiseL2NormCompute<
418 : gh::Tags::GaugeConstraint<DataVector, volume_dim>>,
419 : ::Tags::PointwiseL2NormCompute<
420 : gh::Tags::TwoIndexConstraint<DataVector, volume_dim>>,
421 : ::Tags::PointwiseL2NormCompute<
422 : gh::Tags::ThreeIndexConstraint<DataVector, volume_dim>>,
423 : ::domain::Tags::Coordinates<volume_dim, Frame::Grid>,
424 : ::domain::Tags::Coordinates<volume_dim, Frame::Inertial>>,
425 : // The 4-index constraint is only implemented in 3d
426 : tmpl::conditional_t<
427 : volume_dim == 3,
428 : tmpl::list<
429 : gh::Tags::FourIndexConstraintCompute<3, ::Frame::Inertial>,
430 : gh::Tags::FConstraintCompute<3, ::Frame::Inertial>,
431 : ::Tags::PointwiseL2NormCompute<
432 : gh::Tags::FConstraint<DataVector, 3>>,
433 : ::Tags::PointwiseL2NormCompute<
434 : gh::Tags::FourIndexConstraint<DataVector, 3>>,
435 : gh::Tags::ConstraintEnergyCompute<3, ::Frame::Inertial>,
436 : gh::Tags::ExtrinsicCurvatureCompute<3, ::Frame::Inertial>,
437 : ::Tags::DerivTensorCompute<
438 : gr::Tags::ExtrinsicCurvature<DataVector, 3>,
439 : ::domain::Tags::InverseJacobian<
440 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
441 : ::domain::Tags::Mesh<volume_dim>>,
442 : gr::Tags::WeylElectricCompute<DataVector, 3, Frame::Inertial>,
443 : gr::Tags::WeylElectricScalarCompute<DataVector, 3,
444 : Frame::Inertial>,
445 : gr::Tags::WeylTypeD1Compute<DataVector, 3, Frame::Inertial>,
446 : gr::Tags::WeylTypeD1ScalarCompute<DataVector, 3, Frame::Inertial>,
447 : gr::Tags::Psi4RealCompute<Frame::Inertial>>,
448 : tmpl::list<>>>;
449 0 : using non_tensor_compute_tags = tmpl::list<
450 : ::Events::Tags::ObserverMeshCompute<volume_dim>,
451 : ::Events::Tags::ObserverCoordinatesCompute<volume_dim, Frame::Inertial>,
452 : ::Events::Tags::ObserverInverseJacobianCompute<
453 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
454 : ::Events::Tags::ObserverJacobianCompute<volume_dim, Frame::ElementLogical,
455 : Frame::Inertial>,
456 : ::Events::Tags::ObserverDetInvJacobianCompute<Frame::ElementLogical,
457 : Frame::Inertial>,
458 : ::Events::Tags::ObserverMeshVelocityCompute<volume_dim, Frame::Inertial>,
459 : gh::gauges::Tags::GaugeAndDerivativeCompute<
460 : volume_dim, gh::Solutions::all_solutions<volume_dim>>>;
461 :
462 : struct factory_creation
463 : : tt::ConformsTo<Options::protocols::FactoryCreation> {
464 0 : using factory_classes = tmpl::map<
465 : tmpl::pair<ah::Criterion, ah::Criteria::standard_criteria>,
466 : tmpl::pair<
467 : amr::Criterion,
468 : tmpl::push_back<
469 : amr::Criteria::standard_criteria<
470 : volume_dim, typename system::variables_tag::tags_list>,
471 : amr::Criteria::Constraints<
472 : volume_dim,
473 : tmpl::list<gh::Tags::ThreeIndexConstraintCompute<
474 : volume_dim, Frame::Inertial>>>>>,
475 : tmpl::pair<
476 : evolution::initial_data::InitialData,
477 : tmpl::flatten<tmpl::list<
478 : gh::NumericInitialData,
479 : tmpl::conditional_t<std::is_same_v<SpecInitialData, NoSuchType>,
480 : tmpl::list<>, SpecInitialData>>>>,
481 : tmpl::pair<DenseTrigger,
482 : tmpl::flatten<tmpl::list<
483 : control_system::control_system_triggers<control_systems>,
484 : DenseTriggers::standard_dense_triggers>>>,
485 : tmpl::pair<
486 : DomainCreator<volume_dim>,
487 : tmpl::list<::domain::creators::BinaryCompactObject<false>,
488 : ::domain::creators::CylindricalBinaryCompactObject>>,
489 : tmpl::pair<Event,
490 : tmpl::flatten<tmpl::list<
491 : ah::Events::FindApparentHorizon<AhA>,
492 : ah::Events::FindApparentHorizon<AhB>,
493 : ah::Events::FindCommonHorizon<AhC, observe_fields,
494 : non_tensor_compute_tags>,
495 : intrp::Events::InterpolateWithoutInterpComponent<
496 : 3, BondiSachs, source_vars_no_deriv>,
497 : intrp::Events::InterpolateWithoutInterpComponent<
498 : 3, ExcisionBoundaryA, ah::source_vars<3>>,
499 : intrp::Events::InterpolateWithoutInterpComponent<
500 : 3, ExcisionBoundaryB, ah::source_vars<3>>,
501 : Events::MonitorMemory<3>, Events::Completion,
502 : dg::Events::field_observations<
503 : volume_dim, observe_fields, non_tensor_compute_tags>,
504 : control_system::metafunctions::control_system_events<
505 : control_systems>,
506 : control_system::CleanFunctionsOfTime,
507 : Events::time_events<system>,
508 : dg::Events::ObserveTimeStepVolume<system>,
509 : amr::Events::RefineMesh,
510 : amr::Events::ObserveAmrStats<volume_dim>,
511 : amr::Events::ObserveAmrCriteria<EvolutionMetavars>>>>,
512 : tmpl::pair<
513 : evolution::BoundaryCorrection,
514 : gh::BoundaryCorrections::standard_boundary_corrections<volume_dim>>,
515 : tmpl::pair<control_system::size::State,
516 : control_system::size::States::factory_creatable_states>,
517 : tmpl::pair<
518 : gh::BoundaryConditions::BoundaryCondition<volume_dim>,
519 : tmpl::list<
520 : gh::BoundaryConditions::ConstraintPreservingBjorhus<volume_dim>,
521 : gh::BoundaryConditions::DirichletMinkowski<volume_dim>,
522 : gh::BoundaryConditions::DemandOutgoingCharSpeeds<volume_dim>>>,
523 : tmpl::pair<
524 : gh::gauges::GaugeCondition,
525 : tmpl::list<gh::gauges::DampedHarmonic, gh::gauges::Harmonic>>,
526 : // Restrict to monotonic time steppers in LTS to avoid control
527 : // systems deadlocking.
528 : tmpl::pair<LtsTimeStepper, TimeSteppers::monotonic_lts_time_steppers>,
529 : tmpl::pair<PhaseChange, PhaseControl::factory_creatable_classes>,
530 : tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
531 : StepChoosers::standard_step_choosers<system>>,
532 : tmpl::pair<
533 : StepChooser<StepChooserUse::Slab>,
534 : StepChoosers::standard_slab_choosers<system, local_time_stepping>>,
535 : tmpl::pair<TimeSequence<double>,
536 : TimeSequences::all_time_sequences<double>>,
537 : tmpl::pair<TimeSequence<std::uint64_t>,
538 : TimeSequences::all_time_sequences<std::uint64_t>>,
539 : tmpl::pair<TimeStepper, TimeSteppers::time_steppers>,
540 : tmpl::pair<
541 : Trigger,
542 : tmpl::append<Triggers::logical_triggers, Triggers::time_triggers,
543 : tmpl::list<Triggers::SeparationLessThan<false>>>>>;
544 : };
545 :
546 : // A tmpl::list of tags to be added to the GlobalCache by the
547 : // metavariables
548 0 : using const_global_cache_tags =
549 : tmpl::list<gh::gauges::Tags::GaugeCondition,
550 : gh::Tags::DampingFunctionGamma0<volume_dim, Frame::Grid>,
551 : gh::Tags::DampingFunctionGamma1<volume_dim, Frame::Grid>,
552 : gh::Tags::DampingFunctionGamma2<volume_dim, Frame::Grid>>;
553 :
554 0 : using dg_registration_list =
555 : tmpl::list<observers::Actions::RegisterEventsWithObservers>;
556 :
557 : static constexpr auto default_phase_order =
558 : std::array{Parallel::Phase::Initialization,
559 : Parallel::Phase::RegisterWithElementDataReader,
560 : Parallel::Phase::ImportInitialData,
561 : Parallel::Phase::InitializeInitialDataDependentQuantities,
562 : Parallel::Phase::Register,
563 : Parallel::Phase::InitializeTimeStepperHistory,
564 : Parallel::Phase::CheckDomain,
565 : Parallel::Phase::Evolve,
566 : Parallel::Phase::Exit};
567 :
568 0 : using step_actions = tmpl::list<
569 : evolution::dg::Actions::ComputeTimeDerivative<
570 : volume_dim, system, AllStepChoosers, local_time_stepping,
571 : use_dg_element_collection>,
572 : tmpl::conditional_t<
573 : local_time_stepping,
574 : tmpl::list<Actions::MutateApply<RecordTimeStepperData<system>>,
575 : evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<
576 : ::domain::CheckFunctionsOfTimeAreReadyPostprocessor<
577 : volume_dim>,
578 : evolution::dg::ApplyBoundaryCorrections<
579 : local_time_stepping, EvolutionMetavars, volume_dim,
580 : true>>>,
581 : Actions::MutateApply<UpdateU<system, local_time_stepping>>,
582 : evolution::dg::Actions::ApplyLtsBoundaryCorrections<
583 : volume_dim, false, use_dg_element_collection>,
584 : Actions::MutateApply<ChangeTimeStepperOrder<system>>>,
585 : tmpl::list<
586 : evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
587 : volume_dim, use_dg_element_collection>,
588 : Actions::MutateApply<RecordTimeStepperData<system>>,
589 : evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<
590 : ::domain::CheckFunctionsOfTimeAreReadyPostprocessor<
591 : volume_dim>>>,
592 : control_system::Actions::LimitTimeStep<control_systems>,
593 : Actions::MutateApply<UpdateU<system, local_time_stepping>>>>,
594 : Actions::MutateApply<CleanHistory<system>>,
595 : tmpl::conditional_t<
596 : local_time_stepping,
597 : Actions::MutateApply<evolution::dg::CleanMortarHistory<system>>,
598 : tmpl::list<>>,
599 : dg::Actions::Filter<
600 : Filters::Exponential<0>,
601 : tmpl::list<gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
602 : gh::Tags::Pi<DataVector, volume_dim>,
603 : gh::Tags::Phi<DataVector, volume_dim>>>>;
604 :
605 0 : using initialization_actions = tmpl::list<
606 : Initialization::Actions::InitializeItems<
607 : Initialization::TimeStepping<EvolutionMetavars, TimeStepperBase>,
608 : evolution::dg::Initialization::Domain<EvolutionMetavars,
609 : use_control_systems>,
610 : ::amr::Initialization::Initialize<volume_dim, EvolutionMetavars>,
611 : Initialization::TimeStepperHistory<EvolutionMetavars>>,
612 : Initialization::Actions::NonconservativeSystem<system>,
613 : Initialization::Actions::AddComputeTags<tmpl::list<::Tags::DerivCompute<
614 : typename system::variables_tag, ::domain::Tags::Mesh<volume_dim>,
615 : ::domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
616 : Frame::Inertial>,
617 : typename system::gradient_variables>>>,
618 : gh::Actions::InitializeGhAnd3Plus1Variables<volume_dim>,
619 : Initialization::Actions::AddComputeTags<
620 : tmpl::push_back<StepChoosers::step_chooser_compute_tags<
621 : EvolutionMetavars, local_time_stepping>>>,
622 : ::evolution::dg::Initialization::Mortars<volume_dim, system>,
623 : intrp::Actions::ElementInitInterpPoints<volume_dim,
624 : interpolation_target_tags>,
625 : evolution::Actions::InitializeRunEventsAndDenseTriggers,
626 : control_system::Actions::InitializeMeasurements<control_systems>,
627 : Parallel::Actions::TerminatePhase>;
628 :
629 0 : using gh_dg_element_array = DgElementArray<
630 : EvolutionMetavars,
631 : tmpl::flatten<tmpl::list<
632 : Parallel::PhaseActions<Parallel::Phase::Initialization,
633 : initialization_actions>,
634 : Parallel::PhaseActions<
635 : Parallel::Phase::RegisterWithElementDataReader,
636 : tmpl::list<importers::Actions::RegisterWithElementDataReader,
637 : Parallel::Actions::TerminatePhase>>,
638 : Parallel::PhaseActions<
639 : Parallel::Phase::ImportInitialData,
640 : tmpl::list<gh::Actions::SetInitialData,
641 : gh::Actions::ReceiveNumericInitialData,
642 : Parallel::Actions::TerminatePhase>>,
643 : Parallel::PhaseActions<
644 : Parallel::Phase::InitializeInitialDataDependentQuantities,
645 : initialize_initial_data_dependent_quantities_actions>,
646 : Parallel::PhaseActions<Parallel::Phase::Register,
647 : tmpl::list<dg_registration_list,
648 : Parallel::Actions::TerminatePhase>>,
649 : Parallel::PhaseActions<Parallel::Phase::Restart,
650 : tmpl::list<dg_registration_list,
651 : Parallel::Actions::TerminatePhase>>,
652 : Parallel::PhaseActions<
653 : Parallel::Phase::WriteCheckpoint,
654 : tmpl::list<evolution::Actions::RunEventsAndTriggers<
655 : Triggers::WhenToCheck::AtCheckpoints>,
656 : Parallel::Actions::TerminatePhase>>,
657 : Parallel::PhaseActions<
658 : Parallel::Phase::InitializeTimeStepperHistory,
659 : SelfStart::self_start_procedure<step_actions, system>>,
660 : Parallel::PhaseActions<Parallel::Phase::CheckDomain,
661 : tmpl::list<::amr::Actions::SendAmrDiagnostics,
662 : Parallel::Actions::TerminatePhase>>,
663 : Parallel::PhaseActions<
664 : Parallel::Phase::Evolve,
665 : tmpl::flatten<tmpl::list<
666 : ::domain::Actions::CheckFunctionsOfTimeAreReady<volume_dim>,
667 : std::conditional_t<local_time_stepping,
668 : evolution::Actions::RunEventsAndTriggers<
669 : Triggers::WhenToCheck::AtSteps>,
670 : tmpl::list<>>,
671 : evolution::Actions::RunEventsAndTriggers<
672 : Triggers::WhenToCheck::AtSlabs>,
673 : Actions::ChangeSlabSize, step_actions,
674 : Actions::MutateApply<AdvanceTime<>>,
675 : PhaseControl::Actions::ExecutePhaseChange>>>,
676 : Parallel::PhaseActions<
677 : Parallel::Phase::PostFailureCleanup,
678 : tmpl::list<Actions::RunEventsOnFailure<::Tags::Time>,
679 : Parallel::Actions::TerminatePhase>>>>>;
680 :
681 0 : using observed_reduction_data_tags = observers::collect_reduction_data_tags<
682 : tmpl::at<typename factory_creation::factory_classes, Event>>;
683 :
684 : struct registration
685 : : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
686 0 : using element_registrars =
687 : tmpl::map<tmpl::pair<gh_dg_element_array, dg_registration_list>>;
688 : };
689 :
690 0 : using control_system_horizon_metavars =
691 : control_system::metafunctions::horizon_metavars<control_systems>;
692 0 : using control_components =
693 : control_system::control_components<EvolutionMetavars, control_systems>;
694 :
695 0 : static void run_deadlock_analysis_simple_actions(
696 : Parallel::GlobalCache<EvolutionMetavars>& cache,
697 : const std::vector<std::string>& deadlocked_components) {
698 : gh::deadlock::run_deadlock_analysis_simple_actions<
699 : gh_dg_element_array, control_components, interpolation_target_tags,
700 : control_system_horizon_metavars, false>(cache, deadlocked_components);
701 : }
702 :
703 0 : struct amr : tt::ConformsTo<::amr::protocols::AmrMetavariables> {
704 0 : using element_array = gh_dg_element_array;
705 0 : using projectors = tmpl::list<
706 : Initialization::ProjectTimeStepping<volume_dim>,
707 : evolution::dg::Initialization::ProjectDomain<volume_dim>,
708 : ::amr::projectors::ProjectVariables<volume_dim,
709 : typename system::variables_tag>,
710 : evolution::dg::Initialization::ProjectMortars<EvolutionMetavars>,
711 : Initialization::ProjectTimeStepperHistory<EvolutionMetavars>,
712 : evolution::Actions::ProjectRunEventsAndDenseTriggers,
713 : ::amr::projectors::DefaultInitialize<
714 : Initialization::Tags::InitialTimeDelta,
715 : Initialization::Tags::InitialSlabSize<local_time_stepping>,
716 : ::domain::Tags::InitialExtents<volume_dim>,
717 : ::domain::Tags::InitialRefinementLevels<volume_dim>,
718 : evolution::dg::Tags::Quadrature,
719 : Tags::StepperErrors<typename system::variables_tag>,
720 : SelfStart::Tags::InitialValue<typename system::variables_tag>,
721 : SelfStart::Tags::InitialValue<Tags::TimeStep>>,
722 : ::amr::projectors::CopyFromCreatorOrLeaveAsIs<tmpl::push_back<
723 : tmpl::append<
724 : typename control_system::Actions::InitializeMeasurements<
725 : control_systems>::simple_tags,
726 : tmpl::transform<
727 : intrp::InterpolationTarget_detail::
728 : get_non_sequential_target_tags<
729 : interpolation_target_tags>,
730 : tmpl::bind<intrp::Tags::PointInfo, tmpl::_1,
731 : tmpl::pin<tmpl::size_t<volume_dim>>>>>,
732 : Tags::ChangeSlabSize::NumberOfExpectedMessages,
733 : Tags::ChangeSlabSize::NewSlabSize>>>;
734 0 : static constexpr bool keep_coarse_grids = false;
735 0 : static constexpr bool p_refine_only_in_event = true;
736 : };
737 :
738 0 : using component_list = tmpl::flatten<tmpl::list<
739 : ::amr::Component<EvolutionMetavars>,
740 : observers::Observer<EvolutionMetavars>,
741 : observers::ObserverWriter<EvolutionMetavars>,
742 : importers::ElementDataReader<EvolutionMetavars>,
743 : mem_monitor::MemoryMonitor<EvolutionMetavars>,
744 : ah::Component<EvolutionMetavars, AhA>,
745 : ah::Component<EvolutionMetavars, AhB>,
746 : ah::Component<EvolutionMetavars, AhC>,
747 : tmpl::transform<
748 : control_system_horizon_metavars,
749 : tmpl::bind<ah::Component, tmpl::pin<EvolutionMetavars>, tmpl::_1>>,
750 : tmpl::transform<interpolation_target_tags,
751 : tmpl::bind<intrp::InterpolationTarget,
752 : tmpl::pin<EvolutionMetavars>, tmpl::_1>>,
753 : control_system::control_components<EvolutionMetavars, control_systems>,
754 : gh_dg_element_array>>;
755 :
756 : static constexpr Options::String help{
757 : "Evolve a binary black hole using the Generalized Harmonic "
758 : "formulation\n"};
759 : };
|