ConstraintGammas.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "DataStructures/DataBox/Tag.hpp"
10 #include "DataStructures/DataVector.hpp"
13 #include "Domain/FunctionsOfTime/Tags.hpp"
14 #include "Evolution/Systems/GeneralizedHarmonic/ConstraintDamping/Tags.hpp"
15 #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
16 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
17 #include "Time/Tags.hpp"
18 #include "Utilities/ContainerHelpers.hpp"
19 #include "Utilities/Gsl.hpp"
20 #include "Utilities/TMPL.hpp"
21 
22 // IWYU pragma: no_forward_declare Tags::deriv
23 
24 /// \cond
25 namespace domain {
26 namespace Tags {
27 template <size_t Dim, typename Frame>
28 struct Coordinates;
29 } // namespace Tags
30 } // namespace domain
31 class DataVector;
32 template <typename X, typename Symm, typename IndexList>
33 class Tensor;
34 /// \endcond
35 
36 namespace GeneralizedHarmonic::ConstraintDamping::Tags {
37 /*!
38  * \brief Computes the constraint damping parameter \f$\gamma_0\f$ from the
39  * coordinates and a DampingFunction.
40  *
41  * \details Can be retrieved using
42  * `GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma0`.
43  */
44 template <size_t SpatialDim, typename Frame>
46  using argument_tags =
47  tmpl::list<DampingFunctionGamma0<SpatialDim, Frame>,
50  using return_type = Scalar<DataVector>;
51 
52  static constexpr void function(
54  const ::GeneralizedHarmonic::ConstraintDamping::DampingFunction<
55  SpatialDim, Frame>& damping_function,
56  const tnsr::I<DataVector, SpatialDim, Frame>& coords, const double time,
57  const std::unordered_map<
60  functions_of_time) noexcept {
61  damping_function(gamma, coords, time, functions_of_time);
62  }
63 
64  using base = ConstraintGamma0;
65 };
66 
67 /*!
68  * \brief Computes the constraint damping parameter \f$\gamma_1\f$ from the
69  * coordinates and a DampingFunction.
70  *
71  * \details Can be retrieved using
72  * `GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma1`.
73  */
74 template <size_t SpatialDim, typename Frame>
76  using argument_tags =
77  tmpl::list<DampingFunctionGamma1<SpatialDim, Frame>,
80  using return_type = Scalar<DataVector>;
81 
82  static constexpr void function(
83  const gsl::not_null<Scalar<DataVector>*> gamma1,
84  const ::GeneralizedHarmonic::ConstraintDamping::DampingFunction<
85  SpatialDim, Frame>& damping_function,
86  const tnsr::I<DataVector, SpatialDim, Frame>& coords, const double time,
87  const std::unordered_map<
90  functions_of_time) noexcept {
91  damping_function(gamma1, coords, time, functions_of_time);
92  }
93 
94  using base = ConstraintGamma1;
95 };
96 
97 /*!
98  * \brief Computes the constraint damping parameter \f$\gamma_2\f$ from the
99  * coordinates and a DampingFunction.
100  *
101  * \details Can be retrieved using
102  * `GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma2`.
103  */
104 template <size_t SpatialDim, typename Frame>
106  using argument_tags =
107  tmpl::list<DampingFunctionGamma2<SpatialDim, Frame>,
110  using return_type = Scalar<DataVector>;
111 
112  static constexpr void function(
113  const gsl::not_null<Scalar<DataVector>*> gamma,
114  const ::GeneralizedHarmonic::ConstraintDamping::DampingFunction<
115  SpatialDim, Frame>& damping_function,
116  const tnsr::I<DataVector, SpatialDim, Frame>& coords, const double time,
117  const std::unordered_map<
118  std::string,
120  functions_of_time) noexcept {
121  damping_function(gamma, coords, time, functions_of_time);
122  }
123 
124  using base = ConstraintGamma2;
125 };
126 } // namespace GeneralizedHarmonic::ConstraintDamping::Tags
db::ComputeTag
Mark a struct as a compute tag by inheriting from this.
Definition: Tag.hpp:157
std::string
domain::Tags::FunctionsOfTime
The FunctionsOfTime initialized from a DomainCreator or (if override_functions_of_time is true in the...
Definition: Tags.hpp:60
domain::Tags::Coordinates
Definition: Tags.hpp:130
GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma0Compute
Computes the constraint damping parameter from the coordinates and a DampingFunction.
Definition: ConstraintGammas.hpp:45
DotProduct.hpp
GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma2Compute
Computes the constraint damping parameter from the coordinates and a DampingFunction.
Definition: ConstraintGammas.hpp:105
GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma0
Constraint dammping parameter for the generalized harmonic system (cf. ).
Definition: Tags.hpp:54
cstddef
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
Tags::Time
Tag for the current time as a double.
Definition: Tags.hpp:73
GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma2
Constraint dammping parameter for the generalized harmonic system (cf. ).
Definition: Tags.hpp:70
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
Frame
Definition: IndexType.hpp:36
Tensor.hpp
GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma1
Constraint dammping parameter for the generalized harmonic system (cf. ).
Definition: Tags.hpp:62
GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma1Compute
Computes the constraint damping parameter from the coordinates and a DampingFunction.
Definition: ConstraintGammas.hpp:75
std::unique_ptr
Prefixes.hpp
std::unordered_map
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13