SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - TimeDerivOfShift.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 time derivative of the shift vector from
      26              :  *        the generalized harmonic and geometric variables
      27              :  *
      28              :  * \details The time derivative of \f$ \beta^i \f$ can be derived from the
      29              :  * following steps:
      30              :  * \f{align*}
      31              :  * \partial_0 \beta^i
      32              :  *  =& \gamma^{ik} \partial_0 (\gamma_{kj} \beta^j)
      33              :  *         - \beta^j \gamma^{ik} \partial_0 \gamma_{kj} \\
      34              :  *  =& \alpha \gamma^{ik} n^b \partial_0 g_{kb} \\
      35              :  *  =& \alpha \gamma^{ik} n^b (\partial_0 - \beta^j\partial_j) g_{kb}
      36              :  *                  + \alpha \gamma^{ik} n^b \beta^j\partial_j g_{kb} \\
      37              :  *  =& -\alpha^2 n^b\Pi_{kb} \gamma^{ik}
      38              :  *         + \alpha \beta^j n^b\Phi_{jkb} \gamma^{ik} \\
      39              :  *  =& -\alpha \gamma^{ik} n^b (\alpha \Pi_{kb} - \beta^j \Phi_{jkb}) \\
      40              :  * \f}
      41              :  */
      42              : template <typename DataType, size_t SpatialDim, typename Frame>
      43            1 : void time_deriv_of_shift(
      44              :     gsl::not_null<tnsr::I<DataType, SpatialDim, Frame>*> dt_shift,
      45              :     const Scalar<DataType>& lapse,
      46              :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      47              :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
      48              :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
      49              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      50              :     const tnsr::aa<DataType, SpatialDim, Frame>& pi);
      51              : 
      52              : template <typename DataType, size_t SpatialDim, typename Frame>
      53            1 : tnsr::I<DataType, SpatialDim, Frame> time_deriv_of_shift(
      54              :     const Scalar<DataType>& lapse,
      55              :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      56              :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
      57              :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
      58              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      59              :     const tnsr::aa<DataType, SpatialDim, Frame>& pi);
      60              : /// @}
      61              : 
      62              : namespace Tags {
      63              : /*!
      64              :  * \brief Compute item to get time derivative of the shift vector from
      65              :  *        the generalized harmonic and geometric variables
      66              :  *
      67              :  * \details See `time_deriv_of_shift()`. Can be retrieved using
      68              :  * `gr::Tags::Shift` wrapped in `Tags::dt`.
      69              :  */
      70              : template <size_t SpatialDim, typename Frame>
      71            1 : struct TimeDerivShiftCompute
      72              :     : ::Tags::dt<gr::Tags::Shift<DataVector, SpatialDim, Frame>>,
      73              :       db::ComputeTag {
      74            0 :   using argument_tags =
      75              :       tmpl::list<gr::Tags::Lapse<DataVector>,
      76              :                  gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      77              :                  gr::Tags::InverseSpatialMetric<DataVector, SpatialDim, Frame>,
      78              :                  gr::Tags::SpacetimeNormalVector<DataVector, SpatialDim, Frame>,
      79              :                  Phi<DataVector, SpatialDim, Frame>,
      80              :                  Pi<DataVector, SpatialDim, Frame>>;
      81              : 
      82            0 :   using return_type = tnsr::I<DataVector, SpatialDim, Frame>;
      83              : 
      84            0 :   static constexpr auto function = static_cast<void (*)(
      85              :       gsl::not_null<tnsr::I<DataVector, SpatialDim, Frame>*>,
      86              :       const Scalar<DataVector>&, const tnsr::I<DataVector, SpatialDim, Frame>&,
      87              :       const tnsr::II<DataVector, SpatialDim, Frame>&,
      88              :       const tnsr::A<DataVector, SpatialDim, Frame>&,
      89              :       const tnsr::iaa<DataVector, SpatialDim, Frame>&,
      90              :       const tnsr::aa<DataVector, SpatialDim, Frame>&)>(
      91              :       &time_deriv_of_shift<DataVector, SpatialDim, Frame>);
      92              : 
      93            0 :   using base = ::Tags::dt<gr::Tags::Shift<DataVector, SpatialDim, Frame>>;
      94              : };
      95              : }  // namespace Tags
      96              : }  // namespace gh
        

Generated by: LCOV version 2.0-1