SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Executables/GeneralizedHarmonic - EvolveGhBinaryBlackHole.hpp Hit Total Coverage
Commit: 3c072f0ce967e2e56649d3fa12aa2a0e4fe2a42e Lines: 0 70 0.0 %
Date: 2024-04-23 20:50:18
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14