SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - Pi.hpp Hit Total Coverage
Commit: a6a8ee404306bec9d92da8ab89f636b037aefc25 Lines: 3 8 37.5 %
Date: 2024-07-26 22:35:59
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 "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      14             : #include "Utilities/ContainerHelpers.hpp"
      15             : #include "Utilities/Gsl.hpp"
      16             : #include "Utilities/TMPL.hpp"
      17             : 
      18             : /// \cond
      19             : namespace domain {
      20             : namespace Tags {
      21             : template <size_t Dim, typename Frame>
      22             : struct Coordinates;
      23             : }  // namespace Tags
      24             : }  // namespace domain
      25             : class DataVector;
      26             : template <typename X, typename Symm, typename IndexList>
      27             : class Tensor;
      28             : /// \endcond
      29             : 
      30             : namespace gh {
      31             : /// @{
      32             : /*!
      33             :  * \ingroup GeneralRelativityGroup
      34             :  * \brief Computes the conjugate momentum \f$\Pi_{ab}\f$ of the spacetime metric
      35             :  * \f$ g_{ab} \f$.
      36             :  *
      37             :  * \details If \f$ \alpha, \beta^i\f$ are the lapse and shift respectively, and
      38             :  * \f$ \Phi_{iab} = \partial_i g_{ab} \f$ then
      39             :  * \f$\Pi_{\mu\nu} = -\frac{1}{\alpha} ( \partial_t g_{\mu\nu}  -
      40             :  *      \beta^m \Phi_{m\mu\nu}) \f$ where \f$ \partial_t g_{ab} \f$ is computed
      41             :  * as
      42             :  *
      43             :  * \f{align}
      44             :  *     \partial_t g_{tt} &= - 2 \alpha \partial_t \alpha
      45             :  *                 + 2 \gamma_{mn} \beta^m \partial_t \beta^n
      46             :  *                 + \beta^m \beta^n \partial_t \gamma_{mn} \\
      47             :  *     \partial_t g_{ti} &= \gamma_{mi} \partial_t \beta^m
      48             :  *                 + \beta^m \partial_t \gamma_{mi} \\
      49             :  *     \partial_t g_{ij} &= \partial_t \gamma_{ij}
      50             :  * \f}
      51             :  */
      52             : template <typename DataType, size_t SpatialDim, typename Frame>
      53           1 : void pi(gsl::not_null<tnsr::aa<DataType, SpatialDim, Frame>*> pi,
      54             :         const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse,
      55             :         const tnsr::I<DataType, SpatialDim, Frame>& shift,
      56             :         const tnsr::I<DataType, SpatialDim, Frame>& dt_shift,
      57             :         const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      58             :         const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
      59             :         const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      60             : 
      61             : template <typename DataType, size_t SpatialDim, typename Frame>
      62           1 : tnsr::aa<DataType, SpatialDim, Frame> pi(
      63             :     const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse,
      64             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      65             :     const tnsr::I<DataType, SpatialDim, Frame>& dt_shift,
      66             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      67             :     const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
      68             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      69             : /// @}
      70             : 
      71             : namespace Tags {
      72             : /*!
      73             :  * \brief Compute item the conjugate momentum \f$\Pi_{ab}\f$ of the spacetime
      74             :  * metric \f$ g_{ab} \f$.
      75             :  *
      76             :  * \details See `pi()`. Can be retrieved using `gh::Tags::Pi`.
      77             :  */
      78             : template <size_t SpatialDim, typename Frame>
      79           1 : struct PiCompute : Pi<DataVector, SpatialDim, Frame>, db::ComputeTag {
      80           0 :   using argument_tags = tmpl::list<
      81             :       gr::Tags::Lapse<DataVector>, ::Tags::dt<gr::Tags::Lapse<DataVector>>,
      82             :       gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      83             :       ::Tags::dt<gr::Tags::Shift<DataVector, SpatialDim, Frame>>,
      84             :       gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>,
      85             :       ::Tags::dt<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>>,
      86             :       Phi<DataVector, SpatialDim, Frame>>;
      87             : 
      88           0 :   using return_type = tnsr::aa<DataVector, SpatialDim, Frame>;
      89             : 
      90           0 :   static constexpr auto function = static_cast<void (*)(
      91             :       gsl::not_null<tnsr::aa<DataVector, SpatialDim, Frame>*>,
      92             :       const Scalar<DataVector>&, const Scalar<DataVector>&,
      93             :       const tnsr::I<DataVector, SpatialDim, Frame>&,
      94             :       const tnsr::I<DataVector, SpatialDim, Frame>&,
      95             :       const tnsr::ii<DataVector, SpatialDim, Frame>&,
      96             :       const tnsr::ii<DataVector, SpatialDim, Frame>&,
      97             :       const tnsr::iaa<DataVector, SpatialDim, Frame>&)>(
      98             :       &pi<DataVector, SpatialDim, Frame>);
      99             : 
     100           0 :   using base = Pi<DataVector, SpatialDim, Frame>;
     101             : };
     102             : }  // namespace Tags
     103             : }  // namespace gh

Generated by: LCOV version 1.14