SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity - Tags.hpp Hit Total Coverage
Commit: f23e75c235cae5144b8ac7ce01280be5b8cd2c8a Lines: 25 81 30.9 %
Date: 2024-09-07 06:21:00
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             : 
     147             : /*!
     148             :  * \brief Holds a quantity that's similar to the shift, but isn't the shift.
     149             :  *
     150             :  * \details This holds
     151             :  *
     152             :  * \f{equation}{
     153             :  * \beta^i \frac{\partial x^\hat{i}}{\partial x^i} =
     154             :  * \hat{beta}^\hat{i} + \frac{\partial x^\hat{i}}{\partial t}
     155             :  * \f}
     156             :  *
     157             :  * where hatted quantities are in the distorted frame and non-hatted quantities
     158             :  * are in the grid frame.
     159             :  */
     160             : template <typename DataType, size_t Dim, typename Frame>
     161           1 : struct ShiftyQuantity : db::SimpleTag {
     162           0 :   using type = tnsr::I<DataType, Dim, Frame>;
     163             : };
     164             : 
     165             : /*!
     166             :  * \brief Computes the spatial Ricci tensor from the spatial
     167             :  * Christoffel symbol of the second kind and its derivative.
     168             :  */
     169             : template <typename DataType, size_t Dim, typename Frame>
     170           1 : struct SpatialRicci : db::SimpleTag {
     171           0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     172             : };
     173             : 
     174             : /*!
     175             :  * \brief Simple tag for the spatial Ricci scalar
     176             :  */
     177             : template <typename DataType>
     178           1 : struct SpatialRicciScalar : db::SimpleTag {
     179           0 :   using type = Scalar<DataType>;
     180             : };
     181             : 
     182             : /*!
     183             :  * \brief Computes the real part of \f$\Psi_4\f$
     184             :  */
     185             : template <typename DataType>
     186           1 : struct Psi4Real : db::SimpleTag {
     187           0 :   using type = Scalar<DataType>;
     188             : };
     189             : 
     190             : /*!
     191             :  * \brief The energy density \f$E=n_a n_b T^{ab}\f$, where \f$n_a\f$ denotes the
     192             :  * normal to the spatial hypersurface
     193             :  */
     194             : template <typename DataType>
     195           1 : struct EnergyDensity : db::SimpleTag {
     196           0 :   using type = Scalar<DataType>;
     197             : };
     198             : 
     199             : /*!
     200             :  * \brief The trace of the spatial stress-energy tensor
     201             :  * \f$S=\gamma^{ij}\gamma_{ia}\gamma_{jb}T^{ab}\f$
     202             :  */
     203             : template <typename DataType>
     204           1 : struct StressTrace : db::SimpleTag {
     205           0 :   using type = Scalar<DataType>;
     206             : };
     207             : 
     208             : /*!
     209             :  * \brief The spatial momentum density \f$S^i=-\gamma^{ij}n^aT_{aj}\f$, where
     210             :  * \f$n_a\f$ denotes the normal to the spatial hypersurface
     211             :  */
     212             : template <typename DataType, size_t Dim, typename Frame>
     213           1 : struct MomentumDensity : db::SimpleTag {
     214           0 :   using type = tnsr::I<DataType, Dim, Frame>;
     215             : };
     216             : 
     217             : /// The ADM Hamiltonian constraint
     218             : /// \f$\frac{1}{2} \left(R + K^2 - K_{ij} K^{ij}\right) - 8 \pi \rho\f$
     219             : /// (see e.g. Eq. (2.132) in \cite BaumgarteShapiro).
     220             : ///
     221             : /// \note We include a factor of \f$1/2\f$ in the Hamiltonian constraint for
     222             : /// consistency with SpEC, and so the matter terms in the Hamiltonian and
     223             : /// momentum constraints are both scaled by $8\pi$.
     224             : template <typename DataType>
     225           1 : struct HamiltonianConstraint : db::SimpleTag {
     226           0 :   using type = Scalar<DataType>;
     227             : };
     228             : 
     229             : /// The ADM momentum constraint
     230             : /// \f$\nabla_j (K^{ij} - \gamma^{ij} K) - 8 \pi S^i\f$, where
     231             : /// \f$\nabla\f$ denotes the covariant derivative associated with the spatial
     232             : /// metric \f$\gamma_{ij}\f$ (see e.g. Eq. (2.133) in \cite BaumgarteShapiro).
     233             : template <typename DataType, size_t Dim, typename Frame>
     234           1 : struct MomentumConstraint : db::SimpleTag {
     235           0 :   using type = tnsr::I<DataType, Dim, Frame>;
     236             : };
     237             : 
     238             : /*!
     239             :  * \brief Computes the electric part of the Weyl tensor in vacuum
     240             :  * as: \f$ E_{ij} = R_{ij} + KK_{ij} - K^m_{i}K_{mj}\f$ where \f$R_{ij}\f$ is
     241             :  * the spatial Ricci tensor, \f$K_{ij}\f$ is the extrinsic curvature, and
     242             :  * \f$K\f$ is the trace of \f$K_{ij}\f$.
     243             :  */
     244             : template <typename DataType, size_t Dim, typename Frame>
     245           1 : struct WeylElectric : db::SimpleTag {
     246           0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     247             : };
     248             : 
     249             : /*!
     250             :  * \brief The magnetic part of the Weyl tensor in vacuum \f$B_{ij}\f$.
     251             :  */
     252             : template <typename DataType, size_t Dim, typename Frame>
     253           1 : struct WeylMagnetic : db::SimpleTag {
     254           0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     255             : };
     256             : 
     257             : /*!
     258             :  * \brief Computes a quantity measuring how far from type D spacetime is,
     259             :  * using measure D1 [Eq. (8)] of \cite Bhagwat2017tkm.
     260             :  */
     261             : template <typename DataType, size_t Dim, typename Frame>
     262           1 : struct WeylTypeD1 : db::SimpleTag {
     263           0 :   using type = tnsr::ii<DataType, 3, Frame>;
     264             : };
     265             : 
     266             : /*!
     267             :  * \brief Computes the scalar \f$E_{ij} E^{ij}\f$ from the electric part of the
     268             :  * Weyl tensor \f$E_{ij}\f$ and the inverse spatial metric \f$\gamma^{ij}\f$,
     269             :  * i.e. \f$E_{ij} E^{ij} = \gamma^{ik}\gamma^{jl}E_{ij}E_{kl}\f$.
     270             :  */
     271             : template <typename DataType>
     272           1 : struct WeylElectricScalar : db::SimpleTag {
     273           0 :   using type = Scalar<DataType>;
     274             : };
     275             : 
     276             : /*!
     277             :  * \brief The square \f$B_{ij} B^{ij}\f$ of the magnetic part of the Weyl tensor
     278             :  * \f$B_{ij}\f$.
     279             :  */
     280             : template <typename DataType>
     281           1 : struct WeylMagneticScalar : db::SimpleTag {
     282           0 :   using type = Scalar<DataType>;
     283             : };
     284             : 
     285             : /*!
     286             :  * \brief Computes the scalar \f$D_{ij} D^{ij}\f$ (Eq. (8) of
     287             :  * \cite Bhagwat2017tkm) from \f$D_{ij}\f$ and the inverse spatial metric
     288             :  * \f$\gamma^{ij}\f$, i.e. \f$D = \gamma^{ik}\gamma^{jl}D_{ij}D_{kl}\f$.
     289             :  */
     290             : template <typename DataType>
     291           1 : struct WeylTypeD1Scalar : db::SimpleTag {
     292           0 :   using type = Scalar<DataType>;
     293             : };
     294             : 
     295             : }  // namespace Tags
     296             : 
     297             : /// GR Tags commonly needed for the evolution of hydro systems
     298             : template <size_t Dim, typename DataType>
     299           1 : using tags_for_hydro =
     300             :     tmpl::list<gr::Tags::Lapse<DataType>, gr::Tags::Shift<DataType, Dim>,
     301             :                gr::Tags::SpatialMetric<DataType, Dim>,
     302             :                gr::Tags::InverseSpatialMetric<DataType, Dim>,
     303             :                gr::Tags::SqrtDetSpatialMetric<DataType>,
     304             :                ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
     305             :                              Frame::Inertial>,
     306             :                ::Tags::deriv<gr::Tags::Shift<DataType, Dim>, tmpl::size_t<Dim>,
     307             :                              Frame::Inertial>,
     308             :                ::Tags::deriv<gr::Tags::SpatialMetric<DataType, Dim>,
     309             :                              tmpl::size_t<Dim>, Frame::Inertial>,
     310             :                gr::Tags::ExtrinsicCurvature<DataType, Dim>>;
     311             : 
     312             : /// The tags for the variables returned by GR analytic solutions.
     313             : template <size_t Dim, typename DataType>
     314           1 : using analytic_solution_tags =
     315             :     tmpl::list<gr::Tags::Lapse<DataType>, ::Tags::dt<gr::Tags::Lapse<DataType>>,
     316             :                ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
     317             :                              Frame::Inertial>,
     318             :                gr::Tags::Shift<DataType, Dim>,
     319             :                ::Tags::dt<gr::Tags::Shift<DataType, Dim>>,
     320             :                ::Tags::deriv<gr::Tags::Shift<DataType, Dim>, tmpl::size_t<Dim>,
     321             :                              Frame::Inertial>,
     322             :                gr::Tags::SpatialMetric<DataType, Dim>,
     323             :                ::Tags::dt<gr::Tags::SpatialMetric<DataType, Dim>>,
     324             :                ::Tags::deriv<gr::Tags::SpatialMetric<DataType, Dim>,
     325             :                              tmpl::size_t<Dim>, Frame::Inertial>,
     326             :                gr::Tags::SqrtDetSpatialMetric<DataType>,
     327             :                gr::Tags::ExtrinsicCurvature<DataType, Dim>,
     328             :                gr::Tags::InverseSpatialMetric<DataType, Dim>>;
     329             : }  // namespace gr

Generated by: LCOV version 1.14