TimeDerivative.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" // IWYU pragma: keep
10 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
11 #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp" // IWYU pragma: keep
12 #include "Utilities/TMPL.hpp"
13 
14 /// \cond
15 class DataVector;
16 
17 namespace PUP {
18 class er;
19 } // namespace PUP
20 
21 namespace gsl {
22 template <class T>
23 class not_null;
24 } // namespace gsl
25 
26 template <typename, typename, typename>
27 class Tensor;
28 /// \endcond
29 
30 // IWYU pragma: no_forward_declare Tags::deriv
31 
32 namespace GeneralizedHarmonic {
33 /*!
34  * \brief Compute the RHS of the Generalized Harmonic formulation of
35  * Einstein's equations.
36  *
37  * The evolved variables are the spacetime metric \f$g_{ab}\f$, its spatial
38  * derivative \f$\Phi_{iab}=\partial_i g_{ab}\f$, and conjugate momentum
39  * \f$\Pi_{ab}=n^c\partial_c g_{ab}\f$, where \f$n^a\f$ is the spacetime
40  * unit normal vector. The evolution equations are (Eqs. 35-57 of
41  * \cite Lindblom2005qh)
42  *
43  * \f{align}{
44  * \partial_t g_{ab}-
45  * &\left(1+\gamma_1\right)\beta^k\partial_k g_{ab} =
46  * -\alpha \Pi_{ab}-\gamma_1\beta^i\Phi_{iab}, \\
47  *
48  * \partial_t\Pi_{ab}-
49  * &\beta^k\partial_k\Pi_{ab} + \alpha \gamma^{ki}\partial_k\Phi_{iab}
50  * - \gamma_1\gamma_2\beta^k\partial_kg_{ab} \notag \\
51  * =&2\alpha g^{cd}\left(\gamma^{ij}\Phi_{ica}\Phi_{jdb}
52  * - \Pi_{ca}\Pi_{db} - g^{ef}\Gamma_{ace}\Gamma_{bdf}\right) \notag \\
53  * &-2\alpha \nabla_{(a}H_{b)}
54  * - \frac{1}{2}\alpha n^c n^d\Pi_{cd}\Pi_{ab}
55  * - \alpha n^c \Pi_{ci}\gamma^{ij}\Phi_{jab} \notag \\
56  * &+\alpha \gamma_0\left(2\delta^c{}_{(a} n_{b)}
57  * - (1 + \gamma_3)g_{ab}n^c\right)\mathcal{C}_c \notag \\
58  * &+ 2 \gamma_4 \alpha \Pi_{ab} n^c \mathcal{C}_c \notag \\
59  * &- \gamma_5\alpha n^c\mathcal{C}_c \left(\frac{\mathcal{C}_a\mathcal{C}_b
60  * - \frac{1}{2} g_{ab} \mathcal{C}_d \mathcal{C}^d}
61  * {\epsilon_{5} + 2 n^d \mathcal{C}_d n^e \mathcal{C}_e
62  * + \mathcal{C}_d \mathcal{C}^d} \right) \notag \\
63  * &-\gamma_1\gamma_2 \beta^i\Phi_{iab} \notag \\
64  * &-16\pi \alpha \left(T_{ab} - \frac{1}{2}g_{ab}T^c{}_c\right),\\
65  *
66  * \partial_t\Phi_{iab}-
67  * &\beta^k\partial_k\Phi_{iab} + \alpha \partial_i\Pi_{ab}
68  * - \alpha \gamma_2\partial_ig_{ab} \notag \\
69  * =&\frac{1}{2}\alpha n^c n^d\Phi_{icd}\Pi_{ab}
70  * + \alpha \gamma^{jk}n^c\Phi_{ijc}\Phi_{kab} \notag \\
71  * &-\alpha \gamma_2\Phi_{iab},
72  * \f}
73  *
74  * where \f$H_a\f$ is the gauge source function and
75  * \f$\mathcal{C}_a=H_a+\Gamma_a\f$ is the gauge constraint. The constraint
76  * damping parameters \f$\gamma_0\f$ \f$\gamma_1\f$, \f$\gamma_2\f$,
77  * \f$\gamma_3\f$, \f$\gamma_4\f$, and \f$\gamma_5\f$ have units of inverse time
78  * and control the time scales on which the constraints are damped to zero.
79  *
80  * \note We have not coded up the constraint damping terms for \f$\gamma_3\f$,
81  * \f$\gamma_4\f$, and \f$\gamma_5\f$. \f$\gamma_3\f$ was found to be essential
82  * for evolutions of black strings by Pretorius and Lehner \cite Lehner2010pn.
83  */
84 template <size_t Dim>
86  public:
87  using temporary_tags = tmpl::list<>;
88  using argument_tags =
89  tmpl::list<gr::Tags::SpacetimeMetric<Dim>, Tags::Pi<Dim>, Tags::Phi<Dim>,
93 
94  static void apply(
95  gsl::not_null<tnsr::aa<DataVector, Dim>*> dt_spacetime_metric,
96  gsl::not_null<tnsr::aa<DataVector, Dim>*> dt_pi,
97  gsl::not_null<tnsr::iaa<DataVector, Dim>*> dt_phi,
98  const tnsr::iaa<DataVector, Dim>& d_spacetime_metric,
99  const tnsr::iaa<DataVector, Dim>& d_pi,
100  const tnsr::ijaa<DataVector, Dim>& d_phi,
101  const tnsr::aa<DataVector, Dim>& spacetime_metric,
102  const tnsr::aa<DataVector, Dim>& pi,
103  const tnsr::iaa<DataVector, Dim>& phi, const Scalar<DataVector>& gamma0,
104  const Scalar<DataVector>& gamma1, const Scalar<DataVector>& gamma2,
105  const tnsr::a<DataVector, Dim>& gauge_function,
106  const tnsr::ab<DataVector, Dim>& spacetime_deriv_gauge_function) noexcept;
107 };
108 } // namespace GeneralizedHarmonic
GeneralizedHarmonic::Tags::SpacetimeDerivGaugeH
Spacetime derivatives of the gauge source function for the generalized harmonic system.
Definition: Tags.hpp:77
GeneralizedHarmonic::pi
void pi(gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > pi, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes the conjugate momentum of the spacetime metric .
GeneralizedHarmonic
Items related to evolving the first-order generalized harmonic system.
Definition: Characteristics.cpp:21
GeneralizedHarmonic::Tags::ConstraintGamma0
Definition: Tags.hpp:44
cstddef
GeneralizedHarmonic::TimeDerivative
Compute the RHS of the Generalized Harmonic formulation of Einstein's equations.
Definition: TimeDerivative.hpp:85
GeneralizedHarmonic::Tags::Pi
Conjugate momentum to the spacetime metric.
Definition: Tags.hpp:29
GeneralizedHarmonic::Tags::ConstraintGamma1
Definition: Tags.hpp:47
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:42
GeneralizedHarmonic::phi
void phi(gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * > phi, const Scalar< DataType > &lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric) noexcept
Computes the auxiliary variable used by the generalized harmonic formulation of Einstein's equations...
GeneralizedHarmonic::Tags::GaugeH
Gauge source function for the generalized harmonic system.
Definition: Tags.hpp:63
GeneralizedHarmonic::Tags::Phi
Auxiliary variable which is analytically the spatial derivative of the spacetime metric.
Definition: Tags.hpp:40
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
TypeAliases.hpp
gr::spacetime_metric
void spacetime_metric(gsl::not_null< tnsr::aa< DataType, Dim, Frame > * > spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift, const tnsr::ii< DataType, Dim, Frame > &spatial_metric) noexcept
Computes the spacetime metric from the spatial metric, lapse, and shift.
GeneralizedHarmonic::Tags::ConstraintGamma2
Definition: Tags.hpp:50
gsl
Implementations from the Guideline Support Library.
Definition: Gsl.hpp:80
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183