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