SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity - ExtrinsicCurvature.hpp Hit Total Coverage
Commit: 923cd4a8ea30f5a5589baa60b0a93e358ca9f8e8 Lines: 5 10 50.0 %
Date: 2025-11-07 19:37:56
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 "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      10             : #include "Utilities/Gsl.hpp"
      11             : 
      12             : /// \ingroup GeneralRelativityGroup
      13             : /// Holds functions related to general relativity.
      14             : namespace gr {
      15             : /// @{
      16             : /*!
      17             :  * \ingroup GeneralRelativityGroup
      18             :  * \brief  Computes extrinsic curvature from metric and derivatives.
      19             :  * \details Uses the ADM evolution equation for the spatial metric,
      20             :  * \f[ K_{ij} = \frac{1}{2 \alpha} \left ( -\partial_0 \gamma_{ij}
      21             :  * + \beta^k \partial_k \gamma_{ij} + \gamma_{ki} \partial_j \beta^k
      22             :  * + \gamma_{kj} \partial_i \beta^k \right ) \f]
      23             :  * where \f$K_{ij}\f$ is the extrinsic curvature, \f$\alpha\f$ is the lapse,
      24             :  * \f$\beta^i\f$ is the shift, and \f$\gamma_{ij}\f$ is the spatial metric. In
      25             :  * terms of the Lie derivative of the spatial metric with respect to a unit
      26             :  * timelike vector \f$n^a\f$ normal to the spatial slice, this corresponds to
      27             :  * the sign convention
      28             :  * \f[ K_{ab} = - \frac{1}{2} \mathcal{L}_{\mathbf{n}} \gamma_{ab} \f]
      29             :  * where \f$\gamma_{ab}\f$ is the spatial metric. See Eq. (2.53) in
      30             :  * \cite BaumgarteShapiro.
      31             :  */
      32             : template <typename DataType, size_t SpatialDim, typename Frame>
      33           1 : tnsr::ii<DataType, SpatialDim, Frame> extrinsic_curvature(
      34             :     const Scalar<DataType>& lapse,
      35             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      36             :     const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
      37             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      38             :     const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
      39             :     const tnsr::ijj<DataType, SpatialDim, Frame>& deriv_spatial_metric);
      40             : 
      41             : template <typename DataType, size_t SpatialDim, typename Frame>
      42           1 : void extrinsic_curvature(
      43             :     gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*> ex_curvature,
      44             :     const Scalar<DataType>& lapse,
      45             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      46             :     const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
      47             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      48             :     const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
      49             :     const tnsr::ijj<DataType, SpatialDim, Frame>& deriv_spatial_metric);
      50             : /// @}
      51             : 
      52             : /// @{
      53             : /*!
      54             :  * \ingroup GeneralRelativityGroup
      55             :  * \brief  Computes the spatial covariant derivative of the extrinsic curvature.
      56             :  *  \details The spatial covariant derivative is computed as
      57             :  * \f[ D_k K_{ij} = \partial_k K_{ij} - {^{(3)}\Gamma^{l}_{ki}} K_{lj}
      58             :  * - {^{(3)}\Gamma^{l}_{kj}}K_{il} \f]
      59             :  * where \f$ {^{(3)}\Gamma^{k}_{ij}} \f$ is the spatial Christoffel symbol of
      60             :  * the second kind.
      61             :  */
      62             : template <typename DataType, size_t SpatialDim, typename Frame>
      63             : tnsr::ijj<DataType, SpatialDim, Frame>
      64           1 : covariant_derivative_of_extrinsic_curvature(
      65             :     const tnsr::ijj<DataType, SpatialDim, Frame>& d_ex_curv,
      66             :     const tnsr::ii<DataType, SpatialDim, Frame>& ex_curv,
      67             :     const tnsr::Ijj<DataType, SpatialDim, Frame>&
      68             :         spatial_christoffel_second_kind);
      69             : template <typename DataType, size_t SpatialDim, typename Frame>
      70           1 : void covariant_derivative_of_extrinsic_curvature(
      71             :     gsl::not_null<tnsr::ijj<DataType, SpatialDim, Frame>*> grad_ex_curv,
      72             :     const tnsr::ijj<DataType, SpatialDim, Frame>& d_ex_curv,
      73             :     const tnsr::ii<DataType, SpatialDim, Frame>& ex_curv,
      74             :     const tnsr::Ijj<DataType, SpatialDim, Frame>&
      75             :         spatial_christoffel_second_kind);
      76             : /// @}
      77             : 
      78             : namespace Tags {
      79             : /// \copydoc covariant_derivative_of_extrinsic_curvature
      80             : template <size_t SpatialDim, typename Frame>
      81           1 : struct CovariantDerivativeOfExtrinsicCurvatureCompute
      82             :     : gr::Tags::CovariantDerivativeOfExtrinsicCurvature<DataVector, SpatialDim,
      83             :                                                         Frame>,
      84             :       db::ComputeTag {
      85           0 :   using argument_tags = tmpl::list<
      86             :       ::Tags::deriv<gr::Tags::ExtrinsicCurvature<DataVector, SpatialDim, Frame>,
      87             :                     tmpl::size_t<SpatialDim>, Frame>,
      88             :       gr::Tags::ExtrinsicCurvature<DataVector, SpatialDim, Frame>,
      89             :       gr::Tags::SpatialChristoffelSecondKind<DataVector, SpatialDim, Frame>>;
      90             : 
      91           0 :   using return_type = tnsr::ijj<DataVector, SpatialDim, Frame>;
      92             : 
      93           0 :   static constexpr auto function = static_cast<void (*)(
      94             :       const gsl::not_null<tnsr::ijj<DataVector, SpatialDim, Frame>*>,
      95             :       const tnsr::ijj<DataVector, SpatialDim, Frame>&,
      96             :       const tnsr::ii<DataVector, SpatialDim, Frame>&,
      97             :       const tnsr::Ijj<DataVector, SpatialDim, Frame>&
      98             :           spatial_christoffel_second_kind)>(
      99             :       &covariant_derivative_of_extrinsic_curvature<DataVector, SpatialDim,
     100             :                                                    Frame>);
     101             : 
     102           0 :   using base =
     103             :       gr::Tags::CovariantDerivativeOfExtrinsicCurvature<DataVector, SpatialDim,
     104             :                                                         Frame>;
     105             : };
     106             : }  // namespace Tags
     107             : }  // namespace gr

Generated by: LCOV version 1.14