Equations.hpp
2 // See LICENSE.txt for details.
3
4 #pragma once
5
6 #include <cstddef>
7
10 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
11 #include "Utilities/Gsl.hpp"
12 #include "Utilities/TMPL.hpp"
13
14 /// \cond
15 class DataVector;
16 template <typename X, typename Symm, typename IndexList>
17 class Tensor;
18
19 namespace CurvedScalarWave {
20 struct Psi;
21 struct Pi;
22 template <size_t Dim>
23 struct Phi;
24 struct ConstraintGamma1;
25 struct ConstraintGamma2;
26 } // namespace CurvedScalarWave
27 /// \endcond
28
29 namespace CurvedScalarWave {
30 /*!
31  * \brief Compute the time derivative of the evolved variables of the
32  * first-order scalar wave system on a curved background.
33  *
34  * The evolution equations for the first-order scalar wave system are given by
35  * \cite Holst2004wt :
36  *
37  * \f{align}
38  * \partial_t\psi = & (1 + \gamma_1) N^k \partial_k \psi - N \Pi - \gamma_1 N^k
39  * \Phi_k \\
40  *
41  * \partial_t\Pi = & - N g^{ij}\partial_i\Phi_j + N^k \partial_k \Pi + \gamma_1
42  * \gamma_2 N^k \partial_k \psi + N \Gamma^i - g^{ij} \Phi_i \partial_j N
43  * + N K \Pi - \gamma_1 \gamma_2 N^k \Phi_k\\
44  *
45  * \partial_t\Phi_i = & - N \partial_i \Pi + N^k \partial_k \Phi + \gamma_2
46  * N \partial_i \psi - \Pi
47  * \partial_i N + \Phi_k \partial_i N^j - \gamma_2 N \Phi_i\\
48  * \f}
49  *
50  * where \f$\psi\f$ is the scalar field, \f$\Pi\f$ is the
51  * conjugate momentum to \f$\psi\f$, \f$\Phi_i=\partial_i\psi\f$ is an
52  * auxiliary variable, \f$N\f$ is the lapse, \f$N^k\f$ is the shift, \f$g_{ij} 53 * \f$ is the spatial metric, \f$K \f$ is the trace of the extrinsic curvature,
54  * and \f$\Gamma^i \f$ is the trace of the Christoffel symbol of the second
55  * kind.
56  * \f$\gamma_1, \gamma_2\f$ are constraint damping parameters.
57  */
58 template <size_t Dim>
59 struct ComputeDuDt {
60  using argument_tags = tmpl::list<
61  Pi, Phi<Dim>, Tags::deriv<Psi, tmpl::size_t<Dim>, Frame::Inertial>,
62  Tags::deriv<Pi, tmpl::size_t<Dim>, Frame::Inertial>,
63  Tags::deriv<Phi<Dim>, tmpl::size_t<Dim>, Frame::Inertial>,
66  Tags::deriv<gr::Tags::Lapse<DataVector>, tmpl::size_t<Dim>,
67  Frame::Inertial>,
68  Tags::deriv<gr::Tags::Shift<Dim, Frame::Inertial, DataVector>,
69  tmpl::size_t<Dim>, Frame::Inertial>,
72  DataVector>,
75
76  static void apply(
78  gsl::not_null<tnsr::i<DataVector, Dim, Frame::Inertial>*> dt_phi,
80  const tnsr::i<DataVector, Dim>& phi,
81  const tnsr::i<DataVector, Dim>& d_psi,
82  const tnsr::i<DataVector, Dim>& d_pi,
83  const tnsr::ij<DataVector, Dim>& d_phi, const Scalar<DataVector>& lapse,
84  const tnsr::I<DataVector, Dim>& shift,
85  const tnsr::i<DataVector, Dim>& deriv_lapse,
86  const tnsr::iJ<DataVector, Dim>& deriv_shift,
87  const tnsr::II<DataVector, Dim>& upper_spatial_metric,
88  const tnsr::I<DataVector, Dim>& trace_spatial_christoffel,
89  const Scalar<DataVector>& trace_extrinsic_curvature,
90  const Scalar<DataVector>& gamma1,
91  const Scalar<DataVector>& gamma2) noexcept;
92 };
93 } // namespace CurvedScalarWave
Definition: Tags.hpp:34
Definition: Tags.hpp:101
Definition: Tags.hpp:23
Definition: Tags.hpp:46
Definition: Tags.hpp:31
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 .
Definition: ComputeGhQuantities.cpp:58
Definition: Tags.hpp:29
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&#39;s equations...
Definition: ComputeGhQuantities.cpp:22
Defines functions computing partial derivatives.
Definition: Tags.hpp:41
Compute the time derivative of the evolved variables of the first-order scalar wave system on a curve...
Definition: Equations.hpp:59
Scalar< DataType > lapse(const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute lapse from shift and spacetime metric.
Definition: ComputeSpacetimeQuantities.cpp:98
Defines a list of useful type aliases for tensors.
tnsr::I< DataType, SpatialDim, Frame > shift(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Compute shift from spacetime metric and inverse spatial metric.
Definition: ComputeSpacetimeQuantities.cpp:82
Stores a collection of function values.
Definition: DataVector.hpp:46
Wraps the template metaprogramming library used (brigand)
Defines functions and classes from the GSL.
Definition: Tags.hpp:39
Definition: IndexType.hpp:44
Items related to evolving a scalar wave on a curved background.
Definition: Equations.cpp:18
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12