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 derivative of the conformal spatial christoffel
15 : * symbols of the second kind
16 : *
17 : * \details Computes the derivative as:
18 : * \f{align}
19 : * \partial_k \tilde{\Gamma}^m{}_{ij} &=
20 : * -2 D_k{}^{ml} (D_{ijl} + D_{jil} - D_{lij}) +
21 : * \tilde{\gamma}^{ml}(\partial_{(k} D_{i)jl} + \partial_{(k} D_{j)il} -
22 : * \partial_{(k} D_{l)ij})
23 : * \f}
24 : * where \f$\tilde{\gamma}^{ij}\f$, \f$D_{ijk}\f$, \f$\partial_l D_{ijk}\f$, and
25 : * \f$D_k{}^{ij}\f$ are the inverse conformal spatial metric defined by
26 : * `Ccz4::Tags::InverseConformalMetric`, the CCZ4 auxiliary variable defined by
27 : * `Ccz4::Tags::FieldD`, its spatial derivative, and the CCZ4 identity defined
28 : * by `Ccz4::Tags::FieldDUp`.
29 : * \note In second-order Ccz4, we impose symmetry of index k and l
30 : * in \f$ \partial_l D_{kij}=\frac{1}{2}\partial_l \partial_k
31 : * \tilde{\gamma}_{ij} \f$, because partial derivatives commute and to use
32 : * `second_partial_derivatives()`. \f$ D_{kij} \f$ is evolved in
33 : * the first-order system so no such symmetry is imposed.
34 : */
35 : template <typename DataType, size_t Dim, typename Frame, typename TensorType>
36 1 : void deriv_conformal_christoffel_second_kind(
37 : const gsl::not_null<tnsr::iJkk<DataType, Dim, Frame>*> result,
38 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
39 : const tnsr::ijj<DataType, Dim, Frame>& field_d, const TensorType& d_field_d,
40 : const tnsr::iJJ<DataType, Dim, Frame>& field_d_up);
41 :
42 : template <typename DataType, size_t Dim, typename Frame, typename TensorType>
43 1 : tnsr::iJkk<DataType, Dim, Frame> deriv_conformal_christoffel_second_kind(
44 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
45 : const tnsr::ijj<DataType, Dim, Frame>& field_d, const TensorType& d_field_d,
46 : const tnsr::iJJ<DataType, Dim, Frame>& field_d_up);
47 :
48 : /// @}
49 :
50 : /// @{
51 : /*!
52 : * \brief Computes the spatial derivative of the contraction of the conformal
53 : * spatial Christoffel symbols of the second kind
54 : *
55 : * \details Computes the derivative as:
56 : *
57 : * \f{align}
58 : * \partial_k \tilde{\Gamma}^i &= -2 D_k{}^{jl} \tilde{\Gamma}^i_{jl} +
59 : * \tilde{\gamma}^{jl} \partial_k \tilde{\Gamma}^i_{jl}
60 : * \f}
61 : *
62 : * where \f$\tilde{\gamma}^{ij}\f$ is the inverse conformal spatial metric
63 : * defined by `Ccz4::Tags::InverseConformalMetric`, \f$D_k{}^{ij}\f$ is the CCZ4
64 : * identity defined by `Ccz4::Tags::FieldDUp`, \f$\tilde{\Gamma}^k_{ij}\f$ is
65 : * the conformal spatial Christoffel symbols of the second kind defined by
66 : * `Ccz4::Tags::ConformalChristoffelSecondKind`, and
67 : * \f$\partial_k \tilde{\Gamma}^k_{ij}\f$ is its spatial derivative defined by
68 : * `Ccz4::Tags::DerivConformalChristoffelSecondKind`.
69 : */
70 : template <typename DataType, size_t Dim, typename Frame>
71 1 : void deriv_contracted_conformal_christoffel_second_kind(
72 : const gsl::not_null<tnsr::iJ<DataType, Dim, Frame>*> result,
73 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
74 : const tnsr::iJJ<DataType, Dim, Frame>& field_d_up,
75 : const tnsr::Ijj<DataType, Dim, Frame>& conformal_christoffel_second_kind,
76 : const tnsr::iJkk<DataType, Dim, Frame>&
77 : d_conformal_christoffel_second_kind);
78 :
79 : template <typename DataType, size_t Dim, typename Frame>
80 : tnsr::iJ<DataType, Dim, Frame>
81 1 : deriv_contracted_conformal_christoffel_second_kind(
82 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
83 : const tnsr::iJJ<DataType, Dim, Frame>& field_d_up,
84 : const tnsr::Ijj<DataType, Dim, Frame>& conformal_christoffel_second_kind,
85 : const tnsr::iJkk<DataType, Dim, Frame>&
86 : d_conformal_christoffel_second_kind);
87 : /// @}
88 : } // namespace Ccz4
|