SpECTRE Documentation Coverage Report
Current view: top level - Parallel/ArrayCollection - SpawnInitializeElementsInCollection.hpp Hit Total Coverage
Commit: f679b1c7cc6e5bd6a5c72de114b5bff6a9facc98 Lines: 1 3 33.3 %
Date: 2024-05-20 02:45:36
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 "Domain/Structure/ElementId.hpp"
       8             : #include "Parallel/AlgorithmExecution.hpp"
       9             : #include "Parallel/ArrayCollection/ReceiveDataForElement.hpp"
      10             : #include "Parallel/ArrayCollection/Tags/ElementCollection.hpp"
      11             : #include "Parallel/GlobalCache.hpp"
      12             : 
      13             : namespace Parallel::Actions {
      14             : /*!
      15             :  * \brief Reduction target that is called after all nodes have successfully
      16             :  * initialized the nodegroup portion of the `DgElementCollection`. This spawns
      17             :  * the messages that initialize the `DgElementArrayMember`s
      18             :  */
      19           1 : struct SpawnInitializeElementsInCollection {
      20             :   template <typename ParallelComponent, typename DbTagsList,
      21             :             typename Metavariables, typename ArrayIndex,
      22             :             typename DataBox = db::DataBox<DbTagsList>>
      23           0 :   static void apply(db::DataBox<DbTagsList>& box,
      24             :                     Parallel::GlobalCache<Metavariables>& cache,
      25             :                     const ArrayIndex& /*array_index*/,
      26             :                     const double /*unused_but_we_needed_to_reduce_something*/) {
      27             :     auto my_proxy = Parallel::get_parallel_component<ParallelComponent>(cache);
      28             :     db::mutate<typename ParallelComponent::element_collection_tag>(
      29             :         [&my_proxy](const auto element_collection_ptr) {
      30             :           for (auto& [element_id, element] : *element_collection_ptr) {
      31             :             Parallel::threaded_action<ReceiveDataForElement<true>>(my_proxy,
      32             :                                                                    element_id);
      33             :           }
      34             :         },
      35             :         make_not_null(&box));
      36             :   }
      37             : };
      38             : }  // namespace Parallel::Actions

Generated by: LCOV version 1.14