Constraints.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 to calculate the generalized harmonic constraints
6 
7 #pragma once
8 
9 #include <cstddef>
10 
12 #include "DataStructures/DataBox/Tag.hpp"
13 #include "DataStructures/DataVector.hpp"
15 #include "Evolution/Systems/GeneralizedHarmonic/ConstraintDamping/Tags.hpp"
16 #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
18 #include "Utilities/ContainerHelpers.hpp"
19 #include "Utilities/TMPL.hpp"
20 
21 /// \cond
22 namespace gsl {
23 template <typename T>
24 class not_null;
25 } // namespace gsl
26 /// \endcond
27 
28 namespace GeneralizedHarmonic {
29 // @{
30 /*!
31  * \brief Computes the generalized-harmonic 3-index constraint.
32  *
33  * \details Computes the generalized-harmonic 3-index constraint,
34  * \f$C_{iab} = \partial_i\psi_{ab} - \Phi_{iab},\f$ which is
35  * given by Eq. (26) of \cite Lindblom2005qh
36  */
37 template <size_t SpatialDim, typename Frame, typename DataType>
38 tnsr::iaa<DataType, SpatialDim, Frame> three_index_constraint(
39  const tnsr::iaa<DataType, SpatialDim, Frame>& d_spacetime_metric,
40  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
41 
42 template <size_t SpatialDim, typename Frame, typename DataType>
44  gsl::not_null<tnsr::iaa<DataType, SpatialDim, Frame>*> constraint,
45  const tnsr::iaa<DataType, SpatialDim, Frame>& d_spacetime_metric,
46  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
47 // @}
48 
49 // @{
50 /*!
51  * \brief Computes the generalized-harmonic gauge constraint.
52  *
53  * \details Computes the generalized-harmonic gauge constraint
54  * [Eq. (40) of \cite Lindblom2005qh],
55  * \f[
56  * C_a = H_a + g^{ij} \Phi_{ija} + t^b \Pi_{ba}
57  * - \frac{1}{2} g^i_a \psi^{bc} \Phi_{ibc}
58  * - \frac{1}{2} t_a \psi^{bc} \Pi_{bc},
59  * \f]
60  * where \f$H_a\f$ is the gauge function,
61  * \f$\psi_{ab}\f$ is the spacetime metric,
62  * \f$\Pi_{ab}=-t^c\partial_c \psi_{ab}\f$, and
63  * \f$\Phi_{iab} = \partial_i\psi_{ab}\f$; \f$t^a\f$ is the timelike unit
64  * normal vector to the spatial slice, \f$g^{ij}\f$ is the inverse spatial
65  * metric, and \f$g^b_c = \delta^b_c + t^b t_c\f$.
66  */
67 template <size_t SpatialDim, typename Frame, typename DataType>
68 tnsr::a<DataType, SpatialDim, Frame> gauge_constraint(
69  const tnsr::a<DataType, SpatialDim, Frame>& gauge_function,
70  const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
71  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
72  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
73  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
74  const tnsr::aa<DataType, SpatialDim, Frame>& pi,
75  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
76 
77 template <size_t SpatialDim, typename Frame, typename DataType>
78 void gauge_constraint(
79  gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> constraint,
80  const tnsr::a<DataType, SpatialDim, Frame>& gauge_function,
81  const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
82  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
83  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
84  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
85  const tnsr::aa<DataType, SpatialDim, Frame>& pi,
86  const tnsr::iaa<DataType, SpatialDim, Frame>& phi) noexcept;
87 // @}
88 
89 // @{
90 /*!
91  * \brief Computes the generalized-harmonic 2-index constraint.
92  *
93  * \details Computes the generalized-harmonic 2-index constraint
94  * [Eq. (44) of \cite Lindblom2005qh],
95  * \f{eqnarray}{
96  * C_{ia} &\equiv& g^{jk}\partial_j \Phi_{ika}
97  * - \frac{1}{2} g_a^j\psi^{cd}\partial_j \Phi_{icd}
98  * + t^b \partial_i \Pi_{ba}
99  * - \frac{1}{2} t_a \psi^{cd}\partial_i\Pi_{cd}
100  * \nonumber\\&&
101  * + \partial_i H_a
102  * + \frac{1}{2} g_a^j \Phi_{jcd} \Phi_{ief}
103  * \psi^{ce}\psi^{df}
104  * + \frac{1}{2} g^{jk} \Phi_{jcd} \Phi_{ike}
105  * \psi^{cd}t^e t_a
106  * \nonumber\\&&
107  * - g^{jk}g^{mn}\Phi_{jma}\Phi_{ikn}
108  * + \frac{1}{2} \Phi_{icd} \Pi_{be} t_a
109  * \left(\psi^{cb}\psi^{de}
110  * +\frac{1}{2}\psi^{be} t^c t^d\right)
111  * \nonumber\\&&
112  * - \Phi_{icd} \Pi_{ba} t^c \left(\psi^{bd}
113  * +\frac{1}{2} t^b t^d\right)
114  * + \frac{1}{2} \gamma_2 \left(t_a \psi^{cd}
115  * - 2 \delta^c_a t^d\right) C_{icd}.
116  * \f}
117  * where \f$H_a\f$ is the gauge function,
118  * \f$\psi_{ab}\f$ is the spacetime metric,
119  * \f$\Pi_{ab}=-t^c\partial_c \psi_{ab}\f$, and
120  * \f$\Phi_{iab} = \partial_i\psi_{ab}\f$; \f$t^a\f$ is the timelike unit
121  * normal vector to the spatial slice, \f$g^{ij}\f$ is the inverse spatial
122  * metric, and \f$g^b_c = \delta^b_c + t^b t_c\f$.
123  */
124 template <size_t SpatialDim, typename Frame, typename DataType>
125 tnsr::ia<DataType, SpatialDim, Frame> two_index_constraint(
126  const tnsr::ia<DataType, SpatialDim, Frame>& d_gauge_function,
127  const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
128  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
129  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
130  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
131  const tnsr::aa<DataType, SpatialDim, Frame>& pi,
132  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
133  const tnsr::iaa<DataType, SpatialDim, Frame>& d_pi,
134  const tnsr::ijaa<DataType, SpatialDim, Frame>& d_phi,
135  const Scalar<DataType>& gamma2,
136  const tnsr::iaa<DataType, SpatialDim, Frame>&
137  three_index_constraint) noexcept;
138 
139 template <size_t SpatialDim, typename Frame, typename DataType>
141  gsl::not_null<tnsr::ia<DataType, SpatialDim, Frame>*> constraint,
142  const tnsr::ia<DataType, SpatialDim, Frame>& d_gauge_function,
143  const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
144  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
145  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
146  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
147  const tnsr::aa<DataType, SpatialDim, Frame>& pi,
148  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
149  const tnsr::iaa<DataType, SpatialDim, Frame>& d_pi,
150  const tnsr::ijaa<DataType, SpatialDim, Frame>& d_phi,
151  const Scalar<DataType>& gamma2,
152  const tnsr::iaa<DataType, SpatialDim, Frame>&
153  three_index_constraint) noexcept;
154 // @}
155 
156 // @{
157 /*!
158  * \brief Computes the generalized-harmonic 4-index constraint.
159  *
160  * \details Computes the independent components of the generalized-harmonic
161  * 4-index constraint. The constraint itself is given by Eq. (45) of
162  * \cite Lindblom2005qh,
163  * \f{eqnarray}{
164  * C_{ijab} = 2 \partial_{[i}\Phi_{j]ab},
165  * \f}
166  * where \f$\Phi_{iab} = \partial_i\psi_{ab}\f$. Because the constraint is
167  * antisymmetric on the two spatial indices, here we compute and store
168  * only the independent components of \f$C_{ijab}\f$. Specifically, we
169  * compute
170  * \f{eqnarray}{
171  * D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab}
172  * = \epsilon_{i}{}^{jk} \partial_j \Phi_{kab},
173  * \f}
174  * where \f$\epsilon_{ijk}\f$ is the flat-space Levi-Civita symbol,
175  * which is raised and lowered with the Kronecker delta.
176  * In terms
177  * of \f$D_{iab}\f$, the full 4-index constraint is
178  * \f{eqnarray}{
179  * C_{jkab} = \epsilon^{i}{}_{jk} D_{iab}.
180  * \f}
181  */
182 template <size_t SpatialDim, typename Frame, typename DataType>
183 tnsr::iaa<DataType, SpatialDim, Frame> four_index_constraint(
184  const tnsr::ijaa<DataType, SpatialDim, Frame>& d_phi) noexcept;
185 
186 template <size_t SpatialDim, typename Frame, typename DataType>
188  gsl::not_null<tnsr::iaa<DataType, SpatialDim, Frame>*> constraint,
189  const tnsr::ijaa<DataType, SpatialDim, Frame>& d_phi) noexcept;
190 // @}
191 
192 // @{
193 /*!
194  * \brief Computes the generalized-harmonic F constraint.
195  *
196  * \details Computes the generalized-harmonic F constraint
197  * [Eq. (43) of \cite Lindblom2005qh],
198  * \f{eqnarray}{
199  * {\cal F}_a &\equiv&
200  * \frac{1}{2} g_a^i \psi^{bc}\partial_i \Pi_{bc}
201  * - g^{ij} \partial_i \Pi_{ja}
202  * - g^{ij} t^b \partial_i \Phi_{jba}
203  * + \frac{1}{2} t_a \psi^{bc} g^{ij} \partial_i \Phi_{jbc}
204  * \nonumber \\ &&
205  * + t_a g^{ij} \partial_i H_j
206  * + g_a^i \Phi_{ijb} g^{jk}\Phi_{kcd} \psi^{bd} t^c
207  * - \frac{1}{2} g_a^i \Phi_{ijb} g^{jk}
208  * \Phi_{kcd} \psi^{cd} t^b
209  * \nonumber \\ &&
210  * - g_a^i t^b \partial_i H_b
211  * + g^{ij} \Phi_{icd} \Phi_{jba} \psi^{bc} t^d
212  * - \frac{1}{2} t_a g^{ij} g^{mn} \Phi_{imc} \Phi_{njd}\psi^{cd}
213  * \nonumber \\ &&
214  * - \frac{1}{4} t_a g^{ij}\Phi_{icd}\Phi_{jbe}
215  * \psi^{cb}\psi^{de}
216  * + \frac{1}{4} t_a \Pi_{cd} \Pi_{be}
217  * \psi^{cb}\psi^{de}
218  * - g^{ij} H_i \Pi_{ja}
219  * \nonumber \\ &&
220  * - t^b g^{ij} \Pi_{b i} \Pi_{ja}
221  * - \frac{1}{4} g_a^i \Phi_{icd} t^c t^d \Pi_{be}
222  * \psi^{be}
223  * + \frac{1}{2} t_a \Pi_{cd} \Pi_{be}\psi^{ce}
224  * t^d t^b
225  * \nonumber \\ &&
226  * + g_a^i \Phi_{icd} \Pi_{be} t^c t^b \psi^{de}
227  * - g^{ij}\Phi_{iba} t^b \Pi_{je} t^e
228  * - \frac{1}{2} g^{ij}\Phi_{icd} t^c t^d \Pi_{ja}
229  * \nonumber \\ &&
230  * - g^{ij} H_i \Phi_{jba} t^b
231  * + g_{a}^i \Phi_{icd} H_b \psi^{bc} t^d
232  * +\gamma_2\bigl(g^{id}{\cal C}_{ida}
233  * -\frac{1}{2} g_a^i\psi^{cd}{\cal C}_{icd}\bigr)
234  * \nonumber \\ &&
235  * + \frac{1}{2} t_a \Pi_{cd}\psi^{cd} H_b t^b
236  * - t_a g^{ij} \Phi_{ijc} H_d \psi^{cd}
237  * +\frac{1}{2} t_a g^{ij} H_i \Phi_{jcd}\psi^{cd},
238  * \f}
239  * where \f$H_a\f$ is the gauge function,
240  * \f$\psi_{ab}\f$ is the spacetime metric,
241  * \f$\Pi_{ab}=-t^c\partial_c \psi_{ab}\f$, and
242  * \f$\Phi_{iab} = \partial_i\psi_{ab}\f$; \f$t^a\f$ is the timelike unit
243  * normal vector to the spatial slice, \f$g^{ij}\f$ is the inverse spatial
244  * metric, and \f$g^b_c = \delta^b_c + t^b t_c\f$.
245  */
246 template <size_t SpatialDim, typename Frame, typename DataType>
247 tnsr::a<DataType, SpatialDim, Frame> f_constraint(
248  const tnsr::a<DataType, SpatialDim, Frame>& gauge_function,
249  const tnsr::ia<DataType, SpatialDim, Frame>& d_gauge_function,
250  const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
251  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
252  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
253  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
254  const tnsr::aa<DataType, SpatialDim, Frame>& pi,
255  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
256  const tnsr::iaa<DataType, SpatialDim, Frame>& d_pi,
257  const tnsr::ijaa<DataType, SpatialDim, Frame>& d_phi,
258  const Scalar<DataType>& gamma2,
259  const tnsr::iaa<DataType, SpatialDim, Frame>&
260  three_index_constraint) noexcept;
261 
262 template <size_t SpatialDim, typename Frame, typename DataType>
263 void f_constraint(
264  gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> constraint,
265  const tnsr::a<DataType, SpatialDim, Frame>& gauge_function,
266  const tnsr::ia<DataType, SpatialDim, Frame>& d_gauge_function,
267  const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
268  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
269  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
270  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
271  const tnsr::aa<DataType, SpatialDim, Frame>& pi,
272  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
273  const tnsr::iaa<DataType, SpatialDim, Frame>& d_pi,
274  const tnsr::ijaa<DataType, SpatialDim, Frame>& d_phi,
275  const Scalar<DataType>& gamma2,
276  const tnsr::iaa<DataType, SpatialDim, Frame>&
277  three_index_constraint) noexcept;
278 // @}
279 
280 // @{
281 /*!
282  * \brief Computes the generalized-harmonic (unnormalized) constraint energy.
283  *
284  * \details Computes the generalized-harmonic unnormalized constraint energy
285  * [Eq. (53) of \cite Lindblom2005qh with \f$m^{ab}=\delta^{ab}\f$ and with each
286  * term in the sum scaled by an arbitrary coefficient],
287  * \f{eqnarray}{
288  * E & = & K_1 C_a C_a + K_2\left(F_a F_a
289  + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
290  & + & K_3 C_{iab} C_{jab} g^{ij} + K_4 C_{ikab} C_{jlab}g^{ij} g^{kl}.
291  * \f}
292  * Here \f$C_a\f$ is the gauge constraint, \f$F_a\f$ is the f constraint,
293  * \f$C_{ia}\f$ is the two-index constraint, \f$C_{iab}\f$ is the
294  * three-index constraint, \f$C_{ikab}\f$ is the four-index constraint,
295  * \f$g^{ij}\f$ is the inverse spatial metric, and
296  * \f$K_1\f$, \f$K_2\f$, \f$K_3\f$, and \f$K_4\f$ are constant multipliers
297  * for each term that each default to a value of 1.0. Note that in this
298  * equation, spacetime indices \f$a,b\f$ are raised and lowered with
299  * the Kronecker delta.
300  *
301  * Also note that the argument `four_index_constraint` is a rank-3 tensor.
302  * This is because `GeneralizedHarmonic::four_index_constraint()` takes
303  * advantage of the antisymmetry of the four-index constraint's first two
304  * indices to only compute and return the independent
305  * components of \f$C_{ijab}\f$, which can be written as
306  * \f{eqnarray}{
307  * D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab},
308  * \f} where \f$\epsilon_{ijk}\f$ is the flat-space Levi-Civita tensor,
309  * whose inidces are raised and lowered with the Kronecker delta.
310  * The result is
311  * \f{eqnarray}{
312  * E & = & K_1 C_a C_a + K_2\left(F_a F_a
313  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
314  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
315  & + & 2 K_4 g D_{iab} D_{jab} g^{ij},
316  * \f} where \f$g\f$ is the determinant of the spatial metric.
317  *
318  * To derive this expression for the constraint energy implemented here,
319  * Eq.~(53) of \cite Lindblom2005qh is
320  * \f{eqnarray}{
321  * S_{AB} dc^A dc^B &=&
322  * m^{ab}\Bigl[d F_ad F_b
323  * +g^{ij}\bigl(d C_{ia}d C_{jb}
324  * +g^{kl}m^{cd}d C_{ikac}d C_{jlbd}\bigr)
325  * \nonumber\\
326  * & + & \Lambda^2\bigl(d C_ad C_b
327  * +g^{ij}m^{cd}d C_{iac}d C_{jbd}\bigr)
328  * \Bigr].
329  * \f} Replace \f$dc^A\rightarrow c^A\f$ to get
330  * \f{eqnarray}{
331  * E&=&
332  * m^{ab}\Bigl[ F_a F_b
333  * +g^{ij}\bigl( C_{ia} C_{jb}
334  * +g^{kl}m^{cd} C_{ikac} C_{jlbd}\bigr)
335  * \nonumber\\
336  * & + & \Lambda^2\bigl( C_a C_b
337  * +g^{ij}m^{cd} C_{iac} C_{jbd}\bigr)
338  * \Bigr]\nonumber\\
339  * &=&
340  * m^{ab} F_a F_b
341  * +m^{ab}g^{ij} C_{ia} C_{jb}
342  * +m^{ab}g^{ij} g^{kl}m^{cd} C_{ikac} C_{jlbd}
343  * \nonumber\\
344  * & + & m^{ab}\Lambda^2 C_a C_b
345  * +m^{ab}\Lambda^2 g^{ij}m^{cd} C_{iac} C_{jbd}.
346  * \f} Here \f$m^{ab}\f$ is an arbitrary positive-definite matrix, and
347  * \f$\Lambda\f$ is an arbitrary real scalar.
348  * Choose \f$m^{ab} = \delta^{ab}\f$ but allow an arbitrary coefficient to be
349  * placed in front of each term. Then, absorb \f$\Lambda^2\f$ into one of
350  * these coefficients, to get
351  * \f{eqnarray}{ E &=& K_
352  * F\delta^{ab} F_a F_b +K_2\delta^{ab}g^{ij} C_{ia} C_{jb}
353  +K_4\delta^{ab}g^{ij}
354  * g^{kl}\delta^{cd} C_{ikac} C_{jlbd}
355  * \nonumber\\
356  * & + & K_1\delta^{ab} C_a C_b
357  * +K_3\delta^{ab} g^{ij}\delta^{cd} C_{iac} C_{jbd}.
358  * \f}
359  * Adopting a Euclidean norm for the constraint space (i.e., choosing to raise
360  and
361  * lower spacetime indices with Kronecker deltas) gives
362  * \f{eqnarray}{ E &=& K_ F
363  * F_a F_a +K_2g^{ij} C_{ia} C_{ja} +K_4 g^{ij} g^{kl} C_{ikac} C_{jlac}
364  * \nonumber\\
365  * & + & K_1 C_a C_a
366  * +K_3g^{ij} C_{iac} C_{jac}.
367  * \f} The two-index constraint and f constraint can be viewed as the
368  * time and space components of a combined spacetime constraint. So next
369  * choose
370  * \f$K_ F=K_2\f$, giving \f{eqnarray}{ E&=& K_1 C_a C_a + K_2\left(F_a F_a
371  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
372  * & + & K_3 C_{iab} C_{jab} g^{ij}
373  * + K_4 C_{ikab} C_{jlab}g^{ij} g^{kl}.
374  * \f}
375  *
376  * Note that \f$C_{ikab}\f$ is antisymmetric on the first two indices. Next,
377  * replace the four-index constraint \f$C_{ijab}\f$ with \f$D_{iab}\f$, which
378  * contains the independent components of \f$C_{ijab}\f$. Specifically,
379  * \f{eqnarray}{
380  * D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab}.
381  * \f} The inverse relationship is
382  * \f{eqnarray}{
383  * C_{jkab} = \epsilon^{i}{}_{jk} D_{iab},
384  * \f} where \f$\epsilon_{ijk}\f$ is the flat-space Levi-Civita tensor, whose
385  * indices are raised and lowered with the Kronecker delta. Inserting this
386  relation
387  * to replace \f$C_{jkab}\f$ with \f$D_{iab}\f$ gives \f{eqnarray}{ E &=& K_1
388  C_a
389  * C_a + K_2\left(F_a F_a
390  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
391  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
392  * & + & K_4 D_{mab} D_{nab} \epsilon^{m}{}_{ik}
393  * \epsilon^{n}{}_{jl} g^{ij} g^{kl}. \f}
394  *
395  * There's a subtle point here: \f$g^{ij}\f$ is the inverse spatial metric,
396  which
397  * is not necessarily flat. But \f$\epsilon^{i}{}_{jk}\f$ is the flat space
398  * Levi-Civita tensor. In order to raise and lower indices of the Levi-Civita
399  * tensor with the inverse spatial metrics, put in the appropriate factors of
400  * \f$\sqrt{g}\f$, where \f$g\f$ is the metric determinant, to make the
401  * curved-space Levi-Civita tensor compatible with \f$g^{ij}\f$. Let
402  * \f$\varepsilon^{ijk}\f$ represent the curved space Levi-Civita tensor
403  compatible
404  * with \f$g^{ij}\f$: \f{eqnarray}{
405  * \varepsilon^{mik} = g^{-1/2} \epsilon^{mik}\\
406  * \varepsilon_{mik} = g^{1/2} \epsilon_{mik}.
407  * \f} Then we can write the constraint energy as
408  * \f{eqnarray}{
409  * E &=& K_1 C_a C_a + K_2\left(F_a F_a
410  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
411  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
412  * & + & K_4 D_{mab} D_{nab} g g^{-1/2}\epsilon^{m}{}_{ik}
413  * g^{-1/2}\epsilon^{n}{}_{jl} g^{ij} g^{kl}. \f} The factors of
414  * \f$g^{-1/2}\f$ make the Levi-Civita tensor compatible with \f$g^{ij}\f$.
415  * Swapping which summed indices are raised and which are lowered gives
416  * \f{eqnarray}{ E &=& K_1 C_a
417  C_a +
418  * K_2\left(F_a F_a
419  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
420  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
421  * & + & K_4 D_{mab} D_{nab} g g^{-1/2}\epsilon^{mik}
422  g^{-1/2}\epsilon^{njl}
423  * g_{ij} g_{kl}, \f} or \f{eqnarray}{ E &=& K_1 C_a C_a + K_2\left(F_a F_a
424  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
425  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
426  * & + & K_4 D_{mab} D_{nab} g \varepsilon^{mik} \varepsilon^{njl} g_{ij}
427  * g_{kl}, \f} or, reversing up and down repeated indices again,
428  * \f{eqnarray}{ E
429  * &=& K_1 C_a C_a + K_2\left(F_a F_a
430  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
431  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
432  * & + & K_4 D_{mab} D_{nab} g \varepsilon^{m}{}_{ik}
433  \varepsilon^{n}{}_{jl}
434  * g^{ij} g^{kl}. \f}
435  *
436  * The metric raises and lowers the indices of \f$\varepsilon^{ijk}\f$,
437  * so this can
438  * be written as \f{eqnarray}{ E &=& K_1 C_a C_a + K_2\left(F_a F_a
439  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
440  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
441  * & + & K_4 g D_{mab} D^{n}{}_{ab} \varepsilon^{mjl} \varepsilon_{njl}.
442  * \f}
443  *
444  * Now, in flat space (Eq. (1.23) of \cite ThorneBlandford2017),
445  * \f{eqnarray}{
446  * \epsilon^{mjl} \epsilon_{njl} = \delta^{mj}_{nj} = \delta^m_n \delta^j_j -
447  * \delta^m_j \delta^j_n = 2 \delta^m_n. \f} But this holds for curved space
448  * as well: multiply the left hand side by \f$1 = g^{1/2} g^{-1/2}\f$ to get
449  * \f{eqnarray}{
450  * g^{-1/2}\epsilon^{mjl} g^{1/2}\epsilon_{njl} = \varepsilon^{mjl}
451  * \varepsilon_{njl} = \delta^{mj}_{nj} = \delta^m_n \delta^j_j - \delta^m_j
452  * \delta^j_n = 2 \delta^m_n. \f} So the constraint energy is \f{eqnarray}{ E
453  &=&
454  * K_1 C_a C_a + K_2\left(F_a F_a
455  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
456  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
457  * & + & 2 K_4 D_{mab} D^{n}{}_{ab} \delta^m_n.
458  * \f}
459  * Simplifying gives the formula implemented here:
460  * \f{eqnarray}{
461  * E &=& K_1 C_a C_a + K_2\left(F_a F_a
462  * + C_{ia} C_{ja} g^{ij}\right)\nonumber\\
463  * & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\
464  * & + & 2 K_4 g D_{iab} D_{jab} g^{ij}.
465  * \f}
466  */
467 template <size_t SpatialDim, typename Frame, typename DataType>
469  const tnsr::a<DataType, SpatialDim, Frame>& gauge_constraint,
470  const tnsr::a<DataType, SpatialDim, Frame>& f_constraint,
471  const tnsr::ia<DataType, SpatialDim, Frame>& two_index_constraint,
472  const tnsr::iaa<DataType, SpatialDim, Frame>& three_index_constraint,
473  const tnsr::iaa<DataType, SpatialDim, Frame>& four_index_constraint,
474  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
475  const Scalar<DataType>& spatial_metric_determinant,
476  double gauge_constraint_multiplier = 1.0,
477  double two_index_constraint_multiplier = 1.0,
478  double three_index_constraint_multiplier = 1.0,
479  double four_index_constraint_multiplier = 1.0) noexcept;
480 
481 template <size_t SpatialDim, typename Frame, typename DataType>
482 void constraint_energy(
483  gsl::not_null<Scalar<DataType>*> energy,
484  const tnsr::a<DataType, SpatialDim, Frame>& gauge_constraint,
485  const tnsr::a<DataType, SpatialDim, Frame>& f_constraint,
486  const tnsr::ia<DataType, SpatialDim, Frame>& two_index_constraint,
487  const tnsr::iaa<DataType, SpatialDim, Frame>& three_index_constraint,
488  const tnsr::iaa<DataType, SpatialDim, Frame>& four_index_constraint,
489  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
490  const Scalar<DataType>& spatial_metric_determinant,
491  double gauge_constraint_multiplier = 1.0,
492  double two_index_constraint_multiplier = 1.0,
493  double three_index_constraint_multiplier = 1.0,
494  double four_index_constraint_multiplier = 1.0) noexcept;
495 // @}
496 
497 namespace Tags {
498 /*!
499  * \brief Compute item to get the gauge constraint for the
500  * generalized harmonic evolution system.
501  *
502  * \details See `gauge_constraint()`. Can be retrieved using
503  * `GeneralizedHarmonic::Tags::GaugeConstraint`.
504  */
505 template <size_t SpatialDim, typename Frame>
506 struct GaugeConstraintCompute : GaugeConstraint<SpatialDim, Frame>,
508  using argument_tags = tmpl::list<
515 
516  using return_type = tnsr::a<DataVector, SpatialDim, Frame>;
517 
518  static constexpr auto function = static_cast<void (*)(
520  const tnsr::a<DataVector, SpatialDim, Frame>&,
521  const tnsr::a<DataVector, SpatialDim, Frame>&,
522  const tnsr::A<DataVector, SpatialDim, Frame>&,
523  const tnsr::II<DataVector, SpatialDim, Frame>&,
524  const tnsr::AA<DataVector, SpatialDim, Frame>&,
525  const tnsr::aa<DataVector, SpatialDim, Frame>&,
526  const tnsr::iaa<DataVector, SpatialDim, Frame>&) noexcept>(
527  &gauge_constraint<SpatialDim, Frame, DataVector>);
528 
530 };
531 
532 /*!
533  * \brief Compute item to get the F-constraint for the
534  * generalized harmonic evolution system.
535  *
536  * \details See `f_constraint()`. Can be retrieved using
537  * `GeneralizedHarmonic::Tags::FConstraint`.
538  */
539 template <size_t SpatialDim, typename Frame>
540 struct FConstraintCompute : FConstraint<SpatialDim, Frame>, db::ComputeTag {
541  using argument_tags = tmpl::list<
543  ::Tags::deriv<GaugeH<SpatialDim, Frame>, tmpl::size_t<SpatialDim>, Frame>,
549  ::Tags::deriv<Pi<SpatialDim, Frame>, tmpl::size_t<SpatialDim>, Frame>,
550  ::Tags::deriv<Phi<SpatialDim, Frame>, tmpl::size_t<SpatialDim>, Frame>,
553 
554  using return_type = tnsr::a<DataVector, SpatialDim, Frame>;
555 
556  static constexpr auto function = static_cast<void (*)(
558  const tnsr::a<DataVector, SpatialDim, Frame>&,
559  const tnsr::ia<DataVector, SpatialDim, Frame>&,
560  const tnsr::a<DataVector, SpatialDim, Frame>&,
561  const tnsr::A<DataVector, SpatialDim, Frame>&,
562  const tnsr::II<DataVector, SpatialDim, Frame>&,
563  const tnsr::AA<DataVector, SpatialDim, Frame>&,
564  const tnsr::aa<DataVector, SpatialDim, Frame>&,
565  const tnsr::iaa<DataVector, SpatialDim, Frame>&,
566  const tnsr::iaa<DataVector, SpatialDim, Frame>&,
567  const tnsr::ijaa<DataVector, SpatialDim, Frame>&,
568  const Scalar<DataVector>&,
569  const tnsr::iaa<DataVector, SpatialDim, Frame>&) noexcept>(
570  &f_constraint<SpatialDim, Frame, DataVector>);
571 
573 };
574 
575 /*!
576  * \brief Compute item to get the two-index constraint for the
577  * generalized harmonic evolution system.
578  *
579  * \details See `two_index_constraint()`. Can be retrieved using
580  * `GeneralizedHarmonic::Tags::TwoIndexConstraint`.
581  */
582 template <size_t SpatialDim, typename Frame>
583 struct TwoIndexConstraintCompute : TwoIndexConstraint<SpatialDim, Frame>,
585  using argument_tags = tmpl::list<
586  ::Tags::deriv<GaugeH<SpatialDim, Frame>, tmpl::size_t<SpatialDim>, Frame>,
592  ::Tags::deriv<Pi<SpatialDim, Frame>, tmpl::size_t<SpatialDim>, Frame>,
593  ::Tags::deriv<Phi<SpatialDim, Frame>, tmpl::size_t<SpatialDim>, Frame>,
596 
597  using return_type = tnsr::ia<DataVector, SpatialDim, Frame>;
598 
599  static constexpr auto function = static_cast<void (*)(
601  const tnsr::ia<DataVector, SpatialDim, Frame>&,
602  const tnsr::a<DataVector, SpatialDim, Frame>&,
603  const tnsr::A<DataVector, SpatialDim, Frame>&,
604  const tnsr::II<DataVector, SpatialDim, Frame>&,
605  const tnsr::AA<DataVector, SpatialDim, Frame>&,
606  const tnsr::aa<DataVector, SpatialDim, Frame>&,
607  const tnsr::iaa<DataVector, SpatialDim, Frame>&,
608  const tnsr::iaa<DataVector, SpatialDim, Frame>&,
609  const tnsr::ijaa<DataVector, SpatialDim, Frame>&,
610  const Scalar<DataVector>&,
611  const tnsr::iaa<DataVector, SpatialDim, Frame>&) noexcept>(
612  &two_index_constraint<SpatialDim, Frame, DataVector>);
613 
615 };
616 
617 /*!
618  * \brief Compute item to get the three-index constraint for the
619  * generalized harmonic evolution system.
620  *
621  * \details See `three_index_constraint()`. Can be retrieved using
622  * `GeneralizedHarmonic::Tags::ThreeIndexConstraint`.
623  */
624 template <size_t SpatialDim, typename Frame>
627  using argument_tags =
628  tmpl::list<::Tags::deriv<gr::Tags::SpacetimeMetric<SpatialDim, Frame>,
629  tmpl::size_t<SpatialDim>, Frame>,
631 
632  using return_type = tnsr::iaa<DataVector, SpatialDim, Frame>;
633 
634  static constexpr auto function = static_cast<void (*)(
636  const tnsr::iaa<DataVector, SpatialDim, Frame>&,
637  const tnsr::iaa<DataVector, SpatialDim, Frame>&) noexcept>(
638  &three_index_constraint<SpatialDim, Frame, DataVector>);
639 
641 };
642 
643 /*!
644  * \brief Compute item to get the four-index constraint for the
645  * generalized harmonic evolution system.
646  *
647  * \details See `four_index_constraint()`. Can be retrieved using
648  * `GeneralizedHarmonic::Tags::FourIndexConstraint`.
649  */
650 template <size_t SpatialDim, typename Frame>
653  using argument_tags = tmpl::list<
654  ::Tags::deriv<Phi<SpatialDim, Frame>, tmpl::size_t<SpatialDim>, Frame>>;
655 
656  using return_type = tnsr::iaa<DataVector, SpatialDim, Frame>;
657 
658  static constexpr auto function = static_cast<void (*)(
660  const tnsr::ijaa<DataVector, SpatialDim, Frame>&) noexcept>(
661  &four_index_constraint<SpatialDim, Frame, DataVector>);
662 
664 };
665 
666 /*!
667  * \brief Compute item to get combined energy in all constraints for the
668  * generalized harmonic evolution system.
669  *
670  * \details See `constraint_energy()`. Can be retrieved using
671  * `GeneralizedHarmonic::Tags::ConstraintEnergy`.
672  */
673 template <size_t SpatialDim, typename Frame>
674 struct ConstraintEnergyCompute : ConstraintEnergy<SpatialDim, Frame>,
676  using argument_tags =
677  tmpl::list<GaugeConstraint<SpatialDim, Frame>,
684 
685  using return_type = Scalar<DataVector>;
686 
687  static constexpr auto function(
688  const gsl::not_null<Scalar<DataVector>*> energy,
689  const tnsr::a<DataVector, SpatialDim, Frame>& gauge_constraint,
690  const tnsr::a<DataVector, SpatialDim, Frame>& f_constraint,
691  const tnsr::ia<DataVector, SpatialDim, Frame>& two_index_constraint,
692  const tnsr::iaa<DataVector, SpatialDim, Frame>& three_index_constraint,
693  const tnsr::iaa<DataVector, SpatialDim, Frame>& four_index_constraint,
694  const tnsr::II<DataVector, SpatialDim, Frame>& inverse_spatial_metric,
695  const Scalar<DataVector>& spatial_metric_determinant) noexcept {
697  get(spatial_metric_determinant).size());
698  constraint_energy<SpatialDim, Frame, DataVector>(
700  three_index_constraint, four_index_constraint, inverse_spatial_metric,
701  spatial_metric_determinant);
702  }
703 
705 };
706 } // namespace Tags
707 } // namespace GeneralizedHarmonic
GeneralizedHarmonic::four_index_constraint
tnsr::iaa< DataType, SpatialDim, Frame > four_index_constraint(const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi) noexcept
Computes the generalized-harmonic 4-index constraint.
Definition: Constraints.cpp:1085
db::ComputeTag
Mark a struct as a compute tag by inheriting from this.
Definition: Tag.hpp:157
GeneralizedHarmonic::Tags::GaugeConstraint
Tags corresponding to various constraints of the generalized harmonic system, and their diagnosticall...
Definition: Tags.hpp:153
GeneralizedHarmonic::pi
void pi(gsl::not_null< 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 .
GeneralizedHarmonic::Tags::FourIndexConstraintCompute
Compute item to get the four-index constraint for the generalized harmonic evolution system.
Definition: Constraints.hpp:651
GeneralizedHarmonic::constraint_energy
Scalar< DataType > constraint_energy(const tnsr::a< DataType, SpatialDim, Frame > &gauge_constraint, const tnsr::a< DataType, SpatialDim, Frame > &f_constraint, const tnsr::ia< DataType, SpatialDim, Frame > &two_index_constraint, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint, const tnsr::iaa< DataType, SpatialDim, Frame > &four_index_constraint, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const Scalar< DataType > &spatial_metric_determinant, double gauge_constraint_multiplier, double two_index_constraint_multiplier, double three_index_constraint_multiplier, double four_index_constraint_multiplier) noexcept
Computes the generalized-harmonic (unnormalized) constraint energy.
Definition: Constraints.cpp:1233
get
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:638
gr::Tags::SpacetimeNormalVector
Definition: Tags.hpp:87
GeneralizedHarmonic
Items related to evolving the first-order generalized harmonic system.
Definition: Characteristics.cpp:21
gr::Tags::DetSpatialMetric
Determinant of the spatial metric.
Definition: Tags.hpp:40
GeneralizedHarmonic::Tags::GaugeConstraintCompute
Compute item to get the gauge constraint for the generalized harmonic evolution system.
Definition: Constraints.hpp:506
GeneralizedHarmonic::f_constraint
tnsr::a< DataType, SpatialDim, Frame > f_constraint(const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::ia< DataType, SpatialDim, Frame > &d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint) noexcept
Computes the generalized-harmonic F constraint.
Definition: Constraints.cpp:1122
cstddef
GeneralizedHarmonic::Tags::Pi< SpatialDim, Frame >
gr::Tags::InverseSpacetimeMetric
Definition: Tags.hpp:21
GeneralizedHarmonic::Tags::ConstraintEnergy
Tags corresponding to various constraints of the generalized harmonic system, and their diagnosticall...
Definition: Tags.hpp:178
GeneralizedHarmonic::Tags::ThreeIndexConstraintCompute
Compute item to get the three-index constraint for the generalized harmonic evolution system.
Definition: Constraints.hpp:625
GeneralizedHarmonic::phi
void phi(gsl::not_null< 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's equations...
GeneralizedHarmonic::Tags::FConstraint
Tags corresponding to various constraints of the generalized harmonic system, and their diagnosticall...
Definition: Tags.hpp:158
GeneralizedHarmonic::Tags::GaugeH< SpatialDim, Frame >
GeneralizedHarmonic::three_index_constraint
tnsr::iaa< DataType, SpatialDim, Frame > three_index_constraint(const tnsr::iaa< DataType, SpatialDim, Frame > &d_spacetime_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes the generalized-harmonic 3-index constraint.
Definition: Constraints.cpp:927
gr::Tags::SpacetimeNormalOneForm
Definition: Tags.hpp:83
GeneralizedHarmonic::ConstraintDamping::Tags::ConstraintGamma2
Constraint dammping parameter for the generalized harmonic system (cf. ).
Definition: Tags.hpp:70
GeneralizedHarmonic::gauge_constraint
tnsr::a< DataType, SpatialDim, Frame > gauge_constraint(const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes the generalized-harmonic gauge constraint.
Definition: Constraints.cpp:957
tnsr
Type aliases to construct common Tensors.
Definition: TypeAliases.hpp:31
GeneralizedHarmonic::Tags::Phi< SpatialDim, Frame >
GeneralizedHarmonic::Tags::FourIndexConstraint
Tags corresponding to various constraints of the generalized harmonic system, and their diagnosticall...
Definition: Tags.hpp:173
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
GeneralizedHarmonic::Tags::FConstraintCompute
Compute item to get the F-constraint for the generalized harmonic evolution system.
Definition: Constraints.hpp:540
GeneralizedHarmonic::Tags::ThreeIndexConstraint
Tags corresponding to various constraints of the generalized harmonic system, and their diagnosticall...
Definition: Tags.hpp:168
TypeAliases.hpp
Frame
Definition: IndexType.hpp:36
GeneralizedHarmonic::two_index_constraint
tnsr::ia< DataType, SpatialDim, Frame > two_index_constraint(const tnsr::ia< DataType, SpatialDim, Frame > &d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint) noexcept
Computes the generalized-harmonic 2-index constraint.
Definition: Constraints.cpp:1014
Tags::deriv
Prefix indicating spatial derivatives.
Definition: PartialDerivatives.hpp:52
PartialDerivatives.hpp
GeneralizedHarmonic::Tags::TwoIndexConstraintCompute
Compute item to get the two-index constraint for the generalized harmonic evolution system.
Definition: Constraints.hpp:583
Prefixes.hpp
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:11
GeneralizedHarmonic::Tags::ConstraintEnergyCompute
Compute item to get combined energy in all constraints for the generalized harmonic evolution system.
Definition: Constraints.hpp:674
gr::inverse_spacetime_metric
void inverse_spacetime_metric(gsl::not_null< 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.
TMPL.hpp
gr::spacetime_normal_vector
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.
GeneralizedHarmonic::Tags::TwoIndexConstraint
Tags corresponding to various constraints of the generalized harmonic system, and their diagnosticall...
Definition: Tags.hpp:163
gr::Tags::InverseSpatialMetric
Inverse of the spatial metric.
Definition: Tags.hpp:33
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13
destructive_resize_components
void destructive_resize_components(const gsl::not_null< Container * > container, const size_t new_size, DestructiveResizeFunction destructive_resize=ContainerDestructiveResize{}) noexcept
Checks the size of each component of the container, and resizes if necessary.
Definition: ContainerHelpers.hpp:177