SpECTRE Documentation Coverage Report
Current view: top level - DataStructures - TempBuffer.hpp Hit Total Coverage
Commit: aabde07399ba7837e5db64eedfd0a21f31f96922 Lines: 1 6 16.7 %
Date: 2024-04-26 02:38:13
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             : 
       8             : #include "DataStructures/Variables.hpp"
       9             : #include "Utilities/TMPL.hpp"
      10             : #include "Utilities/TaggedTuple.hpp"
      11             : 
      12             : /*!
      13             :  * \ingroup DataStructuresGroup
      14             :  * \brief A TempBuffer holds a set of `Tensor<DataType>`s, where
      15             :  * DataType is either a `DataVector` (or similar type) or a
      16             :  * fundamental type, in a way that minimizes allocations.
      17             :  *
      18             :  * The user gets references to Tensors inside of the TempBuffer using,
      19             :  * e.g., `auto& variable = get<Tag>(temp_buffer)`, where `Tag` is one
      20             :  * of the Tags in the `TagList`.
      21             :  *
      22             :  * If DataType is a DataVector or similar, than TempBuffer is a
      23             :  * Variables.  If DataType is a fundamental type, then TempBuffer is a
      24             :  * TaggedTuple.
      25             :  *
      26             :  */
      27             : template <typename TagList,
      28             :           bool is_fundamental = std::is_fundamental_v<
      29             :               typename tmpl::front<TagList>::type::value_type>>
      30           1 : struct TempBuffer;
      31             : 
      32             : template <typename TagList>
      33           0 : struct TempBuffer<TagList, true> : tuples::tagged_tuple_from_typelist<TagList> {
      34           0 :   explicit TempBuffer(const size_t /*size*/)
      35             :       : tuples::tagged_tuple_from_typelist<TagList>::TaggedTuple() {}
      36             : 
      37           0 :   static size_t number_of_grid_points() { return 1; }
      38             : };
      39             : 
      40             : template <typename TagList>
      41           0 : struct TempBuffer<TagList, false> : Variables<TagList> {
      42             :   using Variables<TagList>::Variables;
      43             : };

Generated by: LCOV version 1.14