Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <string>
7 :
8 : #include "DataStructures/DataBox/Prefixes.hpp"
9 : #include "DataStructures/DataBox/Tag.hpp"
10 : #include "DataStructures/Tensor/TypeAliases.hpp"
11 : #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
12 :
13 : namespace gr {
14 : namespace Tags {
15 : template <typename DataType, size_t Dim, typename Frame>
16 0 : struct SpacetimeMetric : db::SimpleTag {
17 0 : using type = tnsr::aa<DataType, Dim, Frame>;
18 : };
19 : template <typename DataType, size_t Dim, typename Frame>
20 0 : struct InverseSpacetimeMetric : db::SimpleTag {
21 0 : using type = tnsr::AA<DataType, Dim, Frame>;
22 : };
23 :
24 : template <typename DataType, size_t Dim, typename Frame>
25 0 : struct SpatialMetric : db::SimpleTag {
26 0 : using type = tnsr::ii<DataType, Dim, Frame>;
27 : };
28 : /*!
29 : * \brief Inverse of the spatial metric.
30 : */
31 : template <typename DataType, size_t Dim, typename Frame>
32 1 : struct InverseSpatialMetric : db::SimpleTag {
33 0 : using type = tnsr::II<DataType, Dim, Frame>;
34 : };
35 : /*!
36 : * \brief Determinant of the spatial metric.
37 : */
38 : template <typename DataType>
39 1 : struct DetSpatialMetric : db::SimpleTag {
40 0 : using type = Scalar<DataType>;
41 : };
42 : template <typename DataType>
43 0 : struct SqrtDetSpatialMetric : db::SimpleTag {
44 0 : using type = Scalar<DataType>;
45 : };
46 : /*!
47 : * \brief Derivative of the determinant of the spatial metric.
48 : */
49 : template <typename DataType, size_t Dim, typename Frame>
50 1 : struct DerivDetSpatialMetric : db::SimpleTag {
51 0 : using type = tnsr::i<DataType, Dim, Frame>;
52 : };
53 : /*!
54 : * \brief Spatial derivative of the inverse of the spatial metric.
55 : */
56 : template <typename DataType, size_t Dim, typename Frame>
57 1 : struct DerivInverseSpatialMetric : db::SimpleTag {
58 0 : using type = tnsr::iJJ<DataType, Dim, Frame>;
59 : };
60 : template <typename DataType, size_t Dim, typename Frame>
61 0 : struct Shift : db::SimpleTag {
62 0 : using type = tnsr::I<DataType, Dim, Frame>;
63 : };
64 : template <typename DataType>
65 0 : struct Lapse : db::SimpleTag {
66 0 : using type = Scalar<DataType>;
67 : };
68 : /*!
69 : * \brief Spacetime derivatives of the spacetime metric
70 : *
71 : * \details Spacetime derivatives of the spacetime metric
72 : * \f$\partial_a g_{bc}\f$ assembled from the spatial and temporal
73 : * derivatives of evolved 3+1 variables.
74 : */
75 : template <typename DataType, size_t Dim, typename Frame>
76 1 : struct DerivativesOfSpacetimeMetric : db::SimpleTag {
77 0 : using type = tnsr::abb<DataType, Dim, Frame>;
78 : };
79 : template <typename DataType, size_t Dim, typename Frame>
80 0 : struct SpacetimeChristoffelFirstKind : db::SimpleTag {
81 0 : using type = tnsr::abb<DataType, Dim, Frame>;
82 : };
83 : template <typename DataType, size_t Dim, typename Frame>
84 0 : struct SpacetimeChristoffelSecondKind : db::SimpleTag {
85 0 : using type = tnsr::Abb<DataType, Dim, Frame>;
86 : };
87 : template <typename DataType, size_t Dim, typename Frame>
88 0 : struct SpatialChristoffelFirstKind : db::SimpleTag {
89 0 : using type = tnsr::ijj<DataType, Dim, Frame>;
90 : };
91 : template <typename DataType, size_t Dim, typename Frame>
92 0 : struct SpatialChristoffelSecondKind : db::SimpleTag {
93 0 : using type = tnsr::Ijj<DataType, Dim, Frame>;
94 : };
95 : template <typename DataType, size_t Dim, typename Frame>
96 0 : struct SpacetimeNormalOneForm : db::SimpleTag {
97 0 : using type = tnsr::a<DataType, Dim, Frame>;
98 : };
99 : template <typename DataType, size_t Dim, typename Frame>
100 0 : struct SpacetimeNormalVector : db::SimpleTag {
101 0 : using type = tnsr::A<DataType, Dim, Frame>;
102 : };
103 : template <typename DataType, size_t Dim, typename Frame>
104 0 : struct TraceSpacetimeChristoffelFirstKind : db::SimpleTag {
105 0 : using type = tnsr::a<DataType, Dim, Frame>;
106 : };
107 : /*!
108 : * \brief Trace of the spacetime Christoffel symbols of the second kind
109 : * \f$\Gamma^{i} = \Gamma^i_{jk}g^{jk}\f$, where \f$\Gamma^i_{jk}\f$ are
110 : * Christoffel symbols of the second kind and \f$g^{jk}\f$ is the
111 : * inverse spacetime metric.
112 : */
113 : template <typename DataType, size_t Dim, typename Frame>
114 1 : struct TraceSpacetimeChristoffelSecondKind : db::SimpleTag {
115 0 : using type = tnsr::A<DataType, Dim, Frame>;
116 : };
117 : /*!
118 : * \brief Trace of the spatial Christoffel symbols of the first kind
119 : * \f$\Gamma_{i} = \Gamma_{ijk}\gamma^{jk}\f$, where \f$\Gamma_{ijk}\f$ are
120 : * Christoffel symbols of the first kind and \f$\gamma^{jk}\f$ is the
121 : * inverse spatial metric.
122 : */
123 : template <typename DataType, size_t Dim, typename Frame>
124 1 : struct TraceSpatialChristoffelFirstKind : db::SimpleTag {
125 0 : using type = tnsr::i<DataType, Dim, Frame>;
126 : };
127 : template <typename DataType, size_t Dim, typename Frame>
128 0 : struct TraceSpatialChristoffelSecondKind : db::SimpleTag {
129 0 : using type = tnsr::I<DataType, Dim, Frame>;
130 : };
131 : /// Contraction of the first two indices of the spatial Christoffel symbols:
132 : /// \f$\Gamma^i_{ij}\f$. Useful for covariant divergences.
133 : template <typename DataType, size_t Dim, typename Frame>
134 1 : struct SpatialChristoffelSecondKindContracted : db::SimpleTag {
135 0 : using type = tnsr::i<DataType, Dim, Frame>;
136 : };
137 :
138 : template <typename DataType, size_t Dim, typename Frame>
139 0 : struct ExtrinsicCurvature : db::SimpleTag {
140 0 : using type = tnsr::ii<DataType, Dim, Frame>;
141 : };
142 : template <typename DataType>
143 0 : struct TraceExtrinsicCurvature : db::SimpleTag {
144 0 : using type = Scalar<DataType>;
145 : };
146 : template <typename DataType, size_t Dim, typename Frame>
147 0 : struct CovariantDerivativeOfExtrinsicCurvature : db::SimpleTag {
148 0 : using type = tnsr::ijj<DataType, Dim, Frame>;
149 : };
150 :
151 : /*!
152 : * \brief Holds a quantity that's similar to the shift, but isn't the shift.
153 : *
154 : * \details This holds
155 : *
156 : * \f{equation}{
157 : * \beta^i \frac{\partial x^\hat{i}}{\partial x^i} =
158 : * \hat{beta}^\hat{i} + \frac{\partial x^\hat{i}}{\partial t}
159 : * \f}
160 : *
161 : * where hatted quantities are in the distorted frame and non-hatted quantities
162 : * are in the grid frame.
163 : */
164 : template <typename DataType, size_t Dim, typename Frame>
165 1 : struct ShiftyQuantity : db::SimpleTag {
166 0 : using type = tnsr::I<DataType, Dim, Frame>;
167 : };
168 :
169 : /*!
170 : * \brief Computes the spatial Ricci tensor from the spatial
171 : * Christoffel symbol of the second kind and its derivative.
172 : */
173 : template <typename DataType, size_t Dim, typename Frame>
174 1 : struct SpatialRicci : db::SimpleTag {
175 0 : using type = tnsr::ii<DataType, Dim, Frame>;
176 : };
177 :
178 : /*!
179 : * \brief Simple tag for the spatial Ricci scalar
180 : */
181 : template <typename DataType>
182 1 : struct SpatialRicciScalar : db::SimpleTag {
183 0 : using type = Scalar<DataType>;
184 : };
185 :
186 : /*!
187 : * \brief Computes the real part of \f$\Psi_4\f$
188 : */
189 : template <typename DataType>
190 1 : struct Psi4Real : db::SimpleTag {
191 0 : using type = Scalar<DataType>;
192 : };
193 :
194 : /*!
195 : * \brief The energy density \f$E=n_a n_b T^{ab}\f$, where \f$n_a\f$ denotes the
196 : * normal to the spatial hypersurface
197 : */
198 : template <typename DataType>
199 1 : struct EnergyDensity : db::SimpleTag {
200 0 : using type = Scalar<DataType>;
201 : };
202 :
203 : /*!
204 : * \brief The trace of the spatial stress-energy tensor
205 : * \f$S=\gamma^{ij}\gamma_{ia}\gamma_{jb}T^{ab}\f$
206 : */
207 : template <typename DataType>
208 1 : struct StressTrace : db::SimpleTag {
209 0 : using type = Scalar<DataType>;
210 : };
211 :
212 : /*!
213 : * \brief The spatial momentum density \f$S^i=-\gamma^{ij}n^aT_{aj}\f$, where
214 : * \f$n_a\f$ denotes the normal to the spatial hypersurface
215 : */
216 : template <typename DataType, size_t Dim, typename Frame>
217 1 : struct MomentumDensity : db::SimpleTag {
218 0 : using type = tnsr::I<DataType, Dim, Frame>;
219 : };
220 :
221 : /// The ADM Hamiltonian constraint
222 : /// \f$\frac{1}{2} \left(R + K^2 - K_{ij} K^{ij}\right) - 8 \pi \rho\f$
223 : /// (see e.g. Eq. (2.132) in \cite BaumgarteShapiro).
224 : ///
225 : /// \note We include a factor of \f$1/2\f$ in the Hamiltonian constraint for
226 : /// consistency with SpEC, and so the matter terms in the Hamiltonian and
227 : /// momentum constraints are both scaled by $8\pi$.
228 : template <typename DataType>
229 1 : struct HamiltonianConstraint : db::SimpleTag {
230 0 : using type = Scalar<DataType>;
231 : };
232 :
233 : /// The ADM momentum constraint
234 : /// \f$\nabla_j (K^{ij} - \gamma^{ij} K) - 8 \pi S^i\f$, where
235 : /// \f$\nabla\f$ denotes the covariant derivative associated with the spatial
236 : /// metric \f$\gamma_{ij}\f$ (see e.g. Eq. (2.133) in \cite BaumgarteShapiro).
237 : template <typename DataType, size_t Dim, typename Frame>
238 1 : struct MomentumConstraint : db::SimpleTag {
239 0 : using type = tnsr::I<DataType, Dim, Frame>;
240 : };
241 :
242 : /*!
243 : * \brief Computes the electric part of the Weyl tensor in vacuum
244 : * as: \f$ E_{ij} = R_{ij} + KK_{ij} - K^m_{i}K_{mj}\f$ where \f$R_{ij}\f$ is
245 : * the spatial Ricci tensor, \f$K_{ij}\f$ is the extrinsic curvature, and
246 : * \f$K\f$ is the trace of \f$K_{ij}\f$.
247 : */
248 : template <typename DataType, size_t Dim, typename Frame>
249 1 : struct WeylElectric : db::SimpleTag {
250 0 : using type = tnsr::ii<DataType, Dim, Frame>;
251 : };
252 :
253 : /*!
254 : * \brief The magnetic part of the Weyl tensor in vacuum \f$B_{ij}\f$.
255 : */
256 : template <typename DataType, size_t Dim, typename Frame>
257 1 : struct WeylMagnetic : db::SimpleTag {
258 0 : using type = tnsr::ii<DataType, Dim, Frame>;
259 : };
260 :
261 : /*!
262 : * \brief Computes a quantity measuring how far from type D spacetime is,
263 : * using measure D1 [Eq. (8)] of \cite Bhagwat2017tkm.
264 : */
265 : template <typename DataType, size_t Dim, typename Frame>
266 1 : struct WeylTypeD1 : db::SimpleTag {
267 0 : using type = tnsr::ii<DataType, 3, Frame>;
268 : };
269 :
270 : /*!
271 : * \brief Computes the scalar \f$E_{ij} E^{ij}\f$ from the electric part of the
272 : * Weyl tensor \f$E_{ij}\f$ and the inverse spatial metric \f$\gamma^{ij}\f$,
273 : * i.e. \f$E_{ij} E^{ij} = \gamma^{ik}\gamma^{jl}E_{ij}E_{kl}\f$.
274 : */
275 : template <typename DataType>
276 1 : struct WeylElectricScalar : db::SimpleTag {
277 0 : using type = Scalar<DataType>;
278 : };
279 :
280 : /*!
281 : * \brief The square \f$B_{ij} B^{ij}\f$ of the magnetic part of the Weyl tensor
282 : * \f$B_{ij}\f$.
283 : */
284 : template <typename DataType>
285 1 : struct WeylMagneticScalar : db::SimpleTag {
286 0 : using type = Scalar<DataType>;
287 : };
288 :
289 : /*!
290 : * \brief Computes the scalar \f$D_{ij} D^{ij}\f$ (Eq. (8) of
291 : * \cite Bhagwat2017tkm) from \f$D_{ij}\f$ and the inverse spatial metric
292 : * \f$\gamma^{ij}\f$, i.e. \f$D = \gamma^{ik}\gamma^{jl}D_{ij}D_{kl}\f$.
293 : */
294 : template <typename DataType>
295 1 : struct WeylTypeD1Scalar : db::SimpleTag {
296 0 : using type = Scalar<DataType>;
297 : };
298 :
299 : } // namespace Tags
300 :
301 : /// GR Tags commonly needed for the evolution of hydro systems
302 : template <size_t Dim, typename DataType>
303 1 : using tags_for_hydro =
304 : tmpl::list<gr::Tags::Lapse<DataType>, gr::Tags::Shift<DataType, Dim>,
305 : gr::Tags::SpatialMetric<DataType, Dim>,
306 : gr::Tags::InverseSpatialMetric<DataType, Dim>,
307 : gr::Tags::SqrtDetSpatialMetric<DataType>,
308 : ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
309 : Frame::Inertial>,
310 : ::Tags::deriv<gr::Tags::Shift<DataType, Dim>, tmpl::size_t<Dim>,
311 : Frame::Inertial>,
312 : ::Tags::deriv<gr::Tags::SpatialMetric<DataType, Dim>,
313 : tmpl::size_t<Dim>, Frame::Inertial>,
314 : gr::Tags::ExtrinsicCurvature<DataType, Dim>>;
315 :
316 : /// The tags for the variables returned by GR analytic solutions.
317 : template <size_t Dim, typename DataType>
318 1 : using analytic_solution_tags =
319 : tmpl::list<gr::Tags::Lapse<DataType>, ::Tags::dt<gr::Tags::Lapse<DataType>>,
320 : ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
321 : Frame::Inertial>,
322 : gr::Tags::Shift<DataType, Dim>,
323 : ::Tags::dt<gr::Tags::Shift<DataType, Dim>>,
324 : ::Tags::deriv<gr::Tags::Shift<DataType, Dim>, tmpl::size_t<Dim>,
325 : Frame::Inertial>,
326 : gr::Tags::SpatialMetric<DataType, Dim>,
327 : ::Tags::dt<gr::Tags::SpatialMetric<DataType, Dim>>,
328 : ::Tags::deriv<gr::Tags::SpatialMetric<DataType, Dim>,
329 : tmpl::size_t<Dim>, Frame::Inertial>,
330 : gr::Tags::SqrtDetSpatialMetric<DataType>,
331 : gr::Tags::ExtrinsicCurvature<DataType, Dim>,
332 : gr::Tags::InverseSpatialMetric<DataType, Dim>>;
333 : } // namespace gr
|