SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Ccz4 - Ricci.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 66.7 % 3 2
Test Date: 2026-10-22 17:29:42
Legend: Lines:     hit not hit

            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              :  * \note In second-order Ccz4, we impose symmetry of index i and j
      86              :  * in \f$ \partial_i P_j=\partial_i \partial_j \ln \phi \f$,
      87              :  * because partial derivatives commute and to use
      88              :  * `second_partial_derivatives()`. \f$ P_i \f$ is evolved in
      89              :  * the first-order system so no such symmetry is imposed.
      90              :  */
      91              : template <typename DataType, size_t Dim, typename Frame, typename TensorType>
      92            1 : void spatial_ricci_tensor(
      93              :     const gsl::not_null<tnsr::ii<DataType, Dim, Frame>*> result,
      94              :     const tnsr::Ijj<DataType, Dim, Frame>& christoffel_second_kind,
      95              :     const tnsr::i<DataType, Dim, Frame>& contracted_christoffel_second_kind,
      96              :     const tnsr::ij<DataType, Dim, Frame>&
      97              :         contracted_d_conformal_christoffel_difference,
      98              :     const tnsr::ii<DataType, Dim, Frame>& conformal_spatial_metric,
      99              :     const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
     100              :     const tnsr::ijj<DataType, Dim, Frame>& field_d,
     101              :     const tnsr::iJJ<DataType, Dim, Frame>& field_d_up,
     102              :     const tnsr::I<DataType, Dim, Frame>& contracted_field_d_up,
     103              :     const tnsr::i<DataType, Dim, Frame>& field_p,
     104              :     const TensorType& d_field_p);
     105              : 
     106              : template <typename DataType, size_t Dim, typename Frame, typename TensorType>
     107            1 : tnsr::ii<DataType, Dim, Frame> spatial_ricci_tensor(
     108              :     const tnsr::Ijj<DataType, Dim, Frame>& christoffel_second_kind,
     109              :     const tnsr::i<DataType, Dim, Frame>& contracted_christoffel_second_kind,
     110              :     const tnsr::ij<DataType, Dim, Frame>&
     111              :         contracted_d_conformal_christoffel_difference,
     112              :     const tnsr::ii<DataType, Dim, Frame>& conformal_spatial_metric,
     113              :     const tnsr::II<DataType, Dim, Frame>& inverse_conformal_spatial_metric,
     114              :     const tnsr::ijj<DataType, Dim, Frame>& field_d,
     115              :     const tnsr::iJJ<DataType, Dim, Frame>& field_d_up,
     116              :     const tnsr::I<DataType, Dim, Frame>& contracted_field_d_up,
     117              :     const tnsr::i<DataType, Dim, Frame>& field_p,
     118              :     const TensorType& d_field_p);
     119              : /// @}
     120              : }  // namespace Ccz4
        

Generated by: LCOV version 2.0-1