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

Generated by: LCOV version 1.14