SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce/Components - WorldtubeBoundary.hpp Hit Total Coverage
Commit: ebec864322c50bab8dca0a90baf8d01875114261 Lines: 2 25 8.0 %
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 "Evolution/Systems/Cce/Actions/InitializeWorldtubeBoundary.hpp"
       7             : #include "Evolution/Systems/Cce/BoundaryData.hpp"
       8             : #include "Parallel/Actions/SetupDataBox.hpp"
       9             : #include "Parallel/Actions/TerminatePhase.hpp"
      10             : #include "Parallel/GlobalCache.hpp"
      11             : #include "Parallel/Info.hpp"
      12             : #include "Parallel/Invoke.hpp"
      13             : #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
      14             : 
      15             : namespace Cce {
      16             : 
      17             : /*!
      18             :  * \brief Component that supplies CCE worldtube boundary data.
      19             :  *
      20             :  * \details The \ref DataBoxGroup associated with the worldtube boundary
      21             :  * component contains a data manager (e.g. `WorldtubeDataManager`) linked to
      22             :  * an H5 file. The data manager handles buffering and interpolating to desired
      23             :  * target time points when requested via the simple action
      24             :  * `BoundaryComputeAndSendToEvolution`, at which point it will send the required
      25             :  * collection of boundary quantities to the identified 'CharacteristicEvolution'
      26             :  * component. It is assumed that the simple action
      27             :  * `BoundaryComputeAndSendToEvolution` will only be called during the
      28             :  * `Evolve` phase.
      29             :  *
      30             :  * Uses const global tags:
      31             :  * - `Tags::LMax`
      32             :  *
      33             :  * `Metavariables` must contain:
      34             :  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
      35             :  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
      36             :  * from the worldtube to the evolution component. This will typically be
      37             :  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
      38             :  */
      39             : template <class Metavariables>
      40           1 : struct H5WorldtubeBoundary {
      41           0 :   using end_time_tag = Tags::EndTimeFromFile;
      42           0 :   using chare_type = Parallel::Algorithms::Singleton;
      43           0 :   using metavariables = Metavariables;
      44           0 :   using initialize_action_list =
      45             :       tmpl::list<::Actions::SetupDataBox,
      46             :                  Actions::InitializeH5WorldtubeBoundary<
      47             :                      typename Metavariables::cce_boundary_communication_tags>,
      48             :                  Initialization::Actions::RemoveOptionsAndTerminatePhase>;
      49           0 :   using initialization_tags =
      50             :       Parallel::get_initialization_tags<initialize_action_list>;
      51             : 
      52           0 :   using worldtube_boundary_computation_steps = tmpl::list<>;
      53             : 
      54           0 :   using phase_dependent_action_list =
      55             :       tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
      56             :                                         Metavariables::Phase::Initialization,
      57             :                                         initialize_action_list>,
      58             :                  Parallel::PhaseActions<typename Metavariables::Phase,
      59             :                                         Metavariables::Phase::Evolve,
      60             :                                         worldtube_boundary_computation_steps>>;
      61             : 
      62           0 :   using const_global_cache_tag_list =
      63             :       Parallel::detail::get_const_global_cache_tags_from_pdal<
      64             :           phase_dependent_action_list>;
      65             : 
      66           0 :   using options = tmpl::list<>;
      67             : 
      68           0 :   static void initialize(Parallel::CProxy_GlobalCache<
      69             :                          Metavariables>& /*global_cache*/) noexcept {}
      70             : 
      71           0 :   static void execute_next_phase(
      72             :       const typename Metavariables::Phase next_phase,
      73             :       const Parallel::CProxy_GlobalCache<Metavariables>&
      74             :           global_cache) noexcept {
      75             :     auto& local_cache = *(global_cache.ckLocalBranch());
      76             :     if (next_phase == Metavariables::Phase::Evolve) {
      77             :       Parallel::get_parallel_component<H5WorldtubeBoundary>(local_cache)
      78             :           .perform_algorithm();
      79             :     }
      80             :   }
      81             : };
      82             : 
      83             : /*!
      84             :  * \brief Component that supplies CCE worldtube boundary data sourced from a
      85             :  * running GH system.
      86             :  *
      87             :  * \details The \ref DataBoxGroup associated with the worldtube boundary
      88             :  * component contains an interface manager (derived from
      89             :  * `Cce::GhWorldtubeInterfaceManager`) that stores and provides the data
      90             :  * received from the GH system. The data manager handles buffering
      91             :  * and interpolating to desired target time points when requested via the simple
      92             :  * action `Cce::Actions::BoundaryComputeAndSendToEvolution`, at which point it
      93             :  * will send the required collection of boundary quantities to the identified
      94             :  * `CharacteristicEvolution` component. It is assumed that the simple action
      95             :  * `Cce::Actions::BoundaryComputeAndSendToEvolution` will only be called during
      96             :  * the `Evolve` phase.
      97             :  *
      98             :  * Uses const global tags:
      99             :  * - `InitializationTags::LMax`
     100             :  * - `InitializationTags::ExtractionRadius`
     101             :  *
     102             :  * `Metavariables` must contain:
     103             :  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
     104             :  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
     105             :  * from the worldtube to the evolution component. This will typically be
     106             :  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
     107             :  */
     108             : template <class Metavariables>
     109           1 : struct GhWorldtubeBoundary {
     110           0 :   using end_time_tag = Tags::NoEndTime;
     111           0 :   using chare_type = Parallel::Algorithms::Singleton;
     112           0 :   using metavariables = Metavariables;
     113           0 :   using initialize_action_list =
     114             :       tmpl::list<::Actions::SetupDataBox,
     115             :                  Actions::InitializeGhWorldtubeBoundary<
     116             :                      typename Metavariables::cce_boundary_communication_tags>,
     117             :                  Initialization::Actions::RemoveOptionsAndTerminatePhase>;
     118           0 :   using initialization_tags =
     119             :       Parallel::get_initialization_tags<initialize_action_list>;
     120             : 
     121           0 :   using worldtube_boundary_computation_steps = tmpl::list<>;
     122             : 
     123           0 :   using phase_dependent_action_list =
     124             :       tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
     125             :                                         Metavariables::Phase::Initialization,
     126             :                                         initialize_action_list>,
     127             :                  Parallel::PhaseActions<typename Metavariables::Phase,
     128             :                                         Metavariables::Phase::Evolve,
     129             :                                         worldtube_boundary_computation_steps>>;
     130             : 
     131           0 :   using const_global_cache_tag_list =
     132             :       Parallel::detail::get_const_global_cache_tags_from_pdal<
     133             :           phase_dependent_action_list>;
     134             : 
     135           0 :   using options = tmpl::list<>;
     136             : 
     137           0 :   static void initialize(Parallel::CProxy_GlobalCache<
     138             :                          Metavariables>& /*global_cache*/) noexcept {}
     139             : 
     140           0 :   static void execute_next_phase(
     141             :       const typename Metavariables::Phase next_phase,
     142             :       const Parallel::CProxy_GlobalCache<Metavariables>&
     143             :           global_cache) noexcept {
     144             :     auto& local_cache = *(global_cache.ckLocalBranch());
     145             :     if (next_phase == Metavariables::Phase::Evolve) {
     146             :       Parallel::get_parallel_component<GhWorldtubeBoundary>(local_cache)
     147             :           .start_phase(next_phase);
     148             :     }
     149             :   }
     150             : };
     151             : 
     152             : }  // namespace Cce

Generated by: LCOV version 1.14