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