SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity - Tags.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 30.6 % 85 26
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 <string>
       7              : 
       8              : #include "DataStructures/DataBox/Prefixes.hpp"
       9              : #include "DataStructures/DataBox/Tag.hpp"
      10              : #include "DataStructures/Tensor/TypeAliases.hpp"
      11              : #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
      12              : 
      13              : namespace gr {
      14              : namespace Tags {
      15              : template <typename DataType, size_t Dim, typename Frame>
      16            0 : struct SpacetimeMetric : db::SimpleTag {
      17            0 :   using type = tnsr::aa<DataType, Dim, Frame>;
      18              : };
      19              : template <typename DataType, size_t Dim, typename Frame>
      20            0 : struct InverseSpacetimeMetric : db::SimpleTag {
      21            0 :   using type = tnsr::AA<DataType, Dim, Frame>;
      22              : };
      23              : 
      24              : template <typename DataType, size_t Dim, typename Frame>
      25            0 : struct SpatialMetric : db::SimpleTag {
      26            0 :   using type = tnsr::ii<DataType, Dim, Frame>;
      27              : };
      28              : /*!
      29              :  * \brief Inverse of the spatial metric.
      30              :  */
      31              : template <typename DataType, size_t Dim, typename Frame>
      32            1 : struct InverseSpatialMetric : db::SimpleTag {
      33            0 :   using type = tnsr::II<DataType, Dim, Frame>;
      34              : };
      35              : /*!
      36              :  * \brief Determinant of the spatial metric.
      37              :  */
      38              : template <typename DataType>
      39            1 : struct DetSpatialMetric : db::SimpleTag {
      40            0 :   using type = Scalar<DataType>;
      41              : };
      42              : template <typename DataType>
      43            0 : struct SqrtDetSpatialMetric : db::SimpleTag {
      44            0 :   using type = Scalar<DataType>;
      45              : };
      46              : /*!
      47              :  * \brief Derivative of the determinant of the spatial metric.
      48              :  */
      49              : template <typename DataType, size_t Dim, typename Frame>
      50            1 : struct DerivDetSpatialMetric : db::SimpleTag {
      51            0 :   using type = tnsr::i<DataType, Dim, Frame>;
      52              : };
      53              : /*!
      54              :  * \brief Spatial derivative of the inverse of the spatial metric.
      55              :  */
      56              : template <typename DataType, size_t Dim, typename Frame>
      57            1 : struct DerivInverseSpatialMetric : db::SimpleTag {
      58            0 :   using type = tnsr::iJJ<DataType, Dim, Frame>;
      59              : };
      60              : template <typename DataType, size_t Dim, typename Frame>
      61            0 : struct Shift : db::SimpleTag {
      62            0 :   using type = tnsr::I<DataType, Dim, Frame>;
      63              : };
      64              : template <typename DataType>
      65            0 : struct Lapse : db::SimpleTag {
      66            0 :   using type = Scalar<DataType>;
      67              : };
      68              : /*!
      69              :  * \brief Spacetime derivatives of the spacetime metric
      70              :  *
      71              :  * \details Spacetime derivatives of the spacetime metric
      72              :  * \f$\partial_a g_{bc}\f$ assembled from the spatial and temporal
      73              :  * derivatives of evolved 3+1 variables.
      74              :  */
      75              : template <typename DataType, size_t Dim, typename Frame>
      76            1 : struct DerivativesOfSpacetimeMetric : db::SimpleTag {
      77            0 :   using type = tnsr::abb<DataType, Dim, Frame>;
      78              : };
      79              : template <typename DataType, size_t Dim, typename Frame>
      80            0 : struct SpacetimeChristoffelFirstKind : db::SimpleTag {
      81            0 :   using type = tnsr::abb<DataType, Dim, Frame>;
      82              : };
      83              : template <typename DataType, size_t Dim, typename Frame>
      84            0 : struct SpacetimeChristoffelSecondKind : db::SimpleTag {
      85            0 :   using type = tnsr::Abb<DataType, Dim, Frame>;
      86              : };
      87              : template <typename DataType, size_t Dim, typename Frame>
      88            0 : struct SpatialChristoffelFirstKind : db::SimpleTag {
      89            0 :   using type = tnsr::ijj<DataType, Dim, Frame>;
      90              : };
      91              : template <typename DataType, size_t Dim, typename Frame>
      92            0 : struct SpatialChristoffelSecondKind : db::SimpleTag {
      93            0 :   using type = tnsr::Ijj<DataType, Dim, Frame>;
      94              : };
      95              : template <typename DataType, size_t Dim, typename Frame>
      96            0 : struct SpacetimeNormalOneForm : db::SimpleTag {
      97            0 :   using type = tnsr::a<DataType, Dim, Frame>;
      98              : };
      99              : template <typename DataType, size_t Dim, typename Frame>
     100            0 : struct SpacetimeNormalVector : db::SimpleTag {
     101            0 :   using type = tnsr::A<DataType, Dim, Frame>;
     102              : };
     103              : template <typename DataType, size_t Dim, typename Frame>
     104            0 : struct TraceSpacetimeChristoffelFirstKind : db::SimpleTag {
     105            0 :   using type = tnsr::a<DataType, Dim, Frame>;
     106              : };
     107              : /*!
     108              :  * \brief Trace of the spacetime Christoffel symbols of the second kind
     109              :  * \f$\Gamma^{i} = \Gamma^i_{jk}g^{jk}\f$, where \f$\Gamma^i_{jk}\f$ are
     110              :  * Christoffel symbols of the second kind and \f$g^{jk}\f$ is the
     111              :  * inverse spacetime metric.
     112              :  */
     113              : template <typename DataType, size_t Dim, typename Frame>
     114            1 : struct TraceSpacetimeChristoffelSecondKind : db::SimpleTag {
     115            0 :   using type = tnsr::A<DataType, Dim, Frame>;
     116              : };
     117              : /*!
     118              :  * \brief Trace of the spatial Christoffel symbols of the first kind
     119              :  * \f$\Gamma_{i} = \Gamma_{ijk}\gamma^{jk}\f$, where \f$\Gamma_{ijk}\f$ are
     120              :  * Christoffel symbols of the first kind and \f$\gamma^{jk}\f$ is the
     121              :  * inverse spatial metric.
     122              :  */
     123              : template <typename DataType, size_t Dim, typename Frame>
     124            1 : struct TraceSpatialChristoffelFirstKind : db::SimpleTag {
     125            0 :   using type = tnsr::i<DataType, Dim, Frame>;
     126              : };
     127              : template <typename DataType, size_t Dim, typename Frame>
     128            0 : struct TraceSpatialChristoffelSecondKind : db::SimpleTag {
     129            0 :   using type = tnsr::I<DataType, Dim, Frame>;
     130              : };
     131              : /// Contraction of the first two indices of the spatial Christoffel symbols:
     132              : /// \f$\Gamma^i_{ij}\f$. Useful for covariant divergences.
     133              : template <typename DataType, size_t Dim, typename Frame>
     134            1 : struct SpatialChristoffelSecondKindContracted : db::SimpleTag {
     135            0 :   using type = tnsr::i<DataType, Dim, Frame>;
     136              : };
     137              : 
     138              : template <typename DataType, size_t Dim, typename Frame>
     139            0 : struct ExtrinsicCurvature : db::SimpleTag {
     140            0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     141              : };
     142              : template <typename DataType>
     143            0 : struct TraceExtrinsicCurvature : db::SimpleTag {
     144            0 :   using type = Scalar<DataType>;
     145              : };
     146              : template <typename DataType, size_t Dim, typename Frame>
     147            0 : struct CovariantDerivativeOfExtrinsicCurvature : db::SimpleTag {
     148            0 :   using type = tnsr::ijj<DataType, Dim, Frame>;
     149              : };
     150              : 
     151              : /*!
     152              :  * \brief Holds a quantity that's similar to the shift, but isn't the shift.
     153              :  *
     154              :  * \details This holds
     155              :  *
     156              :  * \f{equation}{
     157              :  * \beta^i \frac{\partial x^\hat{i}}{\partial x^i} =
     158              :  * \hat{beta}^\hat{i} + \frac{\partial x^\hat{i}}{\partial t}
     159              :  * \f}
     160              :  *
     161              :  * where hatted quantities are in the distorted frame and non-hatted quantities
     162              :  * are in the grid frame.
     163              :  */
     164              : template <typename DataType, size_t Dim, typename Frame>
     165            1 : struct ShiftyQuantity : db::SimpleTag {
     166            0 :   using type = tnsr::I<DataType, Dim, Frame>;
     167              : };
     168              : 
     169              : /*!
     170              :  * \brief Computes the spatial Ricci tensor from the spatial
     171              :  * Christoffel symbol of the second kind and its derivative.
     172              :  */
     173              : template <typename DataType, size_t Dim, typename Frame>
     174            1 : struct SpatialRicci : db::SimpleTag {
     175            0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     176              : };
     177              : 
     178              : /*!
     179              :  * \brief Simple tag for the spatial Ricci scalar
     180              :  */
     181              : template <typename DataType>
     182            1 : struct SpatialRicciScalar : db::SimpleTag {
     183            0 :   using type = Scalar<DataType>;
     184              : };
     185              : 
     186              : /*!
     187              :  * \brief Computes the real part of \f$\Psi_4\f$
     188              :  */
     189              : template <typename DataType>
     190            1 : struct Psi4Real : db::SimpleTag {
     191            0 :   using type = Scalar<DataType>;
     192              : };
     193              : 
     194              : /*!
     195              :  * \brief Computes the imaginary part of \f$\Psi_4\f$
     196              :  */
     197              : template <typename DataType>
     198            1 : struct Psi4Imag : db::SimpleTag {
     199            0 :   using type = Scalar<DataType>;
     200              : };
     201              : 
     202              : /*!
     203              :  * \brief The energy density \f$E=n_a n_b T^{ab}\f$, where \f$n_a\f$ denotes the
     204              :  * normal to the spatial hypersurface
     205              :  */
     206              : template <typename DataType>
     207            1 : struct EnergyDensity : db::SimpleTag {
     208            0 :   using type = Scalar<DataType>;
     209              : };
     210              : 
     211              : /*!
     212              :  * \brief The trace of the spatial stress-energy tensor
     213              :  * \f$S=\gamma^{ij}\gamma_{ia}\gamma_{jb}T^{ab}\f$
     214              :  */
     215              : template <typename DataType>
     216            1 : struct StressTrace : db::SimpleTag {
     217            0 :   using type = Scalar<DataType>;
     218              : };
     219              : 
     220              : /*!
     221              :  * \brief The spatial momentum density \f$S^i=-\gamma^{ij}n^aT_{aj}\f$, where
     222              :  * \f$n_a\f$ denotes the normal to the spatial hypersurface
     223              :  */
     224              : template <typename DataType, size_t Dim, typename Frame>
     225            1 : struct MomentumDensity : db::SimpleTag {
     226            0 :   using type = tnsr::I<DataType, Dim, Frame>;
     227              : };
     228              : 
     229              : /// The ADM Hamiltonian constraint
     230              : /// \f$\frac{1}{2} \left(R + K^2 - K_{ij} K^{ij}\right) - 8 \pi \rho\f$
     231              : /// (see e.g. Eq. (2.132) in \cite BaumgarteShapiro).
     232              : ///
     233              : /// \note We include a factor of \f$1/2\f$ in the Hamiltonian constraint for
     234              : /// consistency with SpEC, and so the matter terms in the Hamiltonian and
     235              : /// momentum constraints are both scaled by $8\pi$.
     236              : template <typename DataType>
     237            1 : struct HamiltonianConstraint : db::SimpleTag {
     238            0 :   using type = Scalar<DataType>;
     239              : };
     240              : 
     241              : /// The ADM momentum constraint
     242              : /// \f$\nabla_j (K^{ij} - \gamma^{ij} K) - 8 \pi S^i\f$, where
     243              : /// \f$\nabla\f$ denotes the covariant derivative associated with the spatial
     244              : /// metric \f$\gamma_{ij}\f$ (see e.g. Eq. (2.133) in \cite BaumgarteShapiro).
     245              : template <typename DataType, size_t Dim, typename Frame>
     246            1 : struct MomentumConstraint : db::SimpleTag {
     247            0 :   using type = tnsr::I<DataType, Dim, Frame>;
     248              : };
     249              : 
     250              : /*!
     251              :  * \brief Computes the electric part of the Weyl tensor in vacuum
     252              :  * as: \f$ E_{ij} = R_{ij} + KK_{ij} - K^m_{i}K_{mj}\f$ where \f$R_{ij}\f$ is
     253              :  * the spatial Ricci tensor, \f$K_{ij}\f$ is the extrinsic curvature, and
     254              :  * \f$K\f$ is the trace of \f$K_{ij}\f$.
     255              :  */
     256              : template <typename DataType, size_t Dim, typename Frame>
     257            1 : struct WeylElectric : db::SimpleTag {
     258            0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     259              : };
     260              : 
     261              : /*!
     262              :  * \brief The magnetic part of the Weyl tensor in vacuum \f$B_{ij}\f$.
     263              :  */
     264              : template <typename DataType, size_t Dim, typename Frame>
     265            1 : struct WeylMagnetic : db::SimpleTag {
     266            0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     267              : };
     268              : 
     269              : /*!
     270              :  * \brief Computes a quantity measuring how far from type D spacetime is,
     271              :  * using measure D1 [Eq. (8)] of \cite Bhagwat2017tkm.
     272              :  */
     273              : template <typename DataType, size_t Dim, typename Frame>
     274            1 : struct WeylTypeD1 : db::SimpleTag {
     275            0 :   using type = tnsr::ii<DataType, 3, Frame>;
     276              : };
     277              : 
     278              : /*!
     279              :  * \brief Computes the scalar \f$E_{ij} E^{ij}\f$ from the electric part of the
     280              :  * Weyl tensor \f$E_{ij}\f$ and the inverse spatial metric \f$\gamma^{ij}\f$,
     281              :  * i.e. \f$E_{ij} E^{ij} = \gamma^{ik}\gamma^{jl}E_{ij}E_{kl}\f$.
     282              :  */
     283              : template <typename DataType>
     284            1 : struct WeylElectricScalar : db::SimpleTag {
     285            0 :   using type = Scalar<DataType>;
     286              : };
     287              : 
     288              : /*!
     289              :  * \brief The square \f$B_{ij} B^{ij}\f$ of the magnetic part of the Weyl tensor
     290              :  * \f$B_{ij}\f$.
     291              :  */
     292              : template <typename DataType>
     293            1 : struct WeylMagneticScalar : db::SimpleTag {
     294            0 :   using type = Scalar<DataType>;
     295              : };
     296              : 
     297              : /*!
     298              :  * \brief Computes the scalar \f$D_{ij} D^{ij}\f$ (Eq. (8) of
     299              :  * \cite Bhagwat2017tkm) from \f$D_{ij}\f$ and the inverse spatial metric
     300              :  * \f$\gamma^{ij}\f$, i.e. \f$D = \gamma^{ik}\gamma^{jl}D_{ij}D_{kl}\f$.
     301              :  */
     302              : template <typename DataType>
     303            1 : struct WeylTypeD1Scalar : db::SimpleTag {
     304            0 :   using type = Scalar<DataType>;
     305              : };
     306              : 
     307              : }  // namespace Tags
     308              : 
     309              : /// GR Tags commonly needed for the evolution of hydro systems
     310              : template <size_t Dim, typename DataType>
     311            1 : using tags_for_hydro =
     312              :     tmpl::list<gr::Tags::Lapse<DataType>, gr::Tags::Shift<DataType, Dim>,
     313              :                gr::Tags::SpatialMetric<DataType, Dim>,
     314              :                gr::Tags::InverseSpatialMetric<DataType, Dim>,
     315              :                gr::Tags::SqrtDetSpatialMetric<DataType>,
     316              :                ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
     317              :                              Frame::Inertial>,
     318              :                ::Tags::deriv<gr::Tags::Shift<DataType, Dim>, tmpl::size_t<Dim>,
     319              :                              Frame::Inertial>,
     320              :                ::Tags::deriv<gr::Tags::SpatialMetric<DataType, Dim>,
     321              :                              tmpl::size_t<Dim>, Frame::Inertial>,
     322              :                gr::Tags::ExtrinsicCurvature<DataType, Dim>>;
     323              : 
     324              : /// The tags for the variables returned by GR analytic solutions.
     325              : template <size_t Dim, typename DataType>
     326            1 : using analytic_solution_tags =
     327              :     tmpl::list<gr::Tags::Lapse<DataType>, ::Tags::dt<gr::Tags::Lapse<DataType>>,
     328              :                ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
     329              :                              Frame::Inertial>,
     330              :                gr::Tags::Shift<DataType, Dim>,
     331              :                ::Tags::dt<gr::Tags::Shift<DataType, Dim>>,
     332              :                ::Tags::deriv<gr::Tags::Shift<DataType, Dim>, tmpl::size_t<Dim>,
     333              :                              Frame::Inertial>,
     334              :                gr::Tags::SpatialMetric<DataType, Dim>,
     335              :                ::Tags::dt<gr::Tags::SpatialMetric<DataType, Dim>>,
     336              :                ::Tags::deriv<gr::Tags::SpatialMetric<DataType, Dim>,
     337              :                              tmpl::size_t<Dim>, Frame::Inertial>,
     338              :                gr::Tags::SqrtDetSpatialMetric<DataType>,
     339              :                gr::Tags::ExtrinsicCurvature<DataType, Dim>,
     340              :                gr::Tags::InverseSpatialMetric<DataType, Dim>>;
     341              : }  // namespace gr
        

Generated by: LCOV version 2.0-1