SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - TimeDerivOfShift.hpp Hit Total Coverage
Commit: 47056168667e3fcaf5c2563461756c37676bb94c Lines: 3 8 37.5 %
Date: 2024-04-19 14:00:09
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/Tensor.hpp"
      12             : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      13             : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
      14             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      15             : #include "Utilities/ContainerHelpers.hpp"
      16             : #include "Utilities/Gsl.hpp"
      17             : #include "Utilities/TMPL.hpp"
      18             : 
      19             : // IWYU pragma: no_forward_declare Tags::deriv
      20             : 
      21             : /// \cond
      22             : namespace domain {
      23             : namespace Tags {
      24             : template <size_t Dim, typename Frame>
      25             : struct Coordinates;
      26             : }  // namespace Tags
      27             : }  // namespace domain
      28             : class DataVector;
      29             : template <typename X, typename Symm, typename IndexList>
      30             : class Tensor;
      31             : /// \endcond
      32             : 
      33             : namespace gh {
      34             : /// @{
      35             : /*!
      36             :  * \ingroup GeneralRelativityGroup
      37             :  * \brief Computes time derivative of the shift vector from
      38             :  *        the generalized harmonic and geometric variables
      39             :  *
      40             :  * \details The time derivative of \f$ \beta^i \f$ can be derived from the
      41             :  * following steps:
      42             :  * \f{align*}
      43             :  * \partial_0 \beta^i
      44             :  *  =& \gamma^{ik} \partial_0 (\gamma_{kj} \beta^j)
      45             :  *         - \beta^j \gamma^{ik} \partial_0 \gamma_{kj} \\
      46             :  *  =& \alpha \gamma^{ik} n^b \partial_0 g_{kb} \\
      47             :  *  =& \alpha \gamma^{ik} n^b (\partial_0 - \beta^j\partial_j) g_{kb}
      48             :  *                  + \alpha \gamma^{ik} n^b \beta^j\partial_j g_{kb} \\
      49             :  *  =& -\alpha^2 n^b\Pi_{kb} \gamma^{ik}
      50             :  *         + \alpha \beta^j n^b\Phi_{jkb} \gamma^{ik} \\
      51             :  *  =& -\alpha \gamma^{ik} n^b (\alpha \Pi_{kb} - \beta^j \Phi_{jkb}) \\
      52             :  * \f}
      53             :  */
      54             : template <typename DataType, size_t SpatialDim, typename Frame>
      55           1 : void time_deriv_of_shift(
      56             :     gsl::not_null<tnsr::I<DataType, SpatialDim, Frame>*> dt_shift,
      57             :     const Scalar<DataType>& lapse,
      58             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      59             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
      60             :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
      61             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      62             :     const tnsr::aa<DataType, SpatialDim, Frame>& pi);
      63             : 
      64             : template <typename DataType, size_t SpatialDim, typename Frame>
      65           1 : tnsr::I<DataType, SpatialDim, Frame> time_deriv_of_shift(
      66             :     const Scalar<DataType>& lapse,
      67             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      68             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
      69             :     const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
      70             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      71             :     const tnsr::aa<DataType, SpatialDim, Frame>& pi);
      72             : /// @}
      73             : 
      74             : namespace Tags {
      75             : /*!
      76             :  * \brief Compute item to get time derivative of the shift vector from
      77             :  *        the generalized harmonic and geometric variables
      78             :  *
      79             :  * \details See `time_deriv_of_shift()`. Can be retrieved using
      80             :  * `gr::Tags::Shift` wrapped in `Tags::dt`.
      81             :  */
      82             : template <size_t SpatialDim, typename Frame>
      83           1 : struct TimeDerivShiftCompute
      84             :     : ::Tags::dt<gr::Tags::Shift<DataVector, SpatialDim, Frame>>,
      85             :       db::ComputeTag {
      86           0 :   using argument_tags =
      87             :       tmpl::list<gr::Tags::Lapse<DataVector>,
      88             :                  gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      89             :                  gr::Tags::InverseSpatialMetric<DataVector, SpatialDim, Frame>,
      90             :                  gr::Tags::SpacetimeNormalVector<DataVector, SpatialDim, Frame>,
      91             :                  Phi<DataVector, SpatialDim, Frame>,
      92             :                  Pi<DataVector, SpatialDim, Frame>>;
      93             : 
      94           0 :   using return_type = tnsr::I<DataVector, SpatialDim, Frame>;
      95             : 
      96           0 :   static constexpr auto function = static_cast<void (*)(
      97             :       gsl::not_null<tnsr::I<DataVector, SpatialDim, Frame>*>,
      98             :       const Scalar<DataVector>&, const tnsr::I<DataVector, SpatialDim, Frame>&,
      99             :       const tnsr::II<DataVector, SpatialDim, Frame>&,
     100             :       const tnsr::A<DataVector, SpatialDim, Frame>&,
     101             :       const tnsr::iaa<DataVector, SpatialDim, Frame>&,
     102             :       const tnsr::aa<DataVector, SpatialDim, Frame>&)>(
     103             :       &time_deriv_of_shift<DataVector, SpatialDim, Frame>);
     104             : 
     105           0 :   using base = ::Tags::dt<gr::Tags::Shift<DataVector, SpatialDim, Frame>>;
     106             : };
     107             : }  // namespace Tags
     108             : }  // namespace gh

Generated by: LCOV version 1.14