SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/CurvedScalarWave/Worldtube - SingletonChare.hpp Hit Total Coverage
Commit: 9478b377b8678e85031859810205323c5f2fef1d Lines: 1 19 5.3 %
Date: 2024-05-08 02:31:17
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 "DataStructures/DataBox/DataBox.hpp"
       7             : #include "DataStructures/DataBox/Tag.hpp"
       8             : #include "Evolution/Initialization/Evolution.hpp"
       9             : #include "Evolution/Systems/CurvedScalarWave/Tags.hpp"
      10             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/ChangeSlabSize.hpp"
      11             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/InitializeElementFacesGridCoordinates.hpp"
      12             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/InitializeEvolvedVariables.hpp"
      13             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/IterateAccelerationTerms.hpp"
      14             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/ObserveWorldtubeSolution.hpp"
      15             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/ReceiveElementData.hpp"
      16             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/SendToElements.hpp"
      17             : #include "Evolution/Systems/CurvedScalarWave/Worldtube/SingletonActions/UpdateAcceleration.hpp"
      18             : #include "IO/Observer/Actions/RegisterSingleton.hpp"
      19             : #include "Options/String.hpp"
      20             : #include "Parallel/Algorithms/AlgorithmSingleton.hpp"
      21             : #include "Parallel/GlobalCache.hpp"
      22             : #include "Parallel/Invoke.hpp"
      23             : #include "Parallel/ParallelComponentHelpers.hpp"
      24             : #include "Parallel/PhaseDependentActionList.hpp"
      25             : #include "Parallel/Tags/ResourceInfo.hpp"
      26             : #include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
      27             : #include "ParallelAlgorithms/Actions/InitializeItems.hpp"
      28             : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
      29             : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
      30             : #include "Time/Actions/AdvanceTime.hpp"
      31             : #include "Time/Actions/RecordTimeStepperData.hpp"
      32             : #include "Time/Actions/SelfStartActions.hpp"
      33             : #include "Time/Actions/UpdateU.hpp"
      34             : #include "Time/SelfStart.hpp"
      35             : #include "Utilities/System/ParallelInfo.hpp"
      36             : 
      37             : namespace CurvedScalarWave::Worldtube {
      38             : 
      39           0 : struct Registration {
      40             :   template <typename ParallelComponent, typename DbTagsList,
      41             :             typename ArrayIndex>
      42             :   static std::pair<observers::TypeOfObservation, observers::ObservationKey>
      43           0 :   register_info(const db::DataBox<DbTagsList>& /*box*/,
      44             :                 const ArrayIndex& /*array_index*/) {
      45             :     return {observers::TypeOfObservation::Reduction,
      46             :             observers::ObservationKey{"/Worldtube"}};
      47             :   }
      48             : };
      49             : 
      50             : /*!
      51             :  * \brief The singleton component that represents the worldtube.
      52             :  *
      53             :  * \details The component receives from and sends data to the elements abutting
      54             :  * the worldtube. It holds and calculates a solution for the regular field
      55             :  * \f$\Psi^R\f$ which valid in a neighborhood of the scalar charge.
      56             :  */
      57             : template <class Metavariables>
      58           1 : struct WorldtubeSingleton {
      59           0 :   static constexpr size_t Dim = Metavariables::volume_dim;
      60           0 :   using chare_type = ::Parallel::Algorithms::Singleton;
      61           0 :   using metavariables = Metavariables;
      62           0 :   using evolved_vars = ::Tags::Variables<
      63             :       tmpl::list<CurvedScalarWave::Tags::Psi, CurvedScalarWave::Tags::Pi>>;
      64             :   // LTS not currently supported
      65           0 :   using TimeStepperBase = TimeStepper;
      66             : 
      67           0 :   static constexpr bool local_time_stepping =
      68             :       TimeStepperBase::local_time_stepping;
      69             : 
      70           0 :   using initialization_actions = tmpl::list<
      71             :       ::Initialization::Actions::InitializeItems<
      72             :           ::Initialization::TimeStepping<Metavariables, TimeStepperBase>,
      73             :           Initialization::InitializeEvolvedVariables,
      74             :           Initialization::InitializeElementFacesGridCoordinates<Dim>>,
      75             :       ::Initialization::Actions::AddComputeTags<
      76             :           tmpl::list<Tags::EvolvedParticlePositionVelocityCompute<Dim>,
      77             :                      Tags::GeodesicAccelerationCompute<Dim>,
      78             :                      Tags::BackgroundQuantitiesCompute<Dim>>>,
      79             :       Parallel::Actions::TerminatePhase>;
      80             : 
      81           0 :   struct worldtube_system {
      82           0 :     static constexpr size_t volume_dim = Dim;
      83           0 :     static constexpr bool has_primitive_and_conservative_vars = false;
      84           0 :     using variables_tag = ::Tags::Variables<
      85             :         tmpl::list<Tags::EvolvedPosition<Dim>, Tags::EvolvedVelocity<Dim>>>;
      86             :   };
      87           0 :   using step_actions =
      88             :       tmpl::list<Actions::ChangeSlabSize, Actions::ReceiveElementData,
      89             :                  Actions::IterateAccelerationTerms<Metavariables>,
      90             :                  ::Actions::MutateApply<UpdateAcceleration>,
      91             :                  ::Actions::RecordTimeStepperData<worldtube_system>,
      92             :                  ::Actions::UpdateU<worldtube_system>,
      93             :                  Actions::SendToElements<Metavariables>>;
      94           0 :   using phase_dependent_action_list = tmpl::list<
      95             :       Parallel::PhaseActions<Parallel::Phase::Initialization,
      96             :                              initialization_actions>,
      97             :       Parallel::PhaseActions<
      98             :           Parallel::Phase::InitializeTimeStepperHistory,
      99             :           SelfStart::self_start_procedure<step_actions, worldtube_system>>,
     100             :       Parallel::PhaseActions<
     101             :           Parallel::Phase::Register,
     102             :           tmpl::list<observers::Actions::RegisterSingletonWithObserverWriter<
     103             :                          Registration>,
     104             :                      Parallel::Actions::TerminatePhase>>,
     105             :       Parallel::PhaseActions<
     106             :           Parallel::Phase::Evolve,
     107             :           tmpl::list<step_actions, Actions::ObserveWorldtubeSolution,
     108             :                      ::Actions::AdvanceTime>>>;
     109             : 
     110           0 :   using simple_tags_from_options = Parallel::get_simple_tags_from_options<
     111             :       Parallel::get_initialization_actions_list<phase_dependent_action_list>>;
     112             : 
     113           0 :   static void execute_next_phase(
     114             :       const typename Parallel::Phase next_phase,
     115             :       Parallel::CProxy_GlobalCache<Metavariables>& global_cache) {
     116             :     auto& local_cache = *Parallel::local_branch(global_cache);
     117             :     Parallel::get_parallel_component<WorldtubeSingleton<metavariables>>(
     118             :         local_cache)
     119             :         .start_phase(next_phase);
     120             :   }
     121             : };
     122             : }  // namespace CurvedScalarWave::Worldtube

Generated by: LCOV version 1.14