SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce/Components - CharacteristicEvolution.hpp Hit Total Coverage
Commit: ebec864322c50bab8dca0a90baf8d01875114261 Lines: 1 14 7.1 %
Date: 2020-11-25 20:28:50
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 <type_traits>
       7             : 
       8             : #include "DataStructures/VariablesTag.hpp"
       9             : #include "Evolution/Systems/Cce/Actions/BoundaryComputeAndSendToEvolution.hpp"
      10             : #include "Evolution/Systems/Cce/Actions/CalculateScriInputs.hpp"
      11             : #include "Evolution/Systems/Cce/Actions/CharacteristicEvolutionBondiCalculations.hpp"
      12             : #include "Evolution/Systems/Cce/Actions/FilterSwshVolumeQuantity.hpp"
      13             : #include "Evolution/Systems/Cce/Actions/InitializeCharacteristicEvolutionScri.hpp"
      14             : #include "Evolution/Systems/Cce/Actions/InitializeCharacteristicEvolutionTime.hpp"
      15             : #include "Evolution/Systems/Cce/Actions/InitializeCharacteristicEvolutionVariables.hpp"
      16             : #include "Evolution/Systems/Cce/Actions/InitializeFirstHypersurface.hpp"
      17             : #include "Evolution/Systems/Cce/Actions/InsertInterpolationScriData.hpp"
      18             : #include "Evolution/Systems/Cce/Actions/RequestBoundaryData.hpp"
      19             : #include "Evolution/Systems/Cce/Actions/ScriObserveInterpolated.hpp"
      20             : #include "Evolution/Systems/Cce/Actions/TimeManagement.hpp"
      21             : #include "Evolution/Systems/Cce/Actions/UpdateGauge.hpp"
      22             : #include "Evolution/Systems/Cce/LinearSolve.hpp"
      23             : #include "Evolution/Systems/Cce/PreSwshDerivatives.hpp"
      24             : #include "Evolution/Systems/Cce/PrecomputeCceDependencies.hpp"
      25             : #include "Evolution/Systems/Cce/ScriPlusValues.hpp"
      26             : #include "Evolution/Systems/Cce/SwshDerivatives.hpp"
      27             : #include "IO/Observer/ObserverComponent.hpp"
      28             : #include "Parallel/Actions/SetupDataBox.hpp"
      29             : #include "Parallel/Actions/TerminatePhase.hpp"
      30             : #include "Parallel/GlobalCache.hpp"
      31             : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
      32             : #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
      33             : #include "Time/Actions/AdvanceTime.hpp"
      34             : #include "Time/Actions/RecordTimeStepperData.hpp"
      35             : #include "Time/Actions/UpdateU.hpp"
      36             : #include "Utilities/TMPL.hpp"
      37             : 
      38             : namespace Cce {
      39             : 
      40             : /*!
      41             :  * \brief The component for handling the CCE evolution and waveform output.
      42             :  *
      43             :  * \details The \ref DataBoxGroup associated with the CharacteristicEvolution
      44             :  * will contain many spin-weighted volume tags associated with the ongoing CCE
      45             :  * computation, as well as storage for the boundary values and quantities
      46             :  * related to managing the evolution.
      47             :  *
      48             :  * Metavariables requirements:
      49             :  * - Phases:
      50             :  *  - `Initialization`
      51             :  *  - `Evolve`
      52             :  * - Type aliases:
      53             :  *  - `evolved_coordinates_variables_tag`: A `Tags::Variables` with real-valued
      54             :  * tensors associated with coordinates that must be evolved.
      55             :  *  - `evolved_swsh_tag`: The spin-weighted quantity to be evolved (typically
      56             :  * `BondiJ`).
      57             :  *  - `evolved_swsh_dt_tag`: The spin-weighed quantity associated that is to act
      58             :  * as the time derivative to evolve `evolved_swsh_tag` (typically `BondiH`).
      59             :  *  - `cce_boundary_communication_tags`: A typelist of tags that will be
      60             :  * communicated between the worldtube boundary component and the extraction
      61             :  * component (typically
      62             :  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`)
      63             :  *  - `cce_gauge_boundary_tags`: A typelist of tags that will be derived via
      64             :  * `GaugeAdjustedBoundaryValue` and corresponding gauge utilities
      65             :  *  - `cce_integrand_tags`: A typelist of tags needed as inputs to the
      66             :  * linear solve. Obtainable from the metafunction
      67             :  * `Cce::integrand_terms_to_compute_for_bondi_variable`.
      68             :  *  - `cce_integration_independent_tags`: A typelist of tags that are to be
      69             :  * computed and stored for each hypersurface iteration, but have no dependencies
      70             :  * on the intermediate hypersurface steps (typically
      71             :  * `Cce::pre_computation_steps`).
      72             :  *  - `cce_temporary_equations_tags`: A typelist of temporary buffers maintained
      73             :  * for intermediate steps in the integrand equations. Obtainable from the
      74             :  * metafunction `Cce::integrand_terms_to_compute_for_bondi_variable`.
      75             :  *  - `cce_pre_swsh_derivatives_tags`: A typelist of inputs to spin-weighted
      76             :  * derivative calculations to compute and cache for intermediate steps of the
      77             :  * CCE calculation. (typically `Cce::all_pre_swsh_derivative_tags`)
      78             :  *  - `cce_swsh_derivative_tags`: A typelist of spin-weighted derivatives to
      79             :  * compute and cache for intermediate steps of the CCE calculation. (typically
      80             :  * `Cce::all_swsh_derivative_tags`)
      81             :  *  - `cce_transform_buffer_tags`: A typelist of spin-weighted spherical
      82             :  * harmonic transform modes used to compute the spin-weighted derivatives in the
      83             :  * modal representation. (typically `Cce::all_transform_buffer_tags`).
      84             :  *  - `cce_angular_coordinate_tags`: A typelist of real-valued angular
      85             :  * coordinates that are not evolved.
      86             :  *  - `cce_scri_tags`: the tags of quantities to compute at scri+
      87             :  *  - `cce_hypersurface_initialization`: a mutator (for use with
      88             :  * `::Actions::MutateApply`) that is used to compute the initial hypersurface
      89             :  * data from the boundary data.
      90             :  */
      91             : template <class Metavariables>
      92           1 : struct CharacteristicEvolution {
      93           0 :   using chare_type = Parallel::Algorithms::Singleton;
      94           0 :   using metavariables = Metavariables;
      95             : 
      96           0 :   using initialize_action_list = tmpl::list<
      97             :       ::Actions::SetupDataBox,
      98             :       Actions::InitializeCharacteristicEvolutionVariables<Metavariables>,
      99             :       Actions::InitializeCharacteristicEvolutionTime<
     100             :           typename Metavariables::evolved_coordinates_variables_tag,
     101             :           typename Metavariables::evolved_swsh_tag>,
     102             :       Actions::InitializeCharacteristicEvolutionScri<
     103             :           typename Metavariables::scri_values_to_observe>,
     104             :       Actions::RequestBoundaryData<
     105             :           typename Metavariables::cce_boundary_component,
     106             :           CharacteristicEvolution<Metavariables>>,
     107             :       Actions::ReceiveWorldtubeData<Metavariables>,
     108             :       Actions::InitializeFirstHypersurface,
     109             :       Initialization::Actions::RemoveOptionsAndTerminatePhase>;
     110             : 
     111           0 :   using initialization_tags =
     112             :       Parallel::get_initialization_tags<initialize_action_list>;
     113             : 
     114             :   // the list of actions that occur for each of the hypersurface-integrated
     115             :   // Bondi tags
     116             :   template <typename BondiTag>
     117           0 :   using hypersurface_computation = tmpl::list<
     118             :       ::Actions::MutateApply<GaugeAdjustedBoundaryValue<BondiTag>>,
     119             :       Actions::CalculateIntegrandInputsForTag<BondiTag>,
     120             :       tmpl::transform<integrand_terms_to_compute_for_bondi_variable<BondiTag>,
     121             :                       tmpl::bind<::Actions::MutateApply,
     122             :                                  tmpl::bind<ComputeBondiIntegrand, tmpl::_1>>>,
     123             :       ::Actions::MutateApply<
     124             :           RadialIntegrateBondi<Tags::EvolutionGaugeBoundaryValue, BondiTag>>,
     125             :       // Once we finish the U computation, we need to update all the quantities
     126             :       // that depend on the time derivative of the gauge
     127             :       tmpl::conditional_t<
     128             :           std::is_same_v<BondiTag, Tags::BondiU>,
     129             :           tmpl::list<
     130             :               ::Actions::MutateApply<GaugeUpdateTimeDerivatives>,
     131             :               ::Actions::MutateApply<
     132             :                   GaugeAdjustedBoundaryValue<Tags::DuRDividedByR>>,
     133             :               ::Actions::MutateApply<PrecomputeCceDependencies<
     134             :                   Tags::EvolutionGaugeBoundaryValue, Tags::DuRDividedByR>>>,
     135             :           tmpl::list<>>>;
     136             : 
     137           0 :   using compute_scri_quantities_and_observe = tmpl::list<
     138             :       ::Actions::MutateApply<
     139             :           CalculateScriPlusValue<::Tags::dt<Tags::InertialRetardedTime>>>,
     140             :       Actions::CalculateScriInputs,
     141             :       tmpl::transform<typename metavariables::cce_scri_tags,
     142             :                       tmpl::bind<::Actions::MutateApply,
     143             :                                  tmpl::bind<CalculateScriPlusValue, tmpl::_1>>>,
     144             :       tmpl::transform<
     145             :           typename metavariables::scri_values_to_observe,
     146             :           tmpl::bind<Actions::InsertInterpolationScriData, tmpl::_1>>,
     147             :       Actions::ScriObserveInterpolated<
     148             :           observers::ObserverWriter<Metavariables>>>;
     149             : 
     150           0 :   using record_time_stepper_data_and_step =
     151             :       tmpl::list<::Actions::RecordTimeStepperData<
     152             :                      typename Metavariables::evolved_coordinates_variables_tag>,
     153             :                  ::Actions::RecordTimeStepperData<::Tags::Variables<
     154             :                      tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
     155             :                  ::Actions::UpdateU<
     156             :                      typename Metavariables::evolved_coordinates_variables_tag>,
     157             :                  ::Actions::UpdateU<::Tags::Variables<
     158             :                      tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
     159             :                  ::Actions::AdvanceTime>;
     160             : 
     161           0 :   using extract_action_list = tmpl::list<
     162             :       Actions::RequestNextBoundaryData<
     163             :           typename Metavariables::cce_boundary_component,
     164             :           CharacteristicEvolution<Metavariables>>,
     165             :       Actions::UpdateGauge, Actions::PrecomputeGlobalCceDependencies,
     166             :       tmpl::transform<bondi_hypersurface_step_tags,
     167             :                       tmpl::bind<hypersurface_computation, tmpl::_1>>,
     168             :       Actions::FilterSwshVolumeQuantity<Tags::BondiH>,
     169             :       compute_scri_quantities_and_observe, record_time_stepper_data_and_step,
     170             :       Actions::ExitIfEndTimeReached,
     171             :       Actions::ReceiveWorldtubeData<Metavariables>>;
     172             : 
     173           0 :   using phase_dependent_action_list =
     174             :       tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
     175             :                                         Metavariables::Phase::Initialization,
     176             :                                         initialize_action_list>,
     177             :                  Parallel::PhaseActions<typename Metavariables::Phase,
     178             :                                         Metavariables::Phase::Evolve,
     179             :                                         extract_action_list>>;
     180             : 
     181           0 :   using const_global_cache_tag_list =
     182             :       Parallel::get_const_global_cache_tags_from_actions<
     183             :           phase_dependent_action_list>;
     184             : 
     185           0 :   static void initialize(Parallel::CProxy_GlobalCache<
     186             :                          Metavariables>& /*global_cache*/) noexcept {}
     187             : 
     188           0 :   static void execute_next_phase(
     189             :       const typename Metavariables::Phase next_phase,
     190             :       const Parallel::CProxy_GlobalCache<Metavariables>&
     191             :           global_cache) noexcept {
     192             :     auto& local_cache = *(global_cache.ckLocalBranch());
     193             :     Parallel::get_parallel_component<CharacteristicEvolution<Metavariables>>(
     194             :         local_cache)
     195             :         .start_phase(next_phase);
     196             :   }
     197             : };
     198             : }  // namespace Cce

Generated by: LCOV version 1.14