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