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 :
8 : #include "DataStructures/Tensor/TypeAliases.hpp"
9 : #include "Evolution/Systems/CurvedScalarWave/Characteristics.hpp"
10 : #include "Evolution/Systems/CurvedScalarWave/Tags.hpp"
11 : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
12 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
13 : #include "Utilities/Gsl.hpp"
14 : #include "Utilities/TMPL.hpp"
15 :
16 : /// \cond
17 : class DataVector;
18 : template <typename X, typename Symm, typename IndexList>
19 : class Tensor;
20 : /// \endcond
21 :
22 : namespace CurvedScalarWave {
23 : /*!
24 : * \brief Compute the time derivative of the evolved variables of the
25 : * first-order scalar wave system on a curved background.
26 : *
27 : * The evolution equations for the first-order scalar wave system are given by
28 : * \cite Holst2004wt :
29 : *
30 : * \f{align}
31 : * \partial_t\Psi = & - \alpha \Pi + \beta^k \partial_k \Psi
32 : * + \gamma_1 \beta^k (\partial_k \Psi - \Phi_k) \\
33 : *
34 : * \partial_t\Pi = & \alpha K \Pi + \beta^i \partial_i \Pi
35 : * + \alpha \Gamma^i \Phi_i
36 : * + \gamma_1 \gamma_2 \beta^i ( \partial_i \Psi - \Phi_i )
37 : * - \alpha \gamma^{ij} \partial_i\Phi_j
38 : * - \gamma^{ij} \Phi_i \partial_j \alpha \\
39 : *
40 : * \partial_t\Phi_i = & - \alpha \partial_i \Pi + \beta^k \partial_k \Phi_i
41 : * + \gamma_2 \alpha ( \partial_i \Psi - \Phi_i )
42 : * - \Pi \partial_i \alpha + \Phi_j \partial_i \beta^j \\
43 : * \f}
44 : *
45 : * where \f$\Psi\f$ is the scalar field, \f$\Pi\f$ is the
46 : * conjugate momentum to \f$\Psi\f$, \f$\Phi_i=\partial_i\Psi\f$ is an
47 : * auxiliary variable, \f$\alpha\f$ is the lapse, \f$\beta^k\f$ is the shift,
48 : * \f$ \gamma_{ij} \f$ is the spatial metric, \f$ K \f$ is the trace of the
49 : * extrinsic curvature, and \f$ \Gamma^i \f$ is the trace of the spatial
50 : * Christoffel symbol of the second kind. \f$\gamma_1, \gamma_2\f$ are
51 : * constraint damping parameters.
52 : */
53 : template <size_t Dim>
54 1 : struct TimeDerivative {
55 : public:
56 0 : using temporary_tags =
57 : tmpl::list<gr::Tags::Lapse<DataVector>, gr::Tags::Shift<DataVector, Dim>,
58 : gr::Tags::InverseSpatialMetric<DataVector, Dim>,
59 : Tags::ConstraintGamma1, Tags::ConstraintGamma2>;
60 :
61 0 : using argument_tags =
62 : tmpl::list<Tags::Pi, Tags::Phi<Dim>, gr::Tags::Lapse<DataVector>,
63 : gr::Tags::Shift<DataVector, Dim>,
64 : ::Tags::deriv<gr::Tags::Lapse<DataVector>, tmpl::size_t<Dim>,
65 : Frame::Inertial>,
66 : ::Tags::deriv<gr::Tags::Shift<DataVector, Dim>,
67 : tmpl::size_t<Dim>, Frame::Inertial>,
68 : gr::Tags::InverseSpatialMetric<DataVector, Dim>,
69 : gr::Tags::TraceSpatialChristoffelSecondKind<DataVector, Dim>,
70 : gr::Tags::TraceExtrinsicCurvature<DataVector>,
71 : Tags::ConstraintGamma1, Tags::ConstraintGamma2>;
72 :
73 0 : static void apply(
74 : gsl::not_null<Scalar<DataVector>*> dt_psi,
75 : gsl::not_null<Scalar<DataVector>*> dt_pi,
76 : gsl::not_null<tnsr::i<DataVector, Dim, Frame::Inertial>*> dt_phi,
77 :
78 : gsl::not_null<Scalar<DataVector>*> result_lapse,
79 : gsl::not_null<tnsr::I<DataVector, Dim>*> result_shift,
80 : gsl::not_null<tnsr::II<DataVector, Dim>*> result_inverse_spatial_metric,
81 : gsl::not_null<Scalar<DataVector>*> result_gamma1,
82 : gsl::not_null<Scalar<DataVector>*> result_gamma2,
83 :
84 : const tnsr::i<DataVector, Dim>& d_psi,
85 : const tnsr::i<DataVector, Dim>& d_pi,
86 : const tnsr::ij<DataVector, Dim>& d_phi, const Scalar<DataVector>& pi,
87 : const tnsr::i<DataVector, Dim>& phi, const Scalar<DataVector>& lapse,
88 : const tnsr::I<DataVector, Dim>& shift,
89 : const tnsr::i<DataVector, Dim>& deriv_lapse,
90 : const tnsr::iJ<DataVector, Dim>& deriv_shift,
91 : const tnsr::II<DataVector, Dim>& upper_spatial_metric,
92 : const tnsr::I<DataVector, Dim>& trace_spatial_christoffel,
93 : const Scalar<DataVector>& trace_extrinsic_curvature,
94 : const Scalar<DataVector>& gamma1, const Scalar<DataVector>& gamma2);
95 : };
96 : } // namespace CurvedScalarWave
|