Ricci.hpp
Go to the documentation of this file.
2 // See LICENSE.txt for details.
3
4 ///\file
5 /// Declares function templates to calculate the Ricci tensor
6
7 #pragma once
8
9 #include <cstddef>
10
11 #include "DataStructures/DataBox/Tag.hpp"
13 #include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp"
14
15 /// \cond
16 namespace gsl {
17 template <typename>
18 struct not_null;
19 } // namespace gsl
20 /// \endcond
21
22 namespace GeneralizedHarmonic {
23 /// @{
24 /*!
25  * \ingroup GeneralRelativityGroup
26  * \brief Compute spatial Ricci tensor using evolved variables and
27  * their first derivatives.
28  *
29  * \details Lets write the Christoffel symbols of the first kind as
30  * \f{align}
31  * \Gamma_{kij} = \frac{1}{2}(\partial_i g_{jk} +
32  * \partial_j g_{ik} -
33  * \partial_k g_{ij})
34  * = (\Phi_{(ij)k} - \frac{1}{2}\Phi_{kij})
35  * \f}
36  * substituting \f$\partial_k g_{ij}\rightarrow{}\Phi_{kij}\f$ by
37  * subtracting out the three-index constraint
38  * \f$C_{kij}=\partial_{k}g_{ij}-\Phi_{kij}\f$ from every term. We also
39  * define contractions \f$d_k=\frac{1}{2}g^{ij}\Phi_{kij}\f$ and
40  * \f$b_k=\frac{1}{2}g^{ij}\Phi_{ijk}\f$. This allows us to rewrite the
41  * spatial Ricci tensor as:
42  * \f{align}
43  * R_{i j} =& \partial_k \Gamma^{k}_{ij} - \partial_i \Gamma^{k}_{kj}
44  * + \Gamma^{k}_{kl}\Gamma^{l}_{ij}
45  * - \Gamma^{l}_{ki}\Gamma^{k}_{lj},\\
46  *
47  * =& g^{kl}\left(\partial_{k}\Phi_{(ij)l} -
48  * \frac{1}{2}\partial_{k}\Phi_{lij}\right)
49  * - b^{l} (\Phi_{(ij)l} - \frac{1}{2}\Phi_{lij})\nonumber\\
50  * & - g^{kl}\left(\partial_{i}\Phi_{(kj)l}
51  * - \frac{1}{2}\partial_{i}\Phi_{lkj}\right)
52  * - \Phi_{i}{}^{kl}\left(\Phi_{(kj)l}
53  * - \frac{1}{2}\Phi_{lkj}
54  * \right)\nonumber\\
55  * & + g^{km}\left(\Phi_{(kl)m} - \frac{1}{2}\Phi_{mkl}\right)
56  * g^{ln}\left(\Phi_{(ij)n} - \frac{1}{2}\Phi_{nij}\right)
57  * \nonumber\\
58  *
59  * & - g^{km}\left(\Phi_{(il)m} - \frac{1}{2}\Phi_{mil}\right)
60  * g^{ln}\left(\Phi_{(jk)n} - \frac{1}{2}\Phi_{njk}\right).
61  * \f}
62  * Gathering all terms with second derivatives:
63  * \f{align}
64  * R_{i j} =& \frac{1}{2} g^{k l} \left(\partial_k\Phi_{ijl}
65  * + \partial_k\Phi_{jil}
66  * - \partial_k\Phi_{lij}
67  * + \partial_i\Phi_{lkj}
68  * - \partial_i\Phi_{kjl}
69  * - \partial_i\Phi_{jkl}\right)
70  * + \mathcal{O}(\Phi), \nonumber\\
71  * =& \frac{1}{2} g^{kl} \left(\partial_{(j}\Phi_{lki)}
72  * - \partial_{(j}\Phi_{i)kl}
73  * + \partial_k \Phi_{(ij)l}
74  * - \partial_l \Phi_{kij} \right)
75  * + \mathcal{O}(\Phi),
76  * \f}
77  * where we use the four-index constraint
78  * \f$C_{klij}=\partial_k\Phi_{lij}-\partial_l\Phi_{kij}=0\f$ to swap the
79  * first and second derivatives of the spatial metric, and symmetrize
80  * \f$R_{ij} = R_{(ij)}\f$. Similarly gathering the remaining terms and
81  * using the four-index constraint we get:
82  * \f{align}
83  * R_{i j} =& - b^k\left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right)
84  * -\frac{1}{2} \Phi_i{}^{kl} \left(\Phi_{jkl} + \Phi_{kjl}
85  * - \Phi_{lkj}\right)\nonumber\\
86  *
87  * &+ \frac{1}{2} d^k \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right)
88  * - \left(\Phi_{(il)}{}^k - \frac{1}{2} \Phi^k{}_{il}\right)
89  * \left(\Phi_{(kj)}{}^l - \frac{1}{2} \Phi^l{}_{kj}\right)
90  * + \mathcal{O}(\partial\Phi) \\
91  *
92  * =& \frac{1}{2} \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right)
93  * (d^k - 2 b^k)
94  * + \frac{1}{4} \Phi_{ik}{}^l \Phi_{jl}{}^k
95  * + \frac{1}{2} \left(\Phi^k{}_{il} \Phi_{kj}{}^l
96  * - \Phi^k{}_{li} \Phi^l{}_{kj}\right)
97  * + \mathcal{O}(\partial\Phi).
98  * \f}
99  * Gathering everything together, we compute the spatial Ricci tensor as:
100  * \f{eqnarray}\label{eq:rij}
101  * R_{i j} &=& \frac{1}{2} g^{kl} \left(\partial_{(j|}\Phi_{lk|i)}
102  * - \partial_{(j}\Phi_{i)kl}
103  * + \partial_k \Phi_{(ij)l}
104  * - \partial_l \Phi_{kij}\right)\nonumber\\
105  * &+& \frac{1}{2} \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right)
106  * (d^k - 2 b^k)
107  * + \frac{1}{4} \Phi_{ik}{}^l \Phi_{jl}{}^k
108  * + \frac{1}{2} \left(\Phi^k{}_{il} \Phi_{kj}{}^l
109  * - \Phi^k{}_{li} \Phi^l{}_{kj}\right).
110  * \f}
111  * This follows from equations (2.13) - (2.20) of \cite Kidder2001tz .
112  *
113  * Note that, in code, the mixed-index variables \f$\Phi_{ij}{}^k\f$ and
114  * \f$\Phi^i{}_{jk}\f$ in Eq.(\f$\ref{eq:rij}\f$) are computed with a factor of
115  * \f$1/2\f$ and so the last 3 terms in the same equation that are quadratic in
116  * these terms occur multiplied by a factor of \f$4\f$.
117  */
118 template <size_t VolumeDim, typename Frame, typename DataType>
120  gsl::not_null<tnsr::ii<DataType, VolumeDim, Frame>*> ricci,
121  const tnsr::iaa<DataType, VolumeDim, Frame>& phi,
122  const tnsr::ijaa<DataType, VolumeDim, Frame>& deriv_phi,
123  const tnsr::II<DataType, VolumeDim, Frame>&
124  inverse_spatial_metric) noexcept;
125
126 template <size_t VolumeDim, typename Frame, typename DataType>
127 tnsr::ii<DataType, VolumeDim, Frame> spatial_ricci_tensor(
128  const tnsr::iaa<DataType, VolumeDim, Frame>& phi,
129  const tnsr::ijaa<DataType, VolumeDim, Frame>& deriv_phi,
130  const tnsr::II<DataType, VolumeDim, Frame>&
131  inverse_spatial_metric) noexcept;
132 /// @}
133 } // namespace GeneralizedHarmonic
GeneralizedHarmonic::spatial_ricci_tensor
void spatial_ricci_tensor(gsl::not_null< tnsr::ii< DataType, VolumeDim, Frame > * > ricci, const tnsr::iaa< DataType, VolumeDim, Frame > &phi, const tnsr::ijaa< DataType, VolumeDim, Frame > &deriv_phi, const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric) noexcept
Compute spatial Ricci tensor using evolved variables and their first derivatives.
GeneralizedHarmonic
Items related to evolving the first-order generalized harmonic system.
Definition: Bjorhus.hpp:38
cstddef
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...
TypeAliases.hpp
gsl
Implementations from the Guideline Support Library.