SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Executables/GeneralizedHarmonic - EvolveGhAndCharacteristic.hpp Hit Total Coverage
Commit: 3528f39684ab2ee5d689cee48331779e729b0a07 Lines: 0 26 0.0 %
Date: 2024-02-27 07:22:14
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 "Evolution/Actions/RunEventsAndTriggers.hpp"
      10             : #include "Evolution/Executables/Cce/CharacteristicExtractBase.hpp"
      11             : #include "Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp"
      12             : #include "Evolution/Systems/Cce/Actions/SendGhVarsToCce.hpp"
      13             : #include "Evolution/Systems/Cce/Callbacks/SendGhWorldtubeData.hpp"
      14             : #include "Evolution/Systems/Cce/Components/CharacteristicEvolution.hpp"
      15             : #include "Evolution/Systems/Cce/Components/WorldtubeBoundary.hpp"
      16             : #include "Evolution/Systems/Cce/Initialize/ConformalFactor.hpp"
      17             : #include "Evolution/Systems/Cce/Initialize/InitializeJ.hpp"
      18             : #include "Evolution/Systems/Cce/Initialize/InverseCubic.hpp"
      19             : #include "Evolution/Systems/Cce/Initialize/NoIncomingRadiation.hpp"
      20             : #include "Evolution/Systems/Cce/Initialize/RegisterInitializeJWithCharm.hpp"
      21             : #include "Evolution/Systems/Cce/Initialize/ZeroNonSmooth.hpp"
      22             : #include "Evolution/Systems/Cce/IntegrandInputSteps.hpp"
      23             : #include "Evolution/Systems/Cce/InterfaceManagers/GhInterfaceManager.hpp"
      24             : #include "Evolution/Systems/Cce/InterfaceManagers/GhLocalTimeStepping.hpp"
      25             : #include "Evolution/Systems/Cce/InterfaceManagers/GhLockstep.hpp"
      26             : #include "Evolution/Systems/Cce/OptionTags.hpp"
      27             : #include "Evolution/Systems/Cce/System.hpp"
      28             : #include "Evolution/Systems/Cce/Tags.hpp"
      29             : #include "Evolution/Systems/Cce/WorldtubeBufferUpdater.hpp"
      30             : #include "Evolution/Systems/Cce/WorldtubeDataManager.hpp"
      31             : #include "Evolution/Tags/Filter.hpp"
      32             : #include "Options/FactoryHelpers.hpp"
      33             : #include "Options/Protocols/FactoryCreation.hpp"
      34             : #include "Options/String.hpp"
      35             : #include "Parallel/MemoryMonitor/MemoryMonitor.hpp"
      36             : #include "Parallel/PhaseControl/PhaseControlTags.hpp"
      37             : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
      38             : #include "ParallelAlgorithms/Interpolation/Actions/CleanUpInterpolator.hpp"
      39             : #include "ParallelAlgorithms/Interpolation/Actions/ElementInitInterpPoints.hpp"
      40             : #include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
      41             : #include "ParallelAlgorithms/Interpolation/Actions/InterpolationTargetReceiveVars.hpp"
      42             : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceivePoints.hpp"
      43             : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceiveVolumeData.hpp"
      44             : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorRegisterElement.hpp"
      45             : #include "ParallelAlgorithms/Interpolation/Actions/TryToInterpolate.hpp"
      46             : #include "ParallelAlgorithms/Interpolation/Events/Interpolate.hpp"
      47             : #include "ParallelAlgorithms/Interpolation/Events/InterpolateWithoutInterpComponent.hpp"
      48             : #include "ParallelAlgorithms/Interpolation/InterpolationTarget.hpp"
      49             : #include "ParallelAlgorithms/Interpolation/Interpolator.hpp"
      50             : #include "ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp"
      51             : #include "ParallelAlgorithms/Interpolation/Targets/KerrHorizon.hpp"
      52             : #include "ParallelAlgorithms/Interpolation/Targets/Sphere.hpp"
      53             : #include "Time/Tags/TimeStepId.hpp"
      54             : #include "Utilities/ErrorHandling/Error.hpp"
      55             : #include "Utilities/ProtocolHelpers.hpp"
      56             : 
      57             : /// \cond
      58             : namespace Frame {
      59             : // IWYU pragma: no_forward_declare MathFunction
      60             : struct Inertial;
      61             : }  // namespace Frame
      62             : namespace Parallel {
      63             : template <typename Metavariables>
      64             : class CProxy_GlobalCache;
      65             : }  // namespace Parallel
      66             : /// \endcond
      67             : 
      68             : template <bool EvolveCcm>
      69             : struct EvolutionMetavars : public GeneralizedHarmonicTemplateBase<3>,
      70             :                            public CharacteristicExtractDefaults<EvolveCcm> {
      71             :   static constexpr size_t volume_dim = 3;
      72           0 :   using cce_base = CharacteristicExtractDefaults<EvolveCcm>;
      73           0 :   using gh_base = GeneralizedHarmonicTemplateBase<volume_dim>;
      74           0 :   using typename gh_base::initialize_initial_data_dependent_quantities_actions;
      75           0 :   using cce_boundary_component = Cce::GhWorldtubeBoundary<EvolutionMetavars>;
      76             : 
      77           0 :   using TimeStepperBase = typename gh_base::TimeStepperBase;
      78             :   static constexpr bool local_time_stepping = gh_base::local_time_stepping;
      79             : 
      80             :   template <bool DuringSelfStart>
      81             :   struct CceWorldtubeTarget;
      82             : 
      83           0 :   using interpolator_source_vars =
      84             :       tmpl::list<::gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
      85             :                  ::gh::Tags::Phi<DataVector, volume_dim>,
      86             :                  ::gh::Tags::Pi<DataVector, volume_dim>>;
      87             : 
      88           0 :   using dg_registration_list =
      89             :       tmpl::push_back<typename gh_base::dg_registration_list,
      90             :                       intrp::Actions::RegisterElementWithInterpolator>;
      91             : 
      92           0 :   using typename gh_base::system;
      93             : 
      94           0 :   using dg_step_choosers = tmpl::flatten<tmpl::list<
      95             :       StepChoosers::standard_step_choosers<system>,
      96             :       StepChoosers::standard_slab_choosers<system, local_time_stepping>>>;
      97             : 
      98             :   template <bool DuringSelfStart>
      99           0 :   using step_actions = tmpl::list<
     100             :       tmpl::conditional_t<
     101             :           DuringSelfStart,
     102             :           Cce::Actions::SendGhVarsToCce<CceWorldtubeTarget<true>>,
     103             :           Cce::Actions::SendGhVarsToCce<CceWorldtubeTarget<false>>>,
     104             :       evolution::dg::Actions::ComputeTimeDerivative<
     105             :           volume_dim, system, dg_step_choosers, local_time_stepping>,
     106             :       tmpl::conditional_t<
     107             :           local_time_stepping,
     108             :           tmpl::list<evolution::Actions::RunEventsAndDenseTriggers<
     109             :                          tmpl::list<evolution::dg::ApplyBoundaryCorrections<
     110             :                              local_time_stepping, system, volume_dim, true>>>,
     111             :                      evolution::dg::Actions::ApplyLtsBoundaryCorrections<
     112             :                          system, volume_dim, false>>,
     113             :           tmpl::list<
     114             :               evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
     115             :                   system, volume_dim, false>,
     116             :               Actions::RecordTimeStepperData<system>,
     117             :               evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<>>,
     118             :               Actions::UpdateU<system>,
     119             :               dg::Actions::Filter<
     120             :                   Filters::Exponential<0>,
     121             :                   tmpl::list<gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
     122             :                              gh::Tags::Pi<DataVector, volume_dim>,
     123             :                              gh::Tags::Phi<DataVector, volume_dim>>>>>>;
     124             : 
     125             :   using typename cce_base::cce_step_choosers;
     126             :   struct factory_creation
     127             :       : tt::ConformsTo<Options::protocols::FactoryCreation> {
     128           0 :     using factory_classes = Options::add_factory_classes<
     129             :         typename gh_base::factory_creation::factory_classes,
     130             :         tmpl::pair<StepChooser<StepChooserUse::LtsStep>, cce_step_choosers>>;
     131             :   };
     132             : 
     133             :   // initialization actions are the same as the default, with the single
     134             :   // addition of initializing the interpolation points (second-to-last action).
     135           0 :   using initialization_actions = tmpl::list<
     136             :       Initialization::Actions::InitializeItems<
     137             :           Initialization::TimeStepping<EvolutionMetavars, TimeStepperBase>,
     138             :           evolution::dg::Initialization::Domain<volume_dim>,
     139             :           Initialization::TimeStepperHistory<EvolutionMetavars>>,
     140             :       Initialization::Actions::NonconservativeSystem<system>,
     141             :       Initialization::Actions::AddComputeTags<::Tags::DerivCompute<
     142             :           typename system::variables_tag,
     143             :           domain::Tags::Mesh<volume_dim>,
     144             :           domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
     145             :                                         Frame::Inertial>,
     146             :           typename system::gradient_variables>>,
     147             :       gh::Actions::InitializeGhAnd3Plus1Variables<volume_dim>,
     148             :       Initialization::Actions::AddComputeTags<
     149             :           tmpl::push_back<StepChoosers::step_chooser_compute_tags<
     150             :               EvolutionMetavars, local_time_stepping>>>,
     151             :       ::evolution::dg::Initialization::Mortars<volume_dim, system>,
     152             :       evolution::Actions::InitializeRunEventsAndDenseTriggers,
     153             :       intrp::Actions::ElementInitInterpPoints<
     154             :           intrp::Tags::InterpPointInfo<EvolutionMetavars>>,
     155             :       Parallel::Actions::TerminatePhase>;
     156             : 
     157           0 :   using gh_dg_element_array = DgElementArray<
     158             :       EvolutionMetavars,
     159             :       tmpl::flatten<tmpl::list<
     160             :           Parallel::PhaseActions<Parallel::Phase::Initialization,
     161             :                                  initialization_actions>,
     162             :           Parallel::PhaseActions<
     163             :               Parallel::Phase::RegisterWithElementDataReader,
     164             :               tmpl::list<importers::Actions::RegisterWithElementDataReader,
     165             :                          Parallel::Actions::TerminatePhase>>,
     166             :           Parallel::PhaseActions<
     167             :               Parallel::Phase::ImportInitialData,
     168             :               tmpl::list<gh::Actions::SetInitialData,
     169             :                          gh::Actions::ReceiveNumericInitialData,
     170             :                          Parallel::Actions::TerminatePhase>>,
     171             :           Parallel::PhaseActions<
     172             :               Parallel::Phase::InitializeInitialDataDependentQuantities,
     173             :               initialize_initial_data_dependent_quantities_actions>,
     174             :           Parallel::PhaseActions<
     175             :               Parallel::Phase::InitializeTimeStepperHistory,
     176             :               SelfStart::self_start_procedure<step_actions<true>, system>>,
     177             :           Parallel::PhaseActions<Parallel::Phase::Register,
     178             :                                  tmpl::list<dg_registration_list,
     179             :                                             Parallel::Actions::TerminatePhase>>,
     180             :           Parallel::PhaseActions<
     181             :               Parallel::Phase::Evolve,
     182             :               tmpl::list<evolution::Actions::RunEventsAndTriggers,
     183             :                          Actions::ChangeSlabSize, step_actions<false>,
     184             :                          Actions::AdvanceTime,
     185             :                          PhaseControl::Actions::ExecutePhaseChange>>>>>;
     186             : 
     187             :   template <bool DuringSelfStart>
     188           0 :   struct CceWorldtubeTarget
     189             :       : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
     190           0 :     using temporal_id = ::Tags::TimeStepId;
     191             : 
     192           0 :     static std::string name() {
     193             :       return DuringSelfStart ? "SelfStartCceWorldtubeTarget"
     194             :                              : "CceWorldtubeTarget";
     195             :     }
     196           0 :     using compute_items_on_source = tmpl::list<>;
     197           0 :     using compute_items_on_target = tmpl::list<>;
     198           0 :     using compute_target_points =
     199             :         intrp::TargetPoints::Sphere<CceWorldtubeTarget, ::Frame::Inertial>;
     200           0 :     using post_interpolation_callbacks =
     201             :         tmpl::list<intrp::callbacks::SendGhWorldtubeData<
     202             :             Cce::CharacteristicEvolution<EvolutionMetavars>, CceWorldtubeTarget,
     203             :             DuringSelfStart, local_time_stepping>>;
     204           0 :     using vars_to_interpolate_to_target = interpolator_source_vars;
     205             :     template <typename Metavariables>
     206           0 :     using interpolating_component = gh_dg_element_array;
     207             :   };
     208             : 
     209           0 :   using interpolation_target_tags =
     210             :       tmpl::list<CceWorldtubeTarget<false>, CceWorldtubeTarget<true>>;
     211             : 
     212             :   struct registration
     213             :       : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
     214           0 :     using element_registrars =
     215             :         tmpl::map<tmpl::pair<gh_dg_element_array, dg_registration_list>>;
     216             :   };
     217             : 
     218           0 :   using component_list = tmpl::flatten<tmpl::list<
     219             :       observers::Observer<EvolutionMetavars>,
     220             :       observers::ObserverWriter<EvolutionMetavars>,
     221             :       mem_monitor::MemoryMonitor<EvolutionMetavars>,
     222             :       importers::ElementDataReader<EvolutionMetavars>, gh_dg_element_array,
     223             :       intrp::Interpolator<EvolutionMetavars>,
     224             :       tmpl::transform<interpolation_target_tags,
     225             :                       tmpl::bind<intrp::InterpolationTarget,
     226             :                                  tmpl::pin<EvolutionMetavars>, tmpl::_1>>,
     227             :       cce_boundary_component, Cce::CharacteristicEvolution<EvolutionMetavars>>>;
     228             : 
     229             :   static constexpr Options::String help{
     230             :       "Evolve the Einstein field equations using the Generalized Harmonic "
     231             :       "formulation\n"
     232             :       "with a coupled CCE evolution for asymptotic wave data output.\n"
     233             :       "The system shouldn't have black holes."};
     234             : };

Generated by: LCOV version 1.14