Line data Source code
1 1 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : /// \file 5 : /// Define prefixes for DataBox tags 6 : 7 : #pragma once 8 : 9 : #include <cstddef> 10 : 11 : #include "DataStructures/DataBox/Tag.hpp" 12 : #include "DataStructures/Tensor/IndexType.hpp" 13 : #include "DataStructures/Tensor/Metafunctions.hpp" 14 : #include "DataStructures/Tensor/Tensor.hpp" 15 : #include "Utilities/Requires.hpp" 16 : #include "Utilities/TypeTraits/IsA.hpp" 17 : 18 : /// \cond 19 : template <class> 20 : class Variables; // IWYU pragma: keep 21 : /// \endcond 22 : 23 : namespace Tags { 24 : /// \ingroup DataBoxTagsGroup 25 : /// \brief Prefix indicating a time derivative 26 : /// 27 : /// \snippet Test_DataBoxPrefixes.cpp dt_name 28 : template <typename Tag> 29 1 : struct dt : db::PrefixTag, db::SimpleTag { 30 0 : using type = typename Tag::type; 31 0 : using tag = Tag; 32 : }; 33 : 34 : /// \ingroup DataBoxTagsGroup 35 : /// \brief Prefix indicating a flux 36 : /// 37 : /// \snippet Test_DataBoxPrefixes.cpp flux_name 38 : template <typename Tag, typename VolumeDim, typename Fr, 39 : typename = std::nullptr_t> 40 1 : struct Flux; 41 : 42 : /// \cond 43 : template <typename Tag, typename VolumeDim, typename Fr> 44 : struct Flux<Tag, VolumeDim, Fr, 45 : Requires<tt::is_a_v<Tensor, typename Tag::type>>> : db::PrefixTag, 46 : db::SimpleTag { 47 : using type = TensorMetafunctions::prepend_spatial_index< 48 : typename Tag::type, VolumeDim::value, UpLo::Up, Fr>; 49 : using tag = Tag; 50 : }; 51 : 52 : template <typename Tag, typename VolumeDim, typename Fr> 53 : struct Flux<Tag, VolumeDim, Fr, 54 : Requires<tt::is_a_v<::Variables, typename Tag::type>>> 55 : : db::PrefixTag, db::SimpleTag { 56 : using type = typename Tag::type; 57 : using tag = Tag; 58 : }; 59 : /// \endcond 60 : 61 : /// \ingroup DataBoxTagsGroup 62 : /// \brief Prefix indicating a source term 63 : /// 64 : /// \snippet Test_DataBoxPrefixes.cpp source_name 65 : template <typename Tag> 66 1 : struct Source : db::PrefixTag, db::SimpleTag { 67 0 : using type = typename Tag::type; 68 0 : using tag = Tag; 69 : }; 70 : 71 : /// \ingroup DataBoxTagsGroup 72 : /// \brief Prefix indicating a source term that is independent of dynamic 73 : /// variables 74 : template <typename Tag> 75 1 : struct FixedSource : db::PrefixTag, db::SimpleTag { 76 0 : using type = typename Tag::type; 77 0 : using tag = Tag; 78 : }; 79 : 80 : /// \ingroup DataBoxTagsGroup 81 : /// \brief Prefix indicating the initial value of a quantity 82 : /// 83 : /// \snippet Test_DataBoxPrefixes.cpp initial_name 84 : template <typename Tag> 85 1 : struct Initial : db::PrefixTag, db::SimpleTag { 86 0 : using type = typename Tag::type; 87 0 : using tag = Tag; 88 : }; 89 : 90 : /// \ingroup DataBoxTagsGroup 91 : /// \brief Prefix indicating a boundary unit normal vector dotted into 92 : /// the flux 93 : /// 94 : /// \snippet Test_DataBoxPrefixes.cpp normal_dot_flux_name 95 : template <typename Tag> 96 1 : struct NormalDotFlux : db::PrefixTag, db::SimpleTag { 97 0 : using type = typename Tag::type; 98 0 : using tag = Tag; 99 : }; 100 : 101 : /// \ingroup DataBoxTagsGroup 102 : /// \brief Prefix indicating a boundary unit normal vector dotted into 103 : /// the numerical flux 104 : /// 105 : /// \snippet Test_DataBoxPrefixes.cpp normal_dot_numerical_flux_name 106 : template <typename Tag> 107 1 : struct NormalDotNumericalFlux : db::PrefixTag, db::SimpleTag { 108 0 : using type = typename Tag::type; 109 0 : using tag = Tag; 110 : }; 111 : 112 : /// \ingroup DataBoxTagsGroup 113 : /// \brief Prefix indicating the value a quantity took in the previous iteration 114 : /// of the algorithm. 115 : template <typename Tag> 116 1 : struct Previous : db::PrefixTag, db::SimpleTag { 117 0 : using type = typename Tag::type; 118 0 : using tag = Tag; 119 : }; 120 : 121 : /// \ingroup DataBoxTagsGroup 122 : /// \brief Prefix indicating the value a quantity will take on the 123 : /// next iteration of the algorithm. 124 : /// 125 : /// \snippet Test_DataBoxPrefixes.cpp next_name 126 : template <typename Tag> 127 1 : struct Next : db::PrefixTag, db::SimpleTag { 128 0 : using type = typename Tag::type; 129 0 : using tag = Tag; 130 : }; 131 : 132 : } // namespace Tags