Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstddef>
7 :
8 : #include "DataStructures/Tensor/TypeAliases.hpp"
9 : #include "Utilities/Gsl.hpp"
10 :
11 : namespace Ccz4 {
12 : /// @{
13 : /*!
14 : * \brief Computes the spatial Ricci tensor
15 : *
16 : * \details Computes the spatial Ricci tensor as:
17 : *
18 : * \f{align}
19 : * R_{ij} &=
20 : * \partial_m \Gamma^m_{ij} - \partial_j \Gamma^m_{im} +
21 : * \Gamma^l_{ij} \Gamma^m_{lm} - \Gamma^l_{im} \Gamma^m_{lj}
22 : * \f}
23 : *
24 : * where
25 : *
26 : * \f{align}
27 : * \partial_k \Gamma^m_{ij} &=
28 : * \partial_k \tilde{\Gamma}^m_{ij} +
29 : * 2 D_k{}^{ml} (\tilde{\gamma}_{jl} P_i + \tilde{\gamma}_{il} P_j -
30 : * \tilde{\gamma}_{ij} P_l)\nonumber\\
31 : * & - 2 \tilde{\gamma}^{ml} (D_{kjl} P_i + D_{kil} P_j - D_{kij} P_l) -
32 : * \tilde{\gamma}^{ml} (
33 : * \tilde{\gamma}_{jl} \partial_{(k} P_{i)} +
34 : * \tilde{\gamma}_{il} \partial_{(k} P_{j)} -
35 : * \tilde{\gamma}_{ij} \partial_{(k} P_{l)})
36 : * \f}
37 : *
38 : * \f$\Gamma^k_{ij}\f$ is the spatial christoffel symbols of the second kind
39 : * defined by `Ccz4::Tags::ChristoffelSecondKind`,
40 : * \f$\partial_m \tilde{\Gamma}^k_{ij}\f$ is the spatial derivative of the
41 : * conformal spatial christoffel symbols of the second kind defined by
42 : * `Ccz4::Tags::DerivConformalChristoffelSecondKind`, \f$\tilde{\gamma}_{ij}\f$
43 : * is the conformal spatial metric defined by `Ccz4::Tags::ConformalMetric`,
44 : * \f$\tilde{\gamma}^{ij}\f$ is the inverse conformal spatial metric defined by
45 : * `Ccz4::Tags::InverseConformalMetric`, \f$D_{ijk}\f$ is the CCZ4 auxiliary
46 : * variable defined by `Ccz4::Tags::FieldD`, \f$D_k{}^{ij}\f$ is the CCZ4
47 : * identity defined by `Ccz4::Tags::FieldDUp`, \f$P_i\f$ is the CCZ4 auxiliary
48 : * variable defined by `Ccz4::Tags::FieldP`, and \f$\partial_j P_{i}\f$ is its
49 : * spatial derivative.
50 : *
51 : * After substituting in the full expressions for \f$\partial_m \Gamma^m_{ij}\f$
52 : * and \f$\partial_j \Gamma^m_{im}\f$ and commuting terms with common
53 : * coefficients, the full equation becomes and is implemented as:
54 : *
55 : * \f{align}{
56 : * R_{ij} &=
57 : * \partial_m \tilde{\Gamma}^m_{ij} -
58 : * \partial_j \tilde{\Gamma}^m_{im}\nonumber\\
59 : * & + 2 D_m{}^{ml} (\tilde{\gamma}_{jl} P_i + \tilde{\gamma}_{il} P_j -
60 : * \tilde{\gamma}_{ij} P_l) -
61 : * 2 \tilde{\gamma}^{ml} (
62 : * D_{mjl} P_i + D_{mil} P_j - D_{mij} P_l)\nonumber\\
63 : * & - 2 D_j{}^{ml} (\tilde{\gamma}_{ml} P_i + \tilde{\gamma}_{il} P_m -
64 : * \tilde{\gamma}_{im} P_l) +
65 : * 2 \tilde{\gamma}^{ml} (
66 : * D_{jml} P_i + D_{jil} P_m - D_{jim} P_l)\nonumber\\
67 : * & - \tilde{\gamma}^{ml} (
68 : * \tilde{\gamma}_{jl} \partial_{(m} P_{i)} +
69 : * \tilde{\gamma}_{il} \partial_{(m} P_{j)} -
70 : * \tilde{\gamma}_{ij} \partial_{(m} P_{l)}) +
71 : * \tilde{\gamma}^{ml} (
72 : * \tilde{\gamma}_{ml} \partial_{(j} P_{i)} +
73 : * \tilde{\gamma}_{il} \partial_{(j} P_{m)} -
74 : * \tilde{\gamma}_{im} \partial_{(j} P_{l)})\nonumber\\
75 : * & + \Gamma^l_{ij} \Gamma^m_{lm} - \Gamma^l_{im} \Gamma^m_{lj}
76 : * \f}
77 : *
78 : * The argument `contracted_christoffel_second_kind` corresponds to the
79 : * \f$\Gamma^m_{lm}\f$ term, the argument
80 : * `contracted_d_conformal_christoffel_difference` corresponds to the
81 : * \f$\partial_m \tilde{\Gamma}^m_{ij} - \partial_j \tilde{\Gamma}^m_{im}\f$
82 : * term, and the argument `contracted_field_d_up` corresponds to the
83 : * \f$D_m{}^{ml}\f$ term.
84 : */
85 : template <typename DataType, size_t Dim, typename Frame>
86 1 : void spatial_ricci_tensor(
87 : const gsl::not_null<tnsr::ii<DataType, Dim, Frame>*> result,
88 : const tnsr::Ijj<DataType, Dim, Frame>& christoffel_second_kind,
89 : const tnsr::i<DataType, Dim, Frame>& contracted_christoffel_second_kind,
90 : const tnsr::ij<DataType, Dim, Frame>&
91 : contracted_d_conformal_christoffel_difference,
92 : const tnsr::ii<DataType, Dim, Frame>& conformal_spatial_metric,
93 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
94 : const tnsr::ijj<DataType, Dim, Frame>& field_d,
95 : const tnsr::iJJ<DataType, Dim, Frame>& field_d_up,
96 : const tnsr::I<DataType, Dim, Frame>& contracted_field_d_up,
97 : const tnsr::i<DataType, Dim, Frame>& field_p,
98 : const tnsr::ij<DataType, Dim, Frame>& d_field_p);
99 :
100 : template <typename DataType, size_t Dim, typename Frame>
101 1 : tnsr::ii<DataType, Dim, Frame> spatial_ricci_tensor(
102 : const tnsr::Ijj<DataType, Dim, Frame>& christoffel_second_kind,
103 : const tnsr::i<DataType, Dim, Frame>& contracted_christoffel_second_kind,
104 : const tnsr::ij<DataType, Dim, Frame>&
105 : contracted_d_conformal_christoffel_difference,
106 : const tnsr::ii<DataType, Dim, Frame>& conformal_spatial_metric,
107 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
108 : const tnsr::ijj<DataType, Dim, Frame>& field_d,
109 : const tnsr::iJJ<DataType, Dim, Frame>& field_d_up,
110 : const tnsr::I<DataType, Dim, Frame>& contracted_field_d_up,
111 : const tnsr::i<DataType, Dim, Frame>& field_p,
112 : const tnsr::ij<DataType, Dim, Frame>& d_field_p);
113 : /// @}
114 : } // namespace Ccz4
|