SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/Amr/Projectors - DefaultInitialize.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 16.7 % 6 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 <cstddef>
       7              : #include <utility>
       8              : 
       9              : #include "ParallelAlgorithms/Amr/Protocols/Projector.hpp"
      10              : #include "Utilities/Gsl.hpp"
      11              : #include "Utilities/TMPL.hpp"
      12              : 
      13              : /// \cond
      14              : template <size_t Dim>
      15              : class Element;
      16              : template <size_t Dim>
      17              : class Mesh;
      18              : /// \endcond
      19              : 
      20              : namespace amr::projectors {
      21              : 
      22              : /// \brief Value initialize the items corresponding to Tags
      23              : ///
      24              : /// There is a specialization for `DefaultInitialize<tmpl::list<Tags...>>` that
      25              : /// can be used if a `tmpl::list` is available.
      26              : ///
      27              : /// \details For each item corresponding to each tag, value initialize
      28              : /// the item by setting it equal to an object constructed with an
      29              : /// empty initializer.  This is the default state of mutable items in
      30              : /// a DataBox if they are neither set from input file options, nor
      31              : /// mutated by initialization actions.
      32              : template <typename... Tags>
      33            1 : struct DefaultInitialize : tt::ConformsTo<amr::protocols::Projector> {
      34            0 :   using return_tags = tmpl::list<Tags...>;
      35            0 :   using argument_tags = tmpl::list<>;
      36              : 
      37              :   template <size_t Dim>
      38            0 :   static void apply(
      39              :       const gsl::not_null<typename Tags::type*>... items,
      40              :       const std::pair<Mesh<Dim>, Element<Dim>>& /*old_mesh_and_element*/) {
      41              :     expand_pack((*items = std::decay_t<decltype(*items)>{})...);
      42              :   }
      43              : 
      44              :   template <typename FinalArg>
      45            0 :   static void apply(const gsl::not_null<typename Tags::type*>... /*items*/,
      46              :                     const FinalArg& /*parent_or_children_items*/) {
      47              :     // Mutable items on newly created elements are already value initialized
      48              :   }
      49              : };
      50              : 
      51              : /// \cond
      52              : template <typename... Tags>
      53              : struct DefaultInitialize<tmpl::list<Tags...>>
      54              :     : public DefaultInitialize<Tags...> {};
      55              : /// \endcond
      56              : }  // namespace amr::projectors
        

Generated by: LCOV version 2.0-1