SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - SpatialDerivOfLapse.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 37.5 % 8 3
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/TypeAliases.hpp"
      12              : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      13              : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      14              : #include "Utilities/Gsl.hpp"
      15              : #include "Utilities/TMPL.hpp"
      16              : 
      17              : /// \cond
      18              : class DataVector;
      19              : /// \endcond
      20              : 
      21              : namespace gh {
      22              : /// @{
      23              : /*!
      24              :  * \ingroup GeneralRelativityGroup
      25              :  * \brief Computes spatial derivatives of lapse (\f$\alpha\f$) from the
      26              :  *        generalized harmonic variables and spacetime unit normal 1-form.
      27              :  *
      28              :  * \details If the generalized harmonic conjugate momentum and spatial
      29              :  * derivative variables are \f$\Pi_{ab} = -n^c \partial_c g_{ab} \f$ and
      30              :  * \f$\Phi_{iab} = \partial_i g_{ab} \f$, the spatial derivatives of
      31              :  * \f$\alpha\f$ can be obtained from:
      32              :  *
      33              :  * \f{align*}
      34              :  *      n^a n^b \Phi_{iab} =
      35              :  *          -\frac{1}{2\alpha} [\partial_i (-\alpha^2 + \beta_j\beta^j)-
      36              :  *                              2 \beta^j \partial_i \beta_j
      37              :  *                              + \beta^j \beta^k \partial_i \gamma_{jk}]
      38              :  *                         = -\frac{2}{\alpha} \partial_i \alpha,
      39              :  * \f}
      40              :  *
      41              :  * since
      42              :  *
      43              :  * \f[
      44              :  * \partial_i (\beta_j\beta^j) =
      45              :  *     2\beta^j \partial_i \beta_j - \beta^j \beta^k \partial_i \gamma_{jk}.
      46              :  * \f]
      47              :  *
      48              :  * \f[
      49              :  *     \Longrightarrow \partial_i \alpha = -(\alpha/2) n^a \Phi_{iab} n^b
      50              :  * \f]
      51              :  */
      52              : template <typename DataType, size_t SpatialDim, typename Frame>
      53            1 : void spatial_deriv_of_lapse(
      54              :     gsl::not_null<tnsr::i<DataType, SpatialDim, Frame>*> deriv_lapse,
      55              :     const Scalar<DataType>& lapse,
      56              :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
      57              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      58              : 
      59              : template <typename DataType, size_t SpatialDim, typename Frame>
      60            1 : tnsr::i<DataType, SpatialDim, Frame> spatial_deriv_of_lapse(
      61              :     const Scalar<DataType>& lapse,
      62              :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
      63              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      64              : /// @}
      65              : 
      66              : namespace Tags {
      67              : /*!
      68              :  * \brief Compute item to get spatial derivatives of lapse from the
      69              :  * generalized harmonic variables and spacetime unit normal one-form.
      70              :  *
      71              :  * \details See `spatial_deriv_of_lapse()`. Can be retrieved using
      72              :  * `gr::Tags::Lapse` wrapped in `::Tags::deriv`.
      73              :  */
      74              : template <size_t SpatialDim, typename Frame>
      75            1 : struct DerivLapseCompute : ::Tags::deriv<gr::Tags::Lapse<DataVector>,
      76              :                                          tmpl::size_t<SpatialDim>, Frame>,
      77              :                            db::ComputeTag {
      78            0 :   using argument_tags =
      79              :       tmpl::list<gr::Tags::Lapse<DataVector>,
      80              :                  gr::Tags::SpacetimeNormalVector<DataVector, SpatialDim, Frame>,
      81              :                  Phi<DataVector, SpatialDim, Frame>>;
      82              : 
      83            0 :   using return_type = tnsr::i<DataVector, SpatialDim, Frame>;
      84              : 
      85            0 :   static constexpr auto function = static_cast<void (*)(
      86              :       gsl::not_null<tnsr::i<DataVector, SpatialDim, Frame>*>,
      87              :       const Scalar<DataVector>&, const tnsr::A<DataVector, SpatialDim, Frame>&,
      88              :       const tnsr::iaa<DataVector, SpatialDim, Frame>&)>(
      89              :       &spatial_deriv_of_lapse<DataVector, SpatialDim, Frame>);
      90              : 
      91            0 :   using base = ::Tags::deriv<gr::Tags::Lapse<DataVector>,
      92              :                              tmpl::size_t<SpatialDim>, Frame>;
      93              : };
      94              : }  // namespace Tags
      95              : }  // namespace gh
        

Generated by: LCOV version 2.0-1