SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/Actions - SetData.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 50.0 % 2 1
Test Date: 2026-10-22 17:29:42
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/TaggedTuple.hpp"
       8              : #include "Utilities/TMPL.hpp"
       9              : 
      10              : /// \cond
      11              : namespace Parallel {
      12              : template <typename Metavariables>
      13              : struct GlobalCache;
      14              : }  // namespace Parallel
      15              : /// \endcond
      16              : 
      17              : namespace Actions {
      18              : 
      19              : /*!
      20              :  * \ingroup ActionsGroup
      21              :  * \brief Mutate the DataBox tags in `TagsList` according to the `data`.
      22              :  *
      23              :  * An example use case for this action is as the callback for the
      24              :  * `importers::ThreadedActions::ReadVolumeData`.
      25              :  *
      26              :  * DataBox changes:
      27              :  * - Modifies:
      28              :  *   - All tags in `TagsList`
      29              :  */
      30              : template <typename TagsList>
      31            1 : struct SetData;
      32              : 
      33              : /// \cond
      34              : template <typename... Tags>
      35              : struct SetData<tmpl::list<Tags...>> {
      36              :   template <typename ParallelComponent, typename DataBox,
      37              :             typename Metavariables, typename ArrayIndex>
      38              :   static void apply(DataBox& box,
      39              :                     const Parallel::GlobalCache<Metavariables>& /*cache*/,
      40              :                     const ArrayIndex& /*array_index*/,
      41              :                     tuples::TaggedTuple<Tags...> data) {
      42              :     tmpl::for_each<tmpl::list<Tags...>>([&box, &data](auto tag_v) {
      43              :       using tag = tmpl::type_from<decltype(tag_v)>;
      44              :       db::mutate<tag>(
      45              :           [&data](const gsl::not_null<typename tag::type*> value) {
      46              :             *value = std::move(tuples::get<tag>(data));
      47              :           },
      48              :           make_not_null(&box));
      49              :     });
      50              :   }
      51              : };
      52              : /// \endcond
      53              : 
      54              : }  // namespace Actions
        

Generated by: LCOV version 2.0-1