ComputeGhQuantities.hpp
Go to the documentation of this file.
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 ///\file
5 /// Defines Functions for calculating spacetime tensors from 3+1 quantities
6 
7 #pragma once
8 
9 #include <cstddef>
10 
12 
13 /// \cond
14 namespace gsl {
15 template <class T>
16 class not_null;
17 } // namespace gsl
18 /// \endcond
19 
20 namespace GeneralizedHarmonic {
21 /*!
22  * \ingroup GeneralRelativityGroup
23  * \brief Computes the auxiliary variable \f$\Phi_{iab}\f$ used by the
24  * generalized harmonic formulation of Einstein's equations.
25  *
26  * \details If \f$ N, N^i\f$ and \f$ g_{ij} \f$ are the lapse, shift and spatial
27  * metric respectively, then \f$\Phi_{iab} \f$ is computed as
28  *
29  * \f{align}
30  * \Phi_{ktt} &= - 2 N \partial_k N
31  * + 2 g_{mn} N^m \partial_k N^n
32  * + N^m N^n \partial_k g_{mn} \\
33  * \Phi_{kti} &= g_{mi} \partial_k N^m
34  * + N^m \partial_k g_{mi} \\
35  * \Phi_{kij} &= \partial_k g_{ij}
36  * \f}
37  */
38 template <size_t SpatialDim, typename Frame, typename DataType>
39 tnsr::iaa<DataType, SpatialDim, Frame> phi(
40  const Scalar<DataType>& lapse,
41  const tnsr::i<DataType, SpatialDim, Frame>& deriv_lapse,
42  const tnsr::I<DataType, SpatialDim, Frame>& shift,
43  const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
44  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
45  const tnsr::ijj<DataType, SpatialDim, Frame>&
46  deriv_spatial_metric) noexcept;
47 
48 /*!
49  * \ingroup GeneralRelativityGroup
50  * \brief Computes the conjugate momentum \f$\Pi_{ab}\f$ of the spacetime metric
51  * \f$ \psi_{ab} \f$.
52  *
53  * \details If \f$ N, N^i\f$ are the lapse and shift
54  * respectively, and \f$ \Phi_{iab} = \partial_i \psi_{ab} \f$ then
55  * \f$\Pi_{\mu\nu} = -\frac{1}{N} ( \partial_t \psi_{\mu\nu} -
56  * N^m \Phi_{m\mu\nu}) \f$ where \f$ \partial_t \psi_{ab} \f$ is computed
57  * as
58  *
59  * \f{align}
60  * \partial_t \psi_{tt} &= - 2 N \partial_t N
61  * + 2 g_{mn} N^m \partial_t N^n
62  * + N^m N^n \partial_t g_{mn} \\
63  * \partial_t \psi_{ti} &= g_{mi} \partial_t N^m
64  * + N^m \partial_t g_{mi} \\
65  * \partial_t \psi_{ij} &= \partial_t g_{ij}
66  * \f}
67  */
68 template <size_t SpatialDim, typename Frame, typename DataType>
69 tnsr::aa<DataType, SpatialDim, Frame> pi(
70  const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse,
71  const tnsr::I<DataType, SpatialDim, Frame>& shift,
72  const tnsr::I<DataType, SpatialDim, Frame>& dt_shift,
73  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
74  const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
75  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
76 
77 /*!
78  * \ingroup GeneralRelativityGroup
79  * \brief Computes generalized harmonic gauge source function.
80  * \details If \f$N, N^i, g_{ij}, \Gamma_{ijk}, K\f$ are the lapse, shift,
81  * spatial metric, spatial Christoffel symbols, and trace of the extrinsic
82  * curvature, then we compute
83  * \f{align}
84  * H_l &= N^{-2} g_{il}(\partial_t N^i - N^k \partial_k N^i)
85  * + N^{-1} \partial_l N - g^{km}\Gamma_{lkm} \\
86  * H_0 &= -N^{-1} \partial_t N + N^{-1} N^k\partial_k N + N^k H_k - N K
87  * \f}
88  * See Eqs. 8 and 9 of \cite Lindblom2005qh
89  */
90 template <size_t SpatialDim, typename Frame, typename DataType>
91 tnsr::a<DataType, SpatialDim, Frame> gauge_source(
92  const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse,
93  const tnsr::i<DataType, SpatialDim, Frame>& deriv_lapse,
94  const tnsr::I<DataType, SpatialDim, Frame>& shift,
95  const tnsr::I<DataType, SpatialDim, Frame>& dt_shift,
96  const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
97  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
98  const Scalar<DataType>& trace_extrinsic_curvature,
99  const tnsr::i<DataType, SpatialDim, Frame>&
100  trace_christoffel_last_indices) noexcept;
101 
102 /*!
103  * \ingroup GeneralRelativityGroup
104  * \brief Computes extrinsic curvature from generalized harmonic variables
105  * and the spacetime normal vector.
106  *
107  * \details If \f$ \Pi_{ab} \f$ and \f$ \Phi_{iab} \f$ are the generalized
108  * harmonic conjugate momentum and spatial derivative variables, and if
109  * \f$t^a\f$ is the spacetime normal vector, then the extrinsic curvature
110  * is computed as
111  * \f{align}
112  * K_{ij} &= \frac{1}{2} \Pi_{ij} + \Phi_{(ij)a} t^a
113  * \f}
114  */
115 template <size_t SpatialDim, typename Frame, typename DataType>
116 tnsr::ii<DataType, SpatialDim, Frame> extrinsic_curvature(
117  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
118  const tnsr::aa<DataType, SpatialDim, Frame>& pi,
119  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
120 
121 // @{
122 /*!
123  * \ingroup GeneralRelativityGroup
124  * \brief Computes spatial derivatives of the spatial metric from
125  * the generalized harmonic spatial derivative variable.
126  *
127  * \details If \f$ \Phi_{kab} \f$ is the generalized
128  * harmonic spatial derivative variable, then the derivatives of the
129  * spatial metric are
130  * \f[
131  * \partial_k g_{ij} = \Phi_{kij}
132  * \f]
133  *
134  * This quantity is needed for computing spatial Christoffel symbols.
135  */
136 template <size_t SpatialDim, typename Frame, typename DataType>
138  gsl::not_null<tnsr::ijj<DataType, SpatialDim, Frame>*> d_spatial_metric,
139  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
140 
141 template <size_t SpatialDim, typename Frame, typename DataType>
142 tnsr::ijj<DataType, SpatialDim, Frame> deriv_spatial_metric(
143  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
144 // @}
145 
146 // @{
147 /*!
148  * \ingroup GeneralRelativityGroup
149  * \brief Computes time derivative of the spatial metric.
150  *
151  * \details Let the generalized harmonic conjugate momentum and spatial
152  * derivative variables be \f$\Pi_{ab} = -t^c \partial_c \psi_{ab} \f$ and
153  * \f$\Phi_{iab} = \partial_i \psi_{ab} \f$. As \f$ t_i \equiv 0 \f$. The time
154  * derivative of the spatial metric is given by the time derivative of the
155  * spatial sector of the spacetime metric, i.e.
156  * \f$ \partial_0 g_{ij} = \partial_0 \psi_{ij} \f$.
157  *
158  * To compute the latter, we use the evolution equation for \f$ \psi_{ij} \f$,
159  * c.f. eq.(35) of \cite Lindblom2005qh (with \f$\gamma_1 = -1\f$):
160  *
161  * \f[
162  * \partial_0 \psi_{ab} = - N \Pi_{ab} + N^k \Phi_{kab}
163  * \f]
164  */
165 template <size_t SpatialDim, typename Frame, typename DataType>
167  gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*> dt_spatial_metric,
168  const Scalar<DataType>& lapse,
169  const tnsr::I<DataType, SpatialDim, Frame>& shift,
170  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
171  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
172 
173 template <size_t SpatialDim, typename Frame, typename DataType>
174 tnsr::ii<DataType, SpatialDim, Frame> time_deriv_of_spatial_metric(
175  const Scalar<DataType>& lapse,
176  const tnsr::I<DataType, SpatialDim, Frame>& shift,
177  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
178  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
179 // @}
180 
181 // @{
182 /*!
183  * \ingroup GeneralRelativityGroup
184  * \brief Computes spacetime derivatives of the determinant of spatial metric,
185  * using the generalized harmonic variables, spatial metric, and its
186  * time derivative.
187  *
188  * \details Using the relation \f$ \partial_a g = g g^{jk} \partial_a g_{jk} \f$
189  */
190 template <size_t SpatialDim, typename Frame, typename DataType>
192  gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> d4_det_spatial_metric,
193  const Scalar<DataType>& sqrt_det_spatial_metric,
194  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
195  const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
196  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
197 
198 template <size_t SpatialDim, typename Frame, typename DataType>
199 tnsr::a<DataType, SpatialDim, Frame> spacetime_deriv_of_det_spatial_metric(
200  const Scalar<DataType>& sqrt_det_spatial_metric,
201  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
202  const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
203  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
204 // @}
205 
206 // @{
207 /*!
208  * \ingroup GeneralRelativityGroup
209  * \brief Computes spatial derivatives of lapse (N) from the generalized
210  * harmonic variables and spacetime unit normal 1-form.
211  *
212  * \details If the generalized harmonic conjugate momentum and spatial
213  * derivative variables are \f$\Pi_{ab} = -t^c \partial_c \psi_{ab} \f$ and
214  * \f$\Phi_{iab} = \partial_i \psi_{ab} \f$, the spatial derivatives of N
215  * can be obtained from:
216  * \f{align*}
217  * t^a t^b \Phi_{iab} = -\frac{1}{2N} [\partial_i (-N^2 + N_jN^j)-
218  * 2 N^j \partial_i N_j
219  * + N^j N^k \partial_i g_{jk}]
220  * = -\frac{2}{N} \partial_i N,
221  * \f}
222  * since
223  * \f[
224  * \partial_i (N_jN^j) = 2N^j \partial_i N_j - N^j N^k \partial_i g_{jk}.
225  * \f]
226  *
227  * \f[
228  * \Longrightarrow \partial_i N = -(N/2) t^a \Phi_{iab} t^b
229  * \f]
230  */
231 template <size_t SpatialDim, typename Frame, typename DataType>
233  gsl::not_null<tnsr::i<DataType, SpatialDim, Frame>*> deriv_lapse,
234  const Scalar<DataType>& lapse,
235  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
236  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
237 
238 template <size_t SpatialDim, typename Frame, typename DataType>
239 tnsr::i<DataType, SpatialDim, Frame> spatial_deriv_of_lapse(
240  const Scalar<DataType>& lapse,
241  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
242  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
243 // @}
244 
245 // @{
246 /*!
247  * \ingroup GeneralRelativityGroup
248  * \brief Computes time derivative of lapse (N) from the generalized
249  * harmonic variables, lapse, shift and the spacetime unit normal 1-form.
250  *
251  * \details Let the generalized harmonic conjugate momentum and spatial
252  * derivative variables be \f$\Pi_{ab} = -t^c \partial_c \psi_{ab} \f$ and
253  * \f$\Phi_{iab} = \partial_i \psi_{ab} \f$, and the operator
254  * \f$D := \partial_0 - N^k \partial_k \f$. The time derivative of N is then:
255  * \f{align*}
256  * \frac{1}{2} N^2 t^a t^b \Pi_{ab} - \frac{1}{2} N N^i t^a t^b \Phi_{iab}
257  * =& \frac{1}{2} N^2 t^a t^b t^c \partial_c \psi_{ab}
258  * - \frac{1}{2} N N^i (-(2/N) \partial_i N) \\
259  * =& \frac{1}{2} N^2 [-(1/N^3) D[g_{jk} N^j N^k - N^2] \\
260  * &- (N^j N^k / N^3)D[g_{jk}] \\
261  * &+ 2 (N^j / N^3) D[g_{jk} N^k] + (2 / N^2)(N^i \partial_i N)] \\
262  * =& \frac{1}{2N} [-D[g_{jk}N^jN^k - N^2] - N^jN^k D[g_{jk}]
263  * + 2N N^k\partial_k N + 2N^j D[g_{jk}N^k]] \\
264  * =& D[N] + N^k\partial_k N \\
265  * =& \partial_0 N
266  * \f}
267  * where the simplification done for \f$\partial_i N\f$ is used to substitute
268  * for the second term (\f$\frac{1}{2} N N^i t^a t^b \Phi_{iab}\f$).
269  *
270  * Thus,
271  * \f[
272  * \partial_0 N = (N/2)(N t^a t^b \Pi_{ab} - N^i t^a t^b \Phi_{iab})
273  * \f]
274  */
275 template <size_t SpatialDim, typename Frame, typename DataType>
278  const tnsr::I<DataType, SpatialDim, Frame>& shift,
279  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
280  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
281  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
282 
283 template <size_t SpatialDim, typename Frame, typename DataType>
285  const Scalar<DataType>& lapse,
286  const tnsr::I<DataType, SpatialDim, Frame>& shift,
287  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
288  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
289  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
290 // @}
291 
292 // @{
293 /*!
294  * \ingroup GeneralRelativityGroup
295  * \brief Computes spatial derivatives of the shift vector from
296  * the generalized harmonic and geometric variables
297  *
298  * \details Spatial derivatives of the shift vector \f$N^i\f$ can be derived
299  * from the following steps:
300  * \f{align*}
301  * \partial_i N^j
302  * =& g^{jl} g_{kl} \partial_i N^k \\
303  * =& g^{jl} (N^k \partial_i g_{lk}
304  * + g_{kl}\partial_i N^k - N^k \partial_i g_{kl}) \\
305  * =& g^{jl} (\partial_i N_l - N^k \partial_i g_{lk}) (\because g^{j0} = 0) \\
306  * =& g^{ja} (\partial_i \psi_{a0} - N^k \partial _i \psi_{ak}) \\
307  * =& N g^{ja} t^b \partial_i \psi_{ab} \\
308  * =& (g^{ja} - t^j t^a) N t^b \Phi_{iab} - 2 t^j \partial_i N \\
309  * =& \psi^{ja} N t^b \Phi_{iab} - 2 t^j \partial_i N \\
310  * =& N (\psi^{ja} + t^j t^a) t^b \Phi_{iab}.
311  * \f}
312  * where we used the equation from spatial_deriv_of_lapse() for
313  * \f$\partial_i N\f$.
314  */
315 template <size_t SpatialDim, typename Frame, typename DataType>
317  gsl::not_null<tnsr::iJ<DataType, SpatialDim, Frame>*> deriv_shift,
318  const Scalar<DataType>& lapse,
319  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
320  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
321  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
322 
323 template <size_t SpatialDim, typename Frame, typename DataType>
324 tnsr::iJ<DataType, SpatialDim, Frame> spatial_deriv_of_shift(
325  const Scalar<DataType>& lapse,
326  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
327  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
328  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
329 // @}
330 
331 // @{
332 /*!
333  * \ingroup GeneralRelativityGroup
334  * \brief Computes time derivative of the shift vector from
335  * the generalized harmonic and geometric variables
336  *
337  * \details The time derivative of \f$ N^i \f$ can be derived from the following
338  * steps:
339  * \f{align*}
340  * \partial_0 N^i
341  * =& g^{ik} \partial_0 (g_{kj} N^j) - N^j g^{ik} \partial_0 g_{kj} \\
342  * =& N g^{ik} t^b \partial_0 \psi_{kb} \\
343  * =& N g^{ik} t^b (\partial_0 - N^j\partial_j) \psi_{kb}
344  * + N g^{ik} t^b N^j\partial_j \psi_{kb} \\
345  * =& -N^2 t^b\Pi_{kb} g^{ik} + N N^j t^b\Phi_{jkb} g^{ik} \\
346  * =& -N g^{ik} t^b (N \Pi_{kb} - N^j \Phi_{jkb}) \\
347  * \f}
348  */
349 template <size_t SpatialDim, typename Frame, typename DataType>
351  gsl::not_null<tnsr::I<DataType, SpatialDim, Frame>*> dt_shift,
352  const Scalar<DataType>& lapse,
353  const tnsr::I<DataType, SpatialDim, Frame>& shift,
354  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
355  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
356  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
357  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
358 
359 template <size_t SpatialDim, typename Frame, typename DataType>
360 tnsr::I<DataType, SpatialDim, Frame> time_deriv_of_shift(
361  const Scalar<DataType>& lapse,
362  const tnsr::I<DataType, SpatialDim, Frame>& shift,
363  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
364  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
365  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
366  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
367 // @}
368 
369 // @{
370 /*!
371  * \ingroup GeneralRelativityGroup
372  * \brief Computes time derivative of index lowered shift from generalized
373  * harmonic variables, spatial metric and its time derivative.
374  *
375  * \details The time derivative of \f$ N_i \f$ is given by:
376  * \f{align*}
377  * \partial_0 N_i = g_{ij} \partial_0 N^j + N^j \partial_0 g_{ij}
378  * \f}
379  * where the first term is obtained from `time_deriv_of_shift()`, and the latter
380  * is a user input.
381  */
382 template <size_t SpatialDim, typename Frame, typename DataType>
384  gsl::not_null<tnsr::i<DataType, SpatialDim, Frame>*> dt_lower_shift,
385  const Scalar<DataType>& lapse,
386  const tnsr::I<DataType, SpatialDim, Frame>& shift,
387  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
388  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
389  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
390  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
391 
392 template <size_t SpatialDim, typename Frame, typename DataType>
393 tnsr::i<DataType, SpatialDim, Frame> time_deriv_of_lower_shift(
394  const Scalar<DataType>& lapse,
395  const tnsr::I<DataType, SpatialDim, Frame>& shift,
396  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
397  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
398  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
399  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
400 // @}
401 
402 // @{
403 /*!
404  * \ingroup GeneralRelativityGroup
405  * \brief Computes spacetime derivatives of the norm of the shift vector.
406  *
407  * \details The same is computed as:
408  * \f{align*}
409  * \partial_a (N^i N_i) = (N_i \partial_0 N^i + N^i \partial_0 N_i,
410  * N_i \partial_j N^i + N^i \partial_j N_i)
411  * \f}
412  */
413 template <size_t SpatialDim, typename Frame, typename DataType>
415  gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> d4_norm_of_shift,
416  const Scalar<DataType>& lapse,
417  const tnsr::I<DataType, SpatialDim, Frame>& shift,
418  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
419  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
420  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
421  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
422  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
423  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
424 
425 template <size_t SpatialDim, typename Frame, typename DataType>
426 tnsr::a<DataType, SpatialDim, Frame> spacetime_deriv_of_norm_of_shift(
427  const Scalar<DataType>& lapse,
428  const tnsr::I<DataType, SpatialDim, Frame>& shift,
429  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
430  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
431  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
432  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
433  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
434  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
435 // @}
436 } // namespace GeneralizedHarmonic
Implementations from the Guideline Support Library.
Definition: ConservativeFromPrimitive.hpp:10
void spatial_deriv_of_shift(gsl::not_null< tnsr::iJ< DataType, SpatialDim, Frame > *> deriv_shift, const Scalar< DataType > &lapse, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variable...
void time_deriv_of_lapse(gsl::not_null< Scalar< DataType > *> dt_lapse, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi) noexcept
Computes time derivative of lapse (N) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form.
tnsr::A< DataType, SpatialDim, Frame > spacetime_normal_vector(const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift) noexcept
Computes spacetime normal vector from lapse and shift.
Definition: ComputeSpacetimeQuantities.cpp:185
void time_deriv_of_lower_shift(gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > *> dt_lower_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi) noexcept
Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative.
void spacetime_deriv_of_det_spatial_metric(gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > *> d4_det_spatial_metric, const Scalar< DataType > &sqrt_det_spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic v...
tnsr::ii< DataType, SpatialDim, Frame > spatial_metric(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute spatial metric from spacetime metric.
Definition: ComputeSpacetimeQuantities.cpp:43
tnsr::AA< DataType, SpatialDim, Frame > inverse_spacetime_metric(const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Compute inverse spacetime metric from inverse spatial metric, lapse and shift.
tnsr::ii< DataVector, 3, Frame > extrinsic_curvature(const tnsr::ii< DataVector, 3, Frame > &grad_normal, const tnsr::i< DataVector, 3, Frame > &unit_normal_one_form, const tnsr::I< DataVector, 3, Frame > &unit_normal_vector) noexcept
Extrinsic curvature of a 2D Strahlkorper embedded in a 3D space.
void spacetime_deriv_of_norm_of_shift(gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > *> d4_norm_of_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi) noexcept
Computes spacetime derivatives of the norm of the shift vector.
tnsr::aa< DataType, SpatialDim, Frame > pi(const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes the conjugate momentum of the spacetime metric .
Definition: ComputeGhQuantities.cpp:58
tnsr::iaa< DataType, SpatialDim, Frame > phi(const Scalar< DataType > &lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric) noexcept
Computes the auxiliary variable used by the generalized harmonic formulation of Einstein&#39;s equations...
Definition: ComputeGhQuantities.cpp:22
Items related to evolving the first-order generalized harmonic system.
Definition: Characteristics.cpp:25
Scalar< DataType > lapse(const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute lapse from shift and spacetime metric.
Definition: ComputeSpacetimeQuantities.cpp:98
Defines a list of useful type aliases for tensors.
void deriv_spatial_metric(gsl::not_null< tnsr::ijj< DataType, SpatialDim, Frame > *> d_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative v...
tnsr::I< DataType, SpatialDim, Frame > shift(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Compute shift from spacetime metric and inverse spatial metric.
Definition: ComputeSpacetimeQuantities.cpp:82
void time_deriv_of_shift(gsl::not_null< tnsr::I< DataType, SpatialDim, Frame > *> dt_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi) noexcept
Computes time derivative of the shift vector from the generalized harmonic and geometric variables...
void spatial_deriv_of_lapse(gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > *> deriv_lapse, const Scalar< DataType > &lapse, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes spatial derivatives of lapse (N) from the generalized harmonic variables and spacetime unit ...
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
void time_deriv_of_spatial_metric(gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > *> dt_spatial_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi) noexcept
Computes time derivative of the spatial metric.
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12
tnsr::a< DataType, SpatialDim, Frame > gauge_source(const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const Scalar< DataType > &trace_extrinsic_curvature, const tnsr::i< DataType, SpatialDim, Frame > &trace_christoffel_last_indices) noexcept
Computes generalized harmonic gauge source function.
Definition: ComputeGhQuantities.cpp:99