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