SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - ExtrinsicCurvature.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 30.8 % 13 4
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/DataBox/Prefixes.hpp"
       9              : #include "DataStructures/DataBox/Tag.hpp"
      10              : #include "DataStructures/DataVector.hpp"
      11              : #include "DataStructures/Tensor/EagerMath/Trace.hpp"
      12              : #include "DataStructures/Tensor/Tensor.hpp"
      13              : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      14              : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      15              : #include "Utilities/ContainerHelpers.hpp"
      16              : #include "Utilities/Gsl.hpp"
      17              : #include "Utilities/TMPL.hpp"
      18              : 
      19              : /// \cond
      20              : namespace domain {
      21              : namespace Tags {
      22              : template <size_t Dim, typename Frame>
      23              : struct Coordinates;
      24              : }  // namespace Tags
      25              : }  // namespace domain
      26              : class DataVector;
      27              : template <typename X, typename Symm, typename IndexList>
      28              : class Tensor;
      29              : /// \endcond
      30              : 
      31              : namespace gh {
      32              : /// @{
      33              : /*!
      34              :  * \ingroup GeneralRelativityGroup
      35              :  * \brief Computes extrinsic curvature from generalized harmonic variables
      36              :  *        and the spacetime normal vector.
      37              :  *
      38              :  * \details If \f$ \Pi_{ab} \f$ and \f$ \Phi_{iab} \f$ are the generalized
      39              :  * harmonic conjugate momentum and spatial derivative variables, and if
      40              :  * \f$n^a\f$ is the spacetime normal vector, then the extrinsic curvature
      41              :  * is computed as
      42              :  * \f{align}
      43              :  *     K_{ij} &= \frac{1}{2} \Pi_{ij} + \Phi_{(ij)a} n^a
      44              :  * \f}
      45              :  */
      46              : template <typename DataType, size_t SpatialDim, typename Frame>
      47            1 : void extrinsic_curvature(
      48              :     gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*> ex_curv,
      49              :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
      50              :     const tnsr::aa<DataType, SpatialDim, Frame>& pi,
      51              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      52              : 
      53              : template <typename DataType, size_t SpatialDim, typename Frame>
      54            1 : tnsr::ii<DataType, SpatialDim, Frame> extrinsic_curvature(
      55              :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_normal_vector,
      56              :     const tnsr::aa<DataType, SpatialDim, Frame>& pi,
      57              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      58              : /// @}
      59              : 
      60              : namespace Tags {
      61              : /*!
      62              :  * \brief Compute item to get extrinsic curvature from generalized harmonic
      63              :  * variables and the spacetime normal vector.
      64              :  *
      65              :  * \details See `extrinsic_curvature()`. Can be retrieved using
      66              :  * `gr::Tags::ExtrinsicCurvature`.
      67              :  */
      68              : template <size_t SpatialDim, typename Frame>
      69            1 : struct ExtrinsicCurvatureCompute
      70              :     : gr::Tags::ExtrinsicCurvature<DataVector, SpatialDim, Frame>,
      71              :       db::ComputeTag {
      72            0 :   using argument_tags =
      73              :       tmpl::list<gr::Tags::SpacetimeNormalVector<DataVector, SpatialDim, Frame>,
      74              :                  Pi<DataVector, SpatialDim, Frame>,
      75              :                  Phi<DataVector, SpatialDim, Frame>>;
      76              : 
      77            0 :   using return_type = tnsr::ii<DataVector, SpatialDim, Frame>;
      78              : 
      79            0 :   static constexpr auto function = static_cast<void (*)(
      80              :       gsl::not_null<tnsr::ii<DataVector, SpatialDim, Frame>*>,
      81              :       const tnsr::A<DataVector, SpatialDim, Frame>&,
      82              :       const tnsr::aa<DataVector, SpatialDim, Frame>&,
      83              :       const tnsr::iaa<DataVector, SpatialDim, Frame>&)>(
      84              :       &extrinsic_curvature<DataVector, SpatialDim, Frame>);
      85              : 
      86            0 :   using base = gr::Tags::ExtrinsicCurvature<DataVector, SpatialDim, Frame>;
      87              : };
      88              : 
      89              : /*!
      90              :  * \brief Compute item to get the trace of extrinsic curvature from generalized
      91              :  * harmonic variables and the spacetime normal vector.
      92              :  *
      93              :  * \details See `extrinsic_curvature()` for how the extrinsic curvature
      94              :  * \f$ K_{ij}\f$ is computed. Its trace is taken as
      95              :  * \f{align}
      96              :  *     tr(K) &= g^{ij} K_{ij}.
      97              :  * \f}
      98              :  *
      99              :  * Can be retrieved using `gr::Tags::TraceExtrinsicCurvature`.
     100              :  */
     101              : template <size_t SpatialDim, typename Frame>
     102            1 : struct TraceExtrinsicCurvatureCompute
     103              :     : gr::Tags::TraceExtrinsicCurvature<DataVector>,
     104              :       db::ComputeTag {
     105            0 :   using argument_tags =
     106              :       tmpl::list<gr::Tags::ExtrinsicCurvature<DataVector, SpatialDim, Frame>,
     107              :                  gr::Tags::InverseSpatialMetric<DataVector, SpatialDim, Frame>>;
     108              : 
     109            0 :   using return_type = Scalar<DataVector>;
     110              : 
     111            0 :   static constexpr auto function =
     112              :       static_cast<void (*)(gsl::not_null<Scalar<DataVector>*>,
     113              :                            const tnsr::ii<DataVector, SpatialDim, Frame>&,
     114              :                            const tnsr::II<DataVector, SpatialDim, Frame>&)>(
     115              :           &trace);
     116              : 
     117            0 :   using base = gr::Tags::TraceExtrinsicCurvature<DataVector>;
     118              : };
     119              : }  // namespace Tags
     120              : }  // namespace gh
        

Generated by: LCOV version 2.0-1