SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - Christoffel.hpp Hit Total Coverage
Commit: 664546099c4dbf27a1b708fac45e39c82dd743d2 Lines: 4 5 80.0 %
Date: 2024-04-19 16:28:01
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 gh {
      12             : /// @{
      13             : /*!
      14             :  * \ingroup GeneralRelativityGroup
      15             :  * \brief Computes spatial Christoffel symbol of the 2nd kind from the
      16             :  * the generalized harmonic spatial derivative variable and the
      17             :  * inverse spatial metric.
      18             :  *
      19             :  * \details
      20             :  * If \f$ \Phi_{kab} \f$ is the generalized harmonic spatial derivative
      21             :  * variable \f$ \Phi_{kab} = \partial_k g_{ab}\f$ and \f$\gamma^{ij}\f$ is the
      22             :  * inverse spatial metric, the Christoffel symbols are
      23             :  * \f[
      24             :  *   \Gamma^m_{ij} = \frac{1}{2}\gamma^{mk}(\Phi_{ijk}+\Phi_{jik}-\Phi_{kij}).
      25             :  * \f]
      26             :  *
      27             :  * In the not_null version, no memory allocations are performed if the
      28             :  * output tensor already has the correct size.
      29             :  *
      30             :  */
      31             : template <typename DataType, size_t SpatialDim, typename Frame>
      32           1 : void christoffel_second_kind(
      33             :     const gsl::not_null<tnsr::Ijj<DataType, SpatialDim, Frame>*> christoffel,
      34             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      35             :     const tnsr::II<DataType, SpatialDim, Frame>& inv_metric);
      36             : 
      37             : template <typename DataType, size_t SpatialDim, typename Frame>
      38           1 : auto christoffel_second_kind(
      39             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      40             :     const tnsr::II<DataType, SpatialDim, Frame>& inv_metric)
      41             :     -> tnsr::Ijj<DataType, SpatialDim, Frame>;
      42             : /// @}
      43             : 
      44             : /// @{
      45             : /*!
      46             :  * \brief Compute \f$\Gamma_a\f$ from the generalized harmonic evolved
      47             :  * variables.
      48             :  *
      49             :  * Starting from Eq. (40) of \cite Lindblom2005qh we get
      50             :  *
      51             :  * \f{align*}{
      52             :  *  \Gamma_a &= \gamma^{ij}\Phi_{ija} + n^b \Pi_{ab} -
      53             :  *   \frac{1}{2}\gamma^{i}{}_ag^{bc}\Phi_{ibc} - \frac{1}{2}n_ag^{bc}\Pi_{bc}
      54             :  *   \\
      55             :  *   \Gamma_a &= \gamma^{ij}\Phi_{ija} + n^b \Pi_{ab} -\frac{1}{2}
      56             :  *               n_a g^{bc} \left(n^i \Phi_{ibc} + \Pi_{bc}\right)
      57             :  *               - \frac{1}{2} \delta^i_a g^{bc} \Phi_{ibc}
      58             :  * \f}
      59             :  */
      60             : template <typename DataType, size_t SpatialDim, typename Frame>
      61           1 : tnsr::a<DataType, SpatialDim, Frame> trace_christoffel(
      62             :     const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
      63             :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
      64             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
      65             :     const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
      66             :     const tnsr::aa<DataType, SpatialDim, Frame>& pi,
      67             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      68             : 
      69             : template <typename DataType, size_t SpatialDim, typename Frame>
      70           1 : void trace_christoffel(
      71             :     gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> trace,
      72             :     const tnsr::a<DataType, SpatialDim, Frame>& spacetime_normal_one_form,
      73             :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
      74             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
      75             :     const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
      76             :     const tnsr::aa<DataType, SpatialDim, Frame>& pi,
      77             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      78             : /// @}
      79             : }  // namespace gh

Generated by: LCOV version 1.14