SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Ccz4 - Tags.hpp Hit Total Coverage
Commit: 1f2210958b4f38fdc0400907ee7c6d5af5111418 Lines: 40 94 42.6 %
Date: 2025-12-05 05:03:31
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             : #include <string>
       8             : 
       9             : #include "DataStructures/DataBox/Tag.hpp"
      10             : #include "DataStructures/Tensor/TypeAliases.hpp"
      11             : #include "Evolution/Systems/Ccz4/TagsDeclarations.hpp"
      12             : #include "Evolution/Tags.hpp"
      13             : #include "Options/String.hpp"
      14             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      15             : #include "PointwiseFunctions/GeneralRelativity/Tags/Conformal.hpp"
      16             : 
      17             : namespace Ccz4 {
      18           1 : namespace OptionTags {
      19             : /*!
      20             :  * \ingroup OptionGroupsGroup
      21             :  * Groups option tags related to the CCZ4 evolution system.
      22             :  */
      23           1 : struct Ccz4Group {
      24           0 :   static std::string name() { return "Ccz4"; }
      25           0 :   static constexpr Options::String help{
      26             :       "Options for the CCZ4 evolution system"};
      27           0 :   using group = evolution::OptionTags::SystemGroup;
      28             : };
      29             : 
      30             : /// \copydoc Tags::Kappa1
      31           1 : struct Kappa1 {
      32           0 :   using type = double;
      33             : 
      34           0 :   static constexpr Options::String help = {
      35             :       "The constraint damping parameter kappa_1."};
      36           0 :   using group = Ccz4Group;
      37             : };
      38             : 
      39             : /// \copydoc Tags::Kappa2
      40           1 : struct Kappa2 {
      41           0 :   using type = double;
      42             : 
      43           0 :   static constexpr Options::String help = {
      44             :       "The constraint damping parameter kappa_2."};
      45           0 :   using group = Ccz4Group;
      46             : };
      47             : 
      48             : /// \copydoc Tags::Kappa3
      49           1 : struct Kappa3 {
      50           0 :   using type = double;
      51             : 
      52           0 :   static constexpr Options::String help = {
      53             :       "The constraint damping parameter kappa_3."};
      54           0 :   using group = Ccz4Group;
      55             : };
      56             : }  // namespace OptionTags
      57             : 
      58             : /*!
      59             :  * \brief Tags for the CCZ4 formulation of Einstein equations.
      60             :  * \details The naming convention follows \cite Dumbser2017okk
      61             :  * eq. 12a-12m.
      62             :  */
      63           1 : namespace Tags {
      64             : /*!
      65             :  * \brief The conformal factor that rescales the spatial metric
      66             :  *
      67             :  * \details If \f$\gamma_{ij}\f$ is the spatial metric, then we define
      68             :  * \f$\phi = (det(\gamma_{ij}))^{-1/6}\f$.
      69             :  */
      70             : template <typename DataType>
      71           1 : struct ConformalFactor : db::SimpleTag {
      72           0 :   using type = Scalar<DataType>;
      73             : };
      74             : 
      75             : /*!
      76             :  * \brief The square of the conformal factor that rescales the spatial metric
      77             :  *
      78             :  * \details If \f$\gamma_{ij}\f$ is the spatial metric, then we define
      79             :  * \f$\phi^2 = (det(\gamma_{ij}))^{-1/3}\f$.
      80             :  */
      81             : template <typename DataType>
      82           1 : struct ConformalFactorSquared : db::SimpleTag {
      83           0 :   using type = Scalar<DataType>;
      84             : };
      85             : 
      86             : /*!
      87             :  * \brief The conformally scaled spatial metric
      88             :  *
      89             :  * \details If \f$\phi\f$ is the conformal factor and \f$\gamma_{ij}\f$ is the
      90             :  * spatial metric, then we define
      91             :  * \f$\bar{\gamma}_{ij} = \phi^2 \gamma_{ij}\f$.
      92             :  */
      93             : template <typename DataType, size_t Dim, typename Fr = Frame::Inertial>
      94           1 : using ConformalMetric =
      95             :     gr::Tags::Conformal<gr::Tags::SpatialMetric<DataType, Dim, Fr>, 2>;
      96             : 
      97             : /*!
      98             :  * \brief The conformally scaled inverse spatial metric
      99             :  *
     100             :  * \details If \f$\phi\f$ is the conformal factor and \f$\gamma^{ij}\f$ is the
     101             :  * inverse spatial metric, then we define
     102             :  * \f$\bar{\gamma}^{ij} = \phi^{-2} \gamma^{ij}\f$.
     103             :  */
     104             : template <typename DataType, size_t Dim, typename Frame = Frame::Inertial>
     105           1 : using InverseConformalMetric =
     106             :     gr::Tags::Conformal<gr::Tags::InverseSpatialMetric<DataType, Dim, Frame>,
     107             :                         -2>;
     108             : 
     109             : /*!
     110             :  * \brief The trace-free part of the extrinsic curvature
     111             :  *
     112             :  * \details See `Ccz4::a_tilde()` for details.
     113             :  */
     114             : template <typename DataType, size_t Dim, typename Frame>
     115           1 : struct ATilde : db::SimpleTag {
     116           0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     117             : };
     118             : 
     119             : /*!
     120             :  * \brief The trace of the trace-free part of the extrinsic curvature
     121             :  *
     122             :  * \details We define:
     123             :  *
     124             :  * \f{align}
     125             :  *     tr\tilde{A} &= \tilde{\gamma}^{ij} \tilde{A}_{ij}
     126             :  * \f}
     127             :  *
     128             :  * where \f$\tilde{\gamma}^{ij}\f$ is the inverse conformal spatial metric
     129             :  * defined by `Ccz4::Tags::InverseConformalMetric` and \f$\tilde{A}_{ij}\f$ is
     130             :  * the trace-free part of the extrinsic curvature defined by
     131             :  * `Ccz4::Tags::ATilde`.
     132             :  */
     133             : template <typename DataType>
     134           1 : struct TraceATilde : db::SimpleTag {
     135           0 :   using type = Scalar<DataType>;
     136             : };
     137             : 
     138             : /*!
     139             :  * \brief The natural log of the lapse
     140             :  */
     141             : template <typename DataType>
     142           1 : struct LogLapse : db::SimpleTag {
     143           0 :   using type = Scalar<DataType>;
     144             : };
     145             : 
     146             : /*!
     147             :  * \brief Auxiliary variable which is analytically the spatial derivative of the
     148             :  * natural log of the lapse
     149             :  *
     150             :  * \details If \f$ \alpha \f$ is the lapse, then we define
     151             :  * \f$A_i = \partial_i ln(\alpha) = \frac{\partial_i \alpha}{\alpha}\f$.
     152             :  */
     153             : template <typename DataType, size_t Dim, typename Frame>
     154           1 : struct FieldA : db::SimpleTag {
     155           0 :   using type = tnsr::i<DataType, Dim, Frame>;
     156             : };
     157             : 
     158             : /*!
     159             :  * \brief Auxiliary variable which is analytically the spatial derivative of the
     160             :  * shift
     161             :  */
     162             : template <typename DataType, size_t Dim, typename Frame>
     163           1 : struct FieldB : db::SimpleTag {
     164           0 :   using type = tnsr::iJ<DataType, Dim, Frame>;
     165             : };
     166             : 
     167             : /*!
     168             :  * \brief Auxiliary variable which is analytically half the spatial derivative
     169             :  * of the conformal spatial metric
     170             :  *
     171             :  * \details If \f$\bar{\gamma}_{ij}\f$ is the conformal spatial metric, then we
     172             :  * define
     173             :  * \f$D_{kij} = \frac{1}{2} \partial_k \bar{\gamma}_{ij}\f$.
     174             :  */
     175             : template <typename DataType, size_t Dim, typename Frame>
     176           1 : struct FieldD : db::SimpleTag {
     177           0 :   using type = tnsr::ijj<DataType, Dim, Frame>;
     178             : };
     179             : 
     180             : /*!
     181             :  * \brief The natural log of the conformal factor
     182             :  */
     183             : template <typename DataType>
     184           1 : struct LogConformalFactor : db::SimpleTag {
     185           0 :   using type = Scalar<DataType>;
     186             : };
     187             : 
     188             : /*!
     189             :  * \brief Auxiliary variable which is analytically the spatial derivative of the
     190             :  * natural log of the conformal factor
     191             :  *
     192             :  * \details If \f$\phi\f$ is the conformal factor, then we define
     193             :  * \f$P_i = \partial_i ln(\phi) = \frac{\partial_i \phi}{\phi}\f$.
     194             :  */
     195             : template <typename DataType, size_t Dim, typename Frame>
     196           1 : struct FieldP : db::SimpleTag {
     197           0 :   using type = tnsr::i<DataType, Dim, Frame>;
     198             : };
     199             : 
     200             : /*!
     201             :  * \brief Identity which is analytically negative one half the spatial
     202             :  * derivative of the inverse conformal spatial metric
     203             :  *
     204             :  * \details We define:
     205             :  * \f{align}
     206             :  *     D_k{}^{ij} &=
     207             :  *         \tilde{\gamma}^{in} \tilde{\gamma}^{mj} D_{knm} =
     208             :  *         -\frac{1}{2} \partial_k \tilde{\gamma}^{ij}
     209             :  * \f}
     210             :  * where \f$\tilde{\gamma}^{ij}\f$ and \f$D_{ijk}\f$ are the inverse conformal
     211             :  * spatial metric and the CCZ4 auxiliary variable defined by
     212             :  * `Ccz4::Tags::FieldD`, respectively.
     213             :  */
     214             : template <typename DataType, size_t Dim, typename Frame>
     215           1 : struct FieldDUp : db::SimpleTag {
     216           0 :   using type = tnsr::iJJ<DataType, Dim, Frame>;
     217             : };
     218             : 
     219             : /*!
     220             :  * \brief The conformal spatial christoffel symbols of the second kind
     221             :  *
     222             :  * \details We define:
     223             :  * \f{align}
     224             :  *     \tilde{\Gamma}^k_{ij} &=
     225             :  *         \tilde{\gamma}^{kl} (D_{ijl} + D_{jil} - D_{lij})
     226             :  * \f}
     227             :  * where \f$\tilde{\gamma}^{ij}\f$ and \f$D_{ijk}\f$ are the inverse conformal
     228             :  * spatial metric and the CCZ4 auxiliary variable defined by
     229             :  * `Ccz4::Tags::InverseConformalMetric` and `Ccz4::Tags::FieldD`, respectively.
     230             :  */
     231             : template <typename DataType, size_t Dim, typename Frame>
     232           1 : struct ConformalChristoffelSecondKind : db::SimpleTag {
     233           0 :   using type = tnsr::Ijj<DataType, Dim, Frame>;
     234             : };
     235             : 
     236             : /*!
     237             :  * \brief The spatial derivative of the conformal spatial christoffel symbols
     238             :  * of the second kind
     239             :  *
     240             :  * \details We define:
     241             :  * \f{align}
     242             :  *     \partial_k \tilde{\Gamma}^m{}_{ij} &=
     243             :  *       -2 D_k{}^{ml} (D_{ijl} + D_{jil} - D_{lij}) +
     244             :  *       \tilde{\gamma}^{ml}(\partial_{(k} D_{i)jl} + \partial_{(k} D_{j)il} -
     245             :  *       \partial_{(k} D_{l)ij})
     246             :  * \f}
     247             :  * where \f$\tilde{\gamma}^{ij}\f$, \f$D_{ijk}\f$, \f$\partial_l D_{ijk}\f$, and
     248             :  * \f$D_k{}^{ij}\f$ are the inverse conformal spatial metric defined by
     249             :  * `Ccz4::Tags::InverseConformalMetric`, the CCZ4 auxiliary variable defined by
     250             :  * `Ccz4::Tags::FieldD`, its spatial derivative, and the CCZ4 identity defined
     251             :  * by `Ccz4::Tags::FieldDUp`.
     252             :  */
     253             : template <typename DataType, size_t Dim, typename Frame>
     254           1 : struct DerivConformalChristoffelSecondKind : db::SimpleTag {
     255           0 :   using type = tnsr::iJkk<DataType, Dim, Frame>;
     256             : };
     257             : 
     258             : /*!
     259             :  * \brief The spatial christoffel symbols of the second kind
     260             :  *
     261             :  * \details We define:
     262             :  * \f{align}
     263             :  *     \Gamma^k_{ij} &= \tilde{\Gamma}^k_{ij} -
     264             :  *         \tilde{\gamma}^{kl} (\tilde{\gamma}_{jl} P_i +
     265             :  *                              \tilde{\gamma}_{il} P_j -
     266             :  *                              \tilde{\gamma}_{ij} P_l)
     267             :  * \f}
     268             :  * where \f$\tilde{\gamma}^{ij}\f$, \f$\tilde{\gamma}_{ij}\f$,
     269             :  * \f$\tilde{\Gamma}^k_{ij}\f$, and \f$P_i\f$ are the conformal spatial metric,
     270             :  * the inverse conformal spatial metric, the conformal spatial christoffel
     271             :  * symbols of the second kind, and the CCZ4 auxiliary variable defined by
     272             :  * `Ccz4::Tags::ConformalMetric`, `Ccz4::Tags::InverseConformalMetric`,
     273             :  * `Ccz4::Tags::ConformalChristoffelSecondKind`, and `Ccz4::Tags::FieldP`,
     274             :  * respectively.
     275             :  */
     276             : template <typename DataType, size_t Dim, typename Frame>
     277           1 : struct ChristoffelSecondKind : db::SimpleTag {
     278           0 :   using type = tnsr::Ijj<DataType, Dim, Frame>;
     279             : };
     280             : 
     281             : /*!
     282             :  * \brief The spatial Ricci tensor
     283             :  *
     284             :  * \details See `Ccz4::spatial_ricci_tensor()` for details.
     285             :  */
     286             : template <typename DataType, size_t Dim, typename Frame>
     287           1 : struct Ricci : db::SimpleTag {
     288           0 :   using type = tnsr::ii<DataType, Dim, Frame>;
     289             : };
     290             : 
     291             : /*!
     292             :  * \brief The gradient of the gradient of the lapse
     293             :  *
     294             :  * \details We define:
     295             :  * \f{align}
     296             :  *     \nabla_i \nabla_j \alpha &= \alpha A_i A_j -
     297             :  *                 \alpha \Gamma^k{}_{ij} A_k + \alpha \partial_{(i} A_{j)}
     298             :  * \f}
     299             :  * where \f$\alpha\f$, \f$\Gamma^k{}_{ij}\f$, \f$A_i\f$, and
     300             :  * \f$\partial_j A_i\f$ are the lapse, spatial christoffel symbols of the second
     301             :  * kind, the CCZ4 auxiliary variable defined by `Ccz4::Tags::FieldA`, and its
     302             :  * spatial derivative, respectively.
     303             :  */
     304             : template <typename DataType, size_t Dim, typename Frame>
     305           1 : struct GradGradLapse : db::SimpleTag {
     306           0 :   using type = tnsr::ij<DataType, Dim, Frame>;
     307             : };
     308             : 
     309             : /*!
     310             :  * \brief The divergence of the lapse
     311             :  *
     312             :  * \details We define:
     313             :  * \f{align}
     314             :  *     \nabla^i \nabla_i \alpha &= \phi^2 \tilde{\gamma}^{ij}
     315             :  *         (\nabla_i \nabla_j \alpha)
     316             :  * \f}
     317             :  * where \f$\phi\f$, \f$\tilde{\gamma}^{ij}\f$, and
     318             :  * \f$\nabla_i \nabla_j \alpha\f$ are the conformal factor, inverse conformal
     319             :  * spatial metric, and the gradient of the gradient of the lapse defined by
     320             :  * `Ccz4::Tags::ConformalFactor`, `Ccz4::Tags::InverseConformalMetric`, and
     321             :  * `Ccz4::Tags::GradGradLapse`, respectively.
     322             :  */
     323             : template <typename DataType>
     324           1 : struct DivergenceLapse : db::SimpleTag {
     325           0 :   using type = Scalar<DataType>;
     326             : };
     327             : 
     328             : /*!
     329             :  * \brief The contraction of the conformal spatial Christoffel symbols of the
     330             :  * second kind
     331             :  *
     332             :  * \details See `Ccz4::contracted_conformal_christoffel_second_kind()` for
     333             :  * details.
     334             :  */
     335             : template <typename DataType, size_t Dim, typename Frame>
     336           1 : struct ContractedConformalChristoffelSecondKind : db::SimpleTag {
     337           0 :   using type = tnsr::I<DataType, Dim, Frame>;
     338             : };
     339             : 
     340             : /*!
     341             :  * \brief The spatial derivative of the contraction of the conformal spatial
     342             :  * Christoffel symbols of the second kind
     343             :  *
     344             :  * \details See `Ccz4::deriv_contracted_conformal_christoffel_second_kind()` for
     345             :  * details.
     346             :  */
     347             : template <typename DataType, size_t Dim, typename Frame>
     348           1 : struct DerivContractedConformalChristoffelSecondKind : db::SimpleTag {
     349           0 :   using type = tnsr::iJ<DataType, Dim, Frame>;
     350             : };
     351             : 
     352             : /*!
     353             :  * \brief The CCZ4 evolved variable \f$\hat{\Gamma}^i\f$
     354             :  *
     355             :  * \details This must satisfy the identity:
     356             :  *
     357             :  * \f{align}
     358             :  *     \hat{\Gamma}^i &= \tilde{\Gamma}^i + 2 \tilde{\gamma}^{ij} Z_j
     359             :  * \f}
     360             :  *
     361             :  * where \f$\tilde{\gamma}^{ij}\f$ is the inverse conformal spatial metric
     362             :  * defined by `Ccz4::Tags::InverseConformalMetric`, \f$Z_i\f$ is the spatial
     363             :  * part of the Z4 constraint defined by `Ccz4::Tags::SpatialZ4Constraint`, and
     364             :  * \f$\tilde{\Gamma}^i\f$ is the contraction of the conformal spatial
     365             :  * christoffel symbols of the second kind defined by
     366             :  * `Ccz4::Tags::ContractedConformalChristoffelSecondKind`.
     367             :  */
     368             : template <typename DataType, size_t Dim, typename Frame>
     369           1 : struct GammaHat : db::SimpleTag {
     370           0 :   using type = tnsr::I<DataType, Dim, Frame>;
     371             : };
     372             : 
     373             : /*!
     374             :  * \brief The spatial part of the Z4 constraint
     375             :  *
     376             :  * \details See `Ccz4::spatial_z4_constraint` for details.
     377             :  */
     378             : template <typename DataType, size_t Dim, typename Frame>
     379           1 : struct SpatialZ4Constraint : db::SimpleTag {
     380           0 :   using type = tnsr::i<DataType, Dim, Frame>;
     381             : };
     382             : 
     383             : /*!
     384             :  * \brief The spatial part of the upper Z4 constraint
     385             :  *
     386             :  * \details See `Ccz4::upper_spatial_z4_constraint` for details.
     387             :  */
     388             : template <typename DataType, size_t Dim, typename Frame>
     389           1 : struct SpatialZ4ConstraintUp : db::SimpleTag {
     390           0 :   using type = tnsr::I<DataType, Dim, Frame>;
     391             : };
     392             : 
     393             : /*!
     394             :  * \brief The gradient of the spatial part of the Z4 constraint
     395             :  *
     396             :  * \details See `Ccz4::grad_spatial_z4_constraint` for details.
     397             :  */
     398             : template <typename DataType, size_t Dim, typename Frame>
     399           1 : struct GradSpatialZ4Constraint : db::SimpleTag {
     400           0 :   using type = tnsr::ij<DataType, Dim, Frame>;
     401             : };
     402             : 
     403             : /*!
     404             :  * \brief The sum of the Ricci scalar and twice the divergence of the upper
     405             :  * spatial Z4 constraint
     406             :  *
     407             :  * \details See `Ccz4::ricci_scalar_plus_divergence_z4_constraint` for details.
     408             :  */
     409             : template <typename DataType>
     410           1 : struct RicciScalarPlusDivergenceZ4Constraint : db::SimpleTag {
     411           0 :   using type = Scalar<DataType>;
     412             : };
     413             : 
     414             : /*!
     415             :  * \brief The projection of the Z4 constraint vector along the normal direction.
     416             :  *
     417             :  *
     418             :  */
     419             : template <typename DataType>
     420           1 : struct Theta : db::SimpleTag {
     421           0 :   using type = Scalar<DataType>;
     422             : };
     423             : 
     424             : /*!
     425             :  * \brief Auxiliary variable b in the gamma-driver condition
     426             :  * eq. 12c of \cite Dumbser2017okk.
     427             :  */
     428             : template <typename DataType, size_t Dim, typename Frame>
     429           1 : struct AuxiliaryShiftB : db::SimpleTag {
     430           0 :   using type = tnsr::I<DataType, Dim, Frame>;
     431             : };
     432             : 
     433             : /*!
     434             :  * \brief The parameter f in the gamma-driver condition
     435             :  * eq. 12c of \cite Dumbser2017okk.
     436             :  *
     437             :  */
     438           1 : struct GammaDriverParam
     439             :     : db::SimpleTag {
     440           0 :   using type = double;
     441             : };
     442             : 
     443             : /*!
     444             :  * \brief Free parameter \f$ kappa_1 \f$ related to
     445             :  * constraint damping
     446             :  * in eq. 12f of \cite Dumbser2017okk.
     447             :  */
     448           1 : struct Kappa1 : db::SimpleTag {
     449           0 :   using type = double;
     450           0 :   using option_tags = tmpl::list<OptionTags::Kappa1>;
     451             : 
     452           0 :   static constexpr bool pass_metavariables = false;
     453           0 :   static type create_from_options(const double kappa_1) { return kappa_1; }
     454             : };
     455             : 
     456             : /*!
     457             :  * \brief Free parameter \f$ kappa_2 \f$ related to
     458             :  * constraint damping
     459             :  * in eq. 12f of \cite Dumbser2017okk.
     460             :  */
     461           1 : struct Kappa2 : db::SimpleTag {
     462           0 :   using type = double;
     463           0 :   using option_tags = tmpl::list<OptionTags::Kappa2>;
     464             : 
     465           0 :   static constexpr bool pass_metavariables = false;
     466           0 :   static type create_from_options(const double kappa_2) { return kappa_2; }
     467             : };
     468             : 
     469             : /*!
     470             :  * \brief Free parameter \f$ kappa_3 \f$ related to
     471             :  * constraint damping
     472             :  * in eq. 12h of \cite Dumbser2017okk.
     473             :  */
     474           1 : struct Kappa3 : db::SimpleTag {
     475           0 :   using type = double;
     476           0 :   using option_tags = tmpl::list<OptionTags::Kappa3>;
     477             : 
     478           0 :   static constexpr bool pass_metavariables = false;
     479           0 :   static type create_from_options(const double kappa_3) { return kappa_3; }
     480             : };
     481             : 
     482             : /*!
     483             :  * \brief Free parameter \f$ K_0 \f$ in 1+log slicing
     484             :  * in eq. 12b of \cite Dumbser2017okk.
     485             :  */
     486             : template <typename DataType>
     487           1 : struct K0 : db::SimpleTag {
     488           0 :   using type = Scalar<DataType>;
     489             : };
     490             : 
     491             : /*!
     492             :  * \brief The parameter \f$ \eta \f$ in the gamma-driver
     493             :  * condition eq. 12i of \cite Dumbser2017okk.
     494             :  *
     495             :  */
     496             : template <typename DataType>
     497           1 : struct Eta : db::SimpleTag {
     498           0 :   using type = Scalar<DataType>;
     499             : };
     500             : }  // namespace Tags
     501             : }  // namespace Ccz4

Generated by: LCOV version 1.14