SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Executables/CurvedScalarWave - EvolveWorldtubeCurvedScalarWave.hpp Hit Total Coverage
Commit: aabde07399ba7837e5db64eedfd0a21f31f96922 Lines: 0 29 0.0 %
Date: 2024-04-26 02:38:13
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 <cstddef>
       7             : #include <cstdint>
       8             : #include <vector>
       9             : 
      10             : #include "Domain/Creators/Factory3D.hpp"
      11             : #include "Domain/Creators/RegisterDerivedWithCharm.hpp"
      12             : #include "Domain/Creators/TimeDependence/RegisterDerivedWithCharm.hpp"
      13             : #include "Domain/ElementDistribution.hpp"
      14             : #include "Domain/FunctionsOfTime/RegisterDerivedWithCharm.hpp"
      15             : #include "Domain/Tags.hpp"
      16             : #include "Domain/TagsTimeDependent.hpp"
      17             : #include "Evolution/Actions/RunEventsAndDenseTriggers.hpp"
      18             : #include "Evolution/Actions/RunEventsAndTriggers.hpp"
      19             : #include "Evolution/ComputeTags.hpp"
      20             : #include "Evolution/DiscontinuousGalerkin/Actions/ApplyBoundaryCorrections.hpp"
      21             : #include "Evolution/DiscontinuousGalerkin/Actions/ComputeTimeDerivative.hpp"
      22             : #include "Evolution/DiscontinuousGalerkin/DgElementArray.hpp"
      23             : #include "Evolution/DiscontinuousGalerkin/Initialization/Mortars.hpp"
      24             : #include "Evolution/DiscontinuousGalerkin/Initialization/QuadratureTag.hpp"
      25             : #include "Evolution/Initialization/DgDomain.hpp"
      26             : #include "Evolution/Initialization/Evolution.hpp"
      27             : #include "Evolution/Initialization/NonconservativeSystem.hpp"
      28             : #include "Evolution/Initialization/SetVariables.hpp"
      29             : #include "Evolution/Systems/CurvedScalarWave/BackgroundSpacetime.hpp"
      30             : #include "Evolution/Systems/CurvedScalarWave/BoundaryConditions/Factory.hpp"
      31             : #include "Evolution/Systems/CurvedScalarWave/BoundaryConditions/Worldtube.hpp"
      32             : #include "Evolution/Systems/CurvedScalarWave/BoundaryCorrections/Factory.hpp"
      33             : #include "Evolution/Systems/CurvedScalarWave/BoundaryCorrections/RegisterDerived.hpp"
      34             : #include "Evolution/Systems/CurvedScalarWave/CalculateGrVars.hpp"
      35             : #include "Evolution/Systems/CurvedScalarWave/Constraints.hpp"
      36             : #include "Evolution/Systems/CurvedScalarWave/Initialize.hpp"
      37             : #include "Evolution/Systems/CurvedScalarWave/PsiSquared.hpp"
      38             : #include "Evolution/Systems/CurvedScalarWave/System.hpp"
      39             : #include "Evolution/Systems/CurvedScalarWave/Tags.hpp"
      40             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/InitializeConstraintGammas.hpp"
      41             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/ReceiveWorldtubeData.hpp"
      42             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/SendToWorldtube.hpp"
      43             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/Tags.hpp"
      44             : #include "Evolution/Tags/Filter.hpp"
      45             : #include "IO/Observer/Actions/RegisterEvents.hpp"
      46             : #include "IO/Observer/Helpers.hpp"
      47             : #include "IO/Observer/ObserverComponent.hpp"
      48             : #include "NumericalAlgorithms/DiscontinuousGalerkin/Formulation.hpp"
      49             : #include "NumericalAlgorithms/DiscontinuousGalerkin/Tags.hpp"
      50             : #include "NumericalAlgorithms/LinearOperators/ExponentialFilter.hpp"
      51             : #include "Options/Protocols/FactoryCreation.hpp"
      52             : #include "Options/String.hpp"
      53             : #include "Parallel/Local.hpp"
      54             : #include "Parallel/Phase.hpp"
      55             : #include "Parallel/PhaseControl/CheckpointAndExitAfterWallclock.hpp"
      56             : #include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
      57             : #include "Parallel/PhaseControl/VisitAndReturn.hpp"
      58             : #include "Parallel/PhaseDependentActionList.hpp"
      59             : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
      60             : #include "Parallel/Reduction.hpp"
      61             : #include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
      62             : #include "ParallelAlgorithms/Actions/AddSimpleTags.hpp"
      63             : #include "ParallelAlgorithms/Actions/FilterAction.hpp"
      64             : #include "ParallelAlgorithms/Actions/InitializeItems.hpp"
      65             : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
      66             : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
      67             : #include "ParallelAlgorithms/Events/Factory.hpp"
      68             : #include "ParallelAlgorithms/Events/ObserveNorms.hpp"
      69             : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTrigger.hpp"
      70             : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTriggers/Factory.hpp"
      71             : #include "ParallelAlgorithms/EventsAndTriggers/Completion.hpp"
      72             : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
      73             : #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
      74             : #include "ParallelAlgorithms/EventsAndTriggers/LogicalTriggers.hpp"
      75             : #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
      76             : #include "ParallelAlgorithms/Interpolation/Actions/ElementInitInterpPoints.hpp"
      77             : #include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
      78             : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorRegisterElement.hpp"
      79             : #include "ParallelAlgorithms/Interpolation/Callbacks/ObserveLineSegment.hpp"
      80             : #include "ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp"
      81             : #include "ParallelAlgorithms/Interpolation/Events/InterpolateWithoutInterpComponent.hpp"
      82             : #include "ParallelAlgorithms/Interpolation/InterpolationTarget.hpp"
      83             : #include "ParallelAlgorithms/Interpolation/PointInfoTag.hpp"
      84             : #include "ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp"
      85             : #include "ParallelAlgorithms/Interpolation/Protocols/PostInterpolationCallback.hpp"
      86             : #include "ParallelAlgorithms/Interpolation/Tags.hpp"
      87             : #include "ParallelAlgorithms/Interpolation/Targets/LineSegment.hpp"
      88             : #include "ParallelAlgorithms/Interpolation/Targets/Sphere.hpp"
      89             : #include "PointwiseFunctions/AnalyticData/AnalyticData.hpp"
      90             : #include "PointwiseFunctions/AnalyticData/CurvedWaveEquation/PureSphericalHarmonic.hpp"
      91             : #include "PointwiseFunctions/AnalyticData/Tags.hpp"
      92             : #include "PointwiseFunctions/AnalyticSolutions/AnalyticSolution.hpp"
      93             : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrHorizon.hpp"
      94             : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp"
      95             : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Minkowski.hpp"
      96             : #include "PointwiseFunctions/AnalyticSolutions/Tags.hpp"
      97             : #include "PointwiseFunctions/AnalyticSolutions/WaveEquation/PlaneWave.hpp"
      98             : #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp"
      99             : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp"
     100             : #include "PointwiseFunctions/MathFunctions/Factory.hpp"
     101             : #include "PointwiseFunctions/MathFunctions/MathFunction.hpp"
     102             : #include "Time/Actions/AdvanceTime.hpp"
     103             : #include "Time/Actions/RecordTimeStepperData.hpp"
     104             : #include "Time/Actions/SelfStartActions.hpp"
     105             : #include "Time/Actions/UpdateU.hpp"
     106             : #include "Time/ChangeSlabSize/Action.hpp"
     107             : #include "Time/StepChoosers/ByBlock.hpp"
     108             : #include "Time/StepChoosers/Factory.hpp"
     109             : #include "Time/StepChoosers/StepChooser.hpp"
     110             : #include "Time/Tags/Time.hpp"
     111             : #include "Time/Tags/TimeStepId.hpp"
     112             : #include "Time/TimeSteppers/Factory.hpp"
     113             : #include "Time/TimeSteppers/LtsTimeStepper.hpp"
     114             : #include "Time/TimeSteppers/TimeStepper.hpp"
     115             : #include "Time/Triggers/TimeTriggers.hpp"
     116             : #include "Utilities/ErrorHandling/Error.hpp"
     117             : #include "Utilities/ProtocolHelpers.hpp"
     118             : #include "Utilities/Serialization/RegisterDerivedClassesWithCharm.hpp"
     119             : #include "Utilities/TMPL.hpp"
     120             : 
     121             : /// \cond
     122             : namespace Frame {
     123             : struct Inertial;
     124             : }  // namespace Frame
     125             : namespace Parallel {
     126             : template <typename Metavariables>
     127             : class CProxy_GlobalCache;
     128             : }  // namespace Parallel
     129             : namespace PUP {
     130             : class er;
     131             : }  // namespace PUP
     132             : /// \endcond
     133             : 
     134             : template <typename BackgroundSpacetime, typename InitialData>
     135             : struct EvolutionMetavars {
     136             :   static constexpr size_t volume_dim = 3;
     137           0 :   using background_spacetime = BackgroundSpacetime;
     138             :   static_assert(
     139             :       is_analytic_data_v<InitialData> xor is_analytic_solution_v<InitialData>,
     140             :       "initial_data must be either an analytic_data or an analytic_solution");
     141             : 
     142           0 :   using system = CurvedScalarWave::System<volume_dim>;
     143           0 :   using temporal_id = Tags::TimeStepId;
     144             :   // LTS not implemented yet
     145           0 :   using TimeStepperBase = TimeStepper;
     146             : 
     147             :   static constexpr bool local_time_stepping =
     148             :       TimeStepperBase::local_time_stepping;
     149             : 
     150           0 :   using analytic_solution_fields = typename system::variables_tag::tags_list;
     151           0 :   using deriv_compute = ::Tags::DerivCompute<
     152             :       typename system::variables_tag, domain::Tags::Mesh<volume_dim>,
     153             :       domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
     154             :                                     Frame::Inertial>,
     155             :       typename system::gradient_variables>;
     156             : 
     157           0 :   using observe_fields = tmpl::push_back<
     158             :       tmpl::flatten<tmpl::list<
     159             :           tmpl::append<typename system::variables_tag::tags_list,
     160             :                        typename deriv_compute::type::tags_list>,
     161             :           ::Events::Tags::ObserverDetInvJacobianCompute<Frame::ElementLogical,
     162             :                                                         Frame::Inertial>,
     163             :           CurvedScalarWave::Tags::OneIndexConstraintCompute<volume_dim>,
     164             :           CurvedScalarWave::Tags::TwoIndexConstraintCompute<volume_dim>>>,
     165             :       domain::Tags::Coordinates<volume_dim, Frame::Grid>,
     166             :       domain::Tags::Coordinates<volume_dim, Frame::Inertial>>;
     167           0 :   using non_tensor_compute_tags =
     168             :       tmpl::list<::Events::Tags::ObserverMeshCompute<volume_dim>,
     169             :                  deriv_compute>;
     170             : 
     171             :   template <size_t Number>
     172           0 :   struct PsiAlongAxis
     173             :       : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
     174           0 :     static std::string name() {
     175             :       return "PsiAlongAxis" + std::to_string(Number);
     176             :     }
     177           0 :     using temporal_id = ::Tags::Time;
     178           0 :     using vars_to_interpolate_to_target =
     179             :         tmpl::list<CurvedScalarWave::Tags::Psi,
     180             :                    domain::Tags::Coordinates<volume_dim, Frame::Inertial>>;
     181           0 :     using compute_items_on_target = tmpl::list<>;
     182           0 :     using compute_target_points =
     183             :         intrp::TargetPoints::LineSegment<PsiAlongAxis<Number>, volume_dim,
     184             :                                          Frame::Grid>;
     185           0 :     using post_interpolation_callbacks =
     186             :         tmpl::list<intrp::callbacks::ObserveLineSegment<
     187             :             vars_to_interpolate_to_target, PsiAlongAxis<Number>>>;
     188             :     template <typename metavariables>
     189           0 :     using interpolating_component = typename metavariables::dg_element_array;
     190             :   };
     191             : 
     192           0 :   using interpolation_target_tags =
     193             :       tmpl::list<PsiAlongAxis<1>, PsiAlongAxis<2>>;
     194           0 :   using interpolator_source_vars =
     195             :       tmpl::list<CurvedScalarWave::Tags::Psi,
     196             :                  domain::Tags::Coordinates<volume_dim, Frame::Inertial>>;
     197             : 
     198             :   struct factory_creation
     199             :       : tt::ConformsTo<Options::protocols::FactoryCreation> {
     200           0 :     using factory_classes = tmpl::map<
     201             :         tmpl::pair<
     202             :             CurvedScalarWave::BoundaryConditions::BoundaryCondition<volume_dim>,
     203             :             tmpl::flatten<tmpl::list<
     204             :                 CurvedScalarWave::BoundaryConditions::
     205             :                     standard_boundary_conditions<volume_dim>,
     206             :                 CurvedScalarWave::BoundaryConditions::Worldtube<volume_dim>>>>,
     207             :         tmpl::pair<DenseTrigger, DenseTriggers::standard_dense_triggers>,
     208             :         tmpl::pair<DomainCreator<volume_dim>, domain_creators<volume_dim>>,
     209             :         tmpl::pair<
     210             :             Event,
     211             :             tmpl::flatten<tmpl::list<
     212             :                 Events::time_events<system>, Events::Completion,
     213             :                 intrp::Events::InterpolateWithoutInterpComponent<
     214             :                     volume_dim, PsiAlongAxis<1>, interpolator_source_vars>,
     215             :                 intrp::Events::InterpolateWithoutInterpComponent<
     216             :                     volume_dim, PsiAlongAxis<2>, interpolator_source_vars>,
     217             :                 dg::Events::field_observations<volume_dim, observe_fields,
     218             :                                                non_tensor_compute_tags>>>>,
     219             :         tmpl::pair<MathFunction<1, Frame::Inertial>,
     220             :                    MathFunctions::all_math_functions<1, Frame::Inertial>>,
     221             :         tmpl::pair<PhaseChange,
     222             :                    tmpl::list<PhaseControl::VisitAndReturn<
     223             :                                   Parallel::Phase::LoadBalancing>,
     224             :                               PhaseControl::CheckpointAndExitAfterWallclock>>,
     225             : 
     226             :         tmpl::pair<StepChooser<StepChooserUse::Slab>,
     227             :                    tmpl::push_back<StepChoosers::standard_slab_choosers<
     228             :                                        system, local_time_stepping>,
     229             :                                    StepChoosers::ByBlock<StepChooserUse::Slab,
     230             :                                                          volume_dim>>>,
     231             :         tmpl::pair<TimeSequence<double>,
     232             :                    TimeSequences::all_time_sequences<double>>,
     233             :         tmpl::pair<TimeSequence<std::uint64_t>,
     234             :                    TimeSequences::all_time_sequences<std::uint64_t>>,
     235             :         tmpl::pair<TimeStepper, TimeSteppers::time_steppers>,
     236             :         tmpl::pair<Trigger, tmpl::append<Triggers::logical_triggers,
     237             :                                          Triggers::time_triggers>>>;
     238             :   };
     239           0 :   using observed_reduction_data_tags = observers::collect_reduction_data_tags<
     240             :       tmpl::at<typename factory_creation::factory_classes, Event>>;
     241             :   static constexpr bool use_filtering = true;
     242             : 
     243           0 :   using step_actions = tmpl::flatten<tmpl::list<
     244             :       CurvedScalarWave::Actions::CalculateGrVars<system, true>,
     245             :       CurvedScalarWave::Worldtube::Actions::SendToWorldtube,
     246             :       CurvedScalarWave::Worldtube::Actions::ReceiveWorldtubeData,
     247             :       evolution::dg::Actions::ComputeTimeDerivative<
     248             :           volume_dim, system, AllStepChoosers, local_time_stepping>,
     249             :       evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
     250             :           system, volume_dim, false>,
     251             :       Actions::RecordTimeStepperData<system>,
     252             :       evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<>>,
     253             :       Actions::UpdateU<system>,
     254             :       tmpl::conditional_t<
     255             :           use_filtering,
     256             :           dg::Actions::Filter<
     257             :               Filters::Exponential<0>,
     258             :               tmpl::list<CurvedScalarWave::Tags::Psi,
     259             :                          CurvedScalarWave::Tags::Pi,
     260             :                          CurvedScalarWave::Tags::Phi<volume_dim>>>,
     261             :           tmpl::list<>>>>;
     262             : 
     263           0 :   using const_global_cache_tags = tmpl::list<
     264             :       CurvedScalarWave::Tags::BackgroundSpacetime<BackgroundSpacetime>,
     265             :       Tags::AnalyticData<InitialData>,
     266             :       CurvedScalarWave::Worldtube::Tags::ExcisionSphere<volume_dim>,
     267             :       CurvedScalarWave::Worldtube::Tags::ExpansionOrder,
     268             :       CurvedScalarWave::Worldtube::Tags::Charge,
     269             :       CurvedScalarWave::Worldtube::Tags::Mass,
     270             :       CurvedScalarWave::Worldtube::Tags::MaxIterations,
     271             :       CurvedScalarWave::Worldtube::Tags::ObserveCoefficientsTrigger>;
     272             : 
     273           0 :   using dg_registration_list =
     274             :       tmpl::list<observers::Actions::RegisterEventsWithObservers>;
     275             : 
     276           0 :   using initialization_actions = tmpl::list<
     277             :       Initialization::Actions::InitializeItems<
     278             :           Initialization::TimeStepping<EvolutionMetavars, TimeStepperBase>,
     279             :           evolution::dg::Initialization::Domain<volume_dim>,
     280             :           Initialization::TimeStepperHistory<EvolutionMetavars>>,
     281             :       Initialization::Actions::NonconservativeSystem<system>,
     282             :       CurvedScalarWave::Actions::CalculateGrVars<system, false>,
     283             :       Initialization::Actions::AddSimpleTags<
     284             :           CurvedScalarWave::Worldtube::Initialization::
     285             :               InitializeConstraintDampingGammas<volume_dim>,
     286             :           CurvedScalarWave::Initialization::InitializeEvolvedVariables<
     287             :               volume_dim>>,
     288             :       Initialization::Actions::AddComputeTags<
     289             :           StepChoosers::step_chooser_compute_tags<EvolutionMetavars,
     290             :                                                   local_time_stepping>>,
     291             :       Initialization::Actions::AddComputeTags<tmpl::list<
     292             :           CurvedScalarWave::Worldtube::Tags::ParticlePositionVelocityCompute<
     293             :               volume_dim>,
     294             :           CurvedScalarWave::Worldtube::Tags::FaceCoordinatesCompute<
     295             :               volume_dim, Frame::Inertial, true>,
     296             :           CurvedScalarWave::Worldtube::Tags::FaceCoordinatesCompute<
     297             :               volume_dim, Frame::Inertial, true>,
     298             :           CurvedScalarWave::Worldtube::Tags::GeodesicAccelerationCompute<3>,
     299             :           CurvedScalarWave::Worldtube::Tags::PunctureFieldCompute<volume_dim>,
     300             :           CurvedScalarWave::Worldtube::Tags::FaceQuantitiesCompute,
     301             :           ::domain::Tags::GridToInertialInverseJacobian<volume_dim>>>,
     302             :       ::evolution::dg::Initialization::Mortars<volume_dim, system>,
     303             :       intrp::Actions::ElementInitInterpPoints<
     304             :           intrp::Tags::InterpPointInfo<EvolutionMetavars>>,
     305             :       evolution::Actions::InitializeRunEventsAndDenseTriggers,
     306             :       Parallel::Actions::TerminatePhase>;
     307             : 
     308           0 :   using dg_element_array = DgElementArray<
     309             :       EvolutionMetavars,
     310             :       tmpl::list<
     311             :           Parallel::PhaseActions<Parallel::Phase::Initialization,
     312             :                                  initialization_actions>,
     313             :           Parallel::PhaseActions<
     314             :               Parallel::Phase::InitializeTimeStepperHistory,
     315             :               SelfStart::self_start_procedure<step_actions, system>>,
     316             :           Parallel::PhaseActions<Parallel::Phase::Register,
     317             :                                  tmpl::list<dg_registration_list,
     318             :                                             Parallel::Actions::TerminatePhase>>,
     319             :           Parallel::PhaseActions<
     320             :               Parallel::Phase::Evolve,
     321             :               tmpl::list<evolution::Actions::RunEventsAndTriggers,
     322             :                          Actions::ChangeSlabSize, step_actions,
     323             :                          Actions::AdvanceTime,
     324             :                          PhaseControl::Actions::ExecutePhaseChange>>>>;
     325             : 
     326             :   struct registration
     327             :       : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
     328           0 :     using element_registrars =
     329             :         tmpl::map<tmpl::pair<dg_element_array, dg_registration_list>>;
     330             :   };
     331             : 
     332           0 :   using component_list = tmpl::flatten<tmpl::list<
     333             :       observers::Observer<EvolutionMetavars>,
     334             :       observers::ObserverWriter<EvolutionMetavars>,
     335             :       intrp::InterpolationTarget<EvolutionMetavars, PsiAlongAxis<1>>,
     336             :       intrp::InterpolationTarget<EvolutionMetavars, PsiAlongAxis<2>>,
     337             :       CurvedScalarWave::Worldtube::WorldtubeSingleton<EvolutionMetavars>,
     338             :       dg_element_array>>;
     339             : 
     340             :   static constexpr Options::String help{
     341             :       "Evolve a scalar point charge in circular orbit around a Schwarzschild "
     342             :       "black hole."};
     343             : 
     344             :   static constexpr std::array<Parallel::Phase, 5> default_phase_order{
     345             :       {Parallel::Phase::Initialization,
     346             :        Parallel::Phase::InitializeTimeStepperHistory, Parallel::Phase::Register,
     347             :        Parallel::Phase::Evolve, Parallel::Phase::Exit}};
     348             : 
     349             :   // NOLINTNEXTLINE(google-runtime-references)
     350           0 :   void pup(PUP::er& /*p*/) {}
     351             : };

Generated by: LCOV version 1.14