FirstOrderSystem.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3
4 #pragma once
5
6 #include <cstddef>
7
9 #include "DataStructures/Tensor/EagerMath/Magnitude.hpp"
10 #include "Elliptic/BoundaryConditions/AnalyticSolution.hpp"
11 #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp"
12 #include "Elliptic/Systems/Xcts/BoundaryConditions/Flatness.hpp"
13 #include "Elliptic/Systems/Xcts/FluxesAndSources.hpp"
14 #include "Elliptic/Systems/Xcts/Geometry.hpp"
15 #include "Elliptic/Systems/Xcts/Tags.hpp"
17 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
18 #include "Utilities/TMPL.hpp"
19
20 namespace Xcts {
21
22 /*!
23  * \brief The Extended Conformal Thin Sandwich (XCTS) decomposition of the
24  * Einstein constraint equations, formulated as a set of coupled first-order
25  * partial differential equations
26  *
27  * See \ref Xcts for details on the XCTS equations. This system introduces as
28  * auxiliary variables the conformal factor gradient \f$v_i=\partial_i\psi\f$,
29  * the gradient of the lapse times the conformal factor
30  * \f$w_i=\partial_i\left(\alpha\psi\right)\f$, and the symmetric shift strain
31  * \f$B_{ij}=\bar{D}_{(i}\beta_{j)}\f$. Note that \f$B_{ij}\f$ is the
32  * symmetrized covariant gradient of the shift vector field and analogous to the
33  * "strain" in an elasticity equation (see Elasticity::FirstOrderSystem and
34  * Xcts::Tags::ShiftStrain for details). From the strain we can compute the
35  * longitudinal operator by essentially removing its trace (see
36  * Xcts::longitudinal_operator).
37  *
38  * When we cast the equations in first-order flux-form
39  *
40  * \f[
41  * -\partial_i F^i_A + S_A = f_A(x)
42  * \f]
43  *
44  * (see also Poisson::FirstOrderSystem), the fluxes \f$F^i_A\f$, sources
45  * \f$S_A\f$ and fixed-sources \f$f_A\f$ are:
46  *
47  * \f{align}
48  * F^i_{v_j} ={} &\delta^i_j \psi \\
49  * S_{v_j} ={} &v_j \\
50  * F^i_\psi ={} &\bar{\gamma}^{ij} v_j \\
51  * S_\psi ={} &-\bar{\Gamma}^i_{ij} F^j_\psi
52  * + \frac{1}{8}\psi\bar{R} + \frac{1}{12}\psi^5 K^2
53  * - \frac{1}{8}\psi^{-7}\bar{A}^2 - 2\pi\psi^5\rho
54  * \f}
55  *
56  * for the Hamiltonian constraint,
57  *
58  * \f{align}
59  * F^i_{w_j} ={} &\delta^i_j \alpha\psi \\
60  * S_{w_j} ={} &w_j \\
61  * F^i_{\alpha\psi} ={} &\bar{\gamma}^{ij} w_j \\
62  * S_{\alpha\psi} ={} &-\bar{\Gamma}^i_{ij} F^j_{\alpha\psi}
63  * + \alpha\psi \left(\frac{7}{8}\psi^{-8} \bar{A}^2
64  * + \frac{5}{12} \psi^4 K^2 + \frac{1}{8}\bar{R}
65  * + 2\pi\psi^4\left(\rho + 2S\right) \right) \\
66  * &- \psi^5\partial_t K + \psi^5\left(\beta^i\bar{D}_i K
67  * + \beta_\mathrm{background}^i\bar{D}_i K\right)
68  * \f}
69  *
70  * for the lapse equation, and
71  *
72  * \f{align}
73  * F^i_{B_{jk}} ={} &\delta^i_{(j} \gamma_{k)l} \beta^l \\
74  * S_{B_{jk}} ={} &B_{jk} + \bar{\Gamma}_{ijk}\beta^i \\
75  * F^i_{\beta^j} ={} &2\left(\gamma^{ik}\gamma^{jl}
76  * - \frac{1}{3} \gamma^{ij}\gamma^{kl}\right) B_{kl} \\
77  * S_{\beta^i} ={} &-\bar{\Gamma}^j_{jk} F^i_{\beta^k}
78  * - \bar{\Gamma}^i_{jk} F^j_{\beta^k}
79  * + \left(F^i_{\beta^j}
80  * + \left(\bar{L}\beta_\mathrm{background}\right)^{ij} - \bar{u}^{ij}\right)
81  * \bar{\gamma}_{jk} \left(\frac{F^k_{\alpha\psi}}{\alpha\psi}
82  * - 7 \frac{F^k_\psi}{\psi}\right) \\
83  * &- \bar{D}_j\left(\left(\bar{L}\beta_\mathrm{background}\right)^{ij}
84  * - \bar{u}^{ij}\right)
85  * + \frac{4}{3}\frac{\alpha\psi}{\psi}\bar{D}^i K
86  * + 16\pi\left(\alpha\psi\right)\psi^3 S^i
87  * \f}
88  *
89  * for the momentum constraint, with
90  *
91  * \f{align}
92  * \bar{A}^{ij} ={} &\frac{\psi^7}{2\alpha\psi}\left(
93  * \left(\bar{L}\beta\right)^{ij} +
94  * \left(\bar{L}\beta_\mathrm{background}\right)^{ij} - \bar{u}^{ij} \right) \\
95  * \text{and} \quad \left(\bar{L}\beta\right)^{ij} ={} &\bar{\nabla}^i \beta^j +
96  * \bar{\nabla}^j \beta^i - \frac{2}{3}\gamma^{ij}\bar{\nabla}_k\beta^k \\
97  * ={} &2\left(\bar{\gamma}^{ik}\bar{\gamma}^{jl} - \frac{1}{3}
98  * \bar{\gamma}^{ij}\bar{\gamma}^{kl}\right) B_{kl}
99  * \f}
100  *
101  * and all \f$f_A=0\f$.
102  *
103  * Note that the symbol \f$\beta\f$ in the equations above means
104  * \f$\beta_\mathrm{excess}\f$. The full shift is \f$\beta_\mathrm{excess} + 105 * \beta_\mathrm{background}\f$. See Xcts::Tags::ShiftBackground and
106  * Xcts::Tags::ShiftExcess for details on this split. Also note that the
107  * background shift is degenerate with \f$\bar{u}\f$ so we treat the quantity
108  * \f$\left(\bar{L}\beta_\mathrm{background}\right)^{ij} - \bar{u}^{ij}\f$ as a
109  * single background field (see
110  * Xcts::Tags::LongitudinalShiftBackgroundMinusDtConformalMetric). The
111  * covariant divergence of this quantity w.r.t. the conformal metric is also a
112  * background field.
113  *
114  * \par Solving a subset of equations:
115  * This system allows you to select a subset of Xcts::Equations so you don't
116  * have to solve for all variables if some are analytically known. Specify the
117  * set of enabled equations as the first template parameter. The set of required
118  * background fields depends on your choice of equations.
119  *
120  * \par Conformal background geometry:
121  * The equations simplify significantly if the conformal metric is flat
122  * ("conformal flatness") and in Cartesian coordinates. In this case you can
123  * specify Xcts::Geometry::FlatCartesian as the second template parameter so
124  * computations are optimized for a flat background geometry and you don't have
125  * to supply geometric background fields. Else, specify
126  * Xcts::Geometry::Curved.
127  *
128  * \par Conformal matter scale:
129  * The matter source terms in the XCTS equations have the known defect that they
130  * can spoil uniqueness of the solutions. See e.g. \cite Baumgarte2006ug for a
131  * detailed study. To cure this defect one can conformally re-scale the matter
132  * source terms as \f$\bar{\rho}=\psi^n\rho\f$, \f$\bar{S}=\psi^n S\f$ and
133  * \f$\bar{S^i}=\psi^n S^i\f$ and treat the re-scaled fields as
134  * freely-specifyable background data for the XCTS equations. You can select the
135  * ConformalMatterScale \f$n\f$ as the third template parameter. Common
136  * choices are \f$n=0\f$ for vacuum systems where the matter sources are
137  * irrelevant, \f$n=6\f$ as suggested in \cite Foucart2008qt or \f$n=8\f$ as
138  * suggested in \cite Baumgarte2006ug.
139  */
140 template <Equations EnabledEquations, Geometry ConformalGeometry,
141  int ConformalMatterScale>
143  private:
156
157  public:
158  static constexpr size_t volume_dim = 3;
159
160  // The physical fields to solve for
161  using primal_fields = tmpl::flatten<tmpl::list<
163  tmpl::conditional_t<EnabledEquations == Equations::HamiltonianAndLapse or
164  EnabledEquations ==
166  lapse_times_conformal_factor, tmpl::list<>>,
167  tmpl::conditional_t<EnabledEquations ==
169  shift_excess, tmpl::list<>>>>;
170  using auxiliary_fields = tmpl::flatten<tmpl::list<
172  tmpl::conditional_t<EnabledEquations == Equations::HamiltonianAndLapse or
173  EnabledEquations ==
176  tmpl::conditional_t<EnabledEquations ==
178  shift_strain, tmpl::list<>>>>;
179
180  // As fluxes we use the gradients with raised indices for the Hamiltonian and
181  // lapse equation, and the longitudinal shift excess for the momentum
182  // constraint. The gradient fluxes don't have symmetries and no particular
183  // meaning so we use the standard Flux tags, but for the symmetric
184  // longitudinal shift we use the corresponding symmetric tag.
185  using primal_fluxes = tmpl::flatten<tmpl::list<
187  tmpl::conditional_t<EnabledEquations == Equations::HamiltonianAndLapse or
188  EnabledEquations ==
191  tmpl::size_t<3>, Frame::Inertial>,
192  tmpl::list<>>,
193  tmpl::conditional_t<EnabledEquations ==
195  longitudinal_shift_excess, tmpl::list<>>>>;
196  using auxiliary_fluxes = db::wrap_tags_in<::Tags::Flux, auxiliary_fields,
197  tmpl::size_t<3>, Frame::Inertial>;
198
199  // The variable-independent fields in the equations
200  using background_fields = tmpl::flatten<tmpl::list<
201  // Quantities for Hamiltonian constraint
203  ConformalMatterScale>,
205  tmpl::conditional_t<ConformalGeometry == Geometry::Curved,
206  tmpl::list<Tags::InverseConformalMetric<
211  tmpl::list<>>,
212  tmpl::conditional_t<
213  EnabledEquations == Equations::Hamiltonian,
215  DataVector>,
216  tmpl::list<>>,
217  // Additional quantities for lapse equation
218  tmpl::conditional_t<
219  EnabledEquations == Equations::HamiltonianAndLapse or
220  EnabledEquations ==
222  tmpl::list<Tags::Conformal<gr::Tags::StressTrace<DataVector>,
223  ConformalMatterScale>,
225  tmpl::list<>>,
226  tmpl::conditional_t<
227  EnabledEquations ==
229  tmpl::list<
232  tmpl::list<>>,
233  // Additional quantities for momentum constraint
234  tmpl::conditional_t<
235  EnabledEquations ==
237  tmpl::list<
240  ConformalMatterScale>,
242  tmpl::size_t<3>, Frame::Inertial>,
246  // Note that this is the plain divergence, i.e. with no
247  // Christoffel symbol terms added
248  ::Tags::div<
251  tmpl::conditional_t<
252  ConformalGeometry == Geometry::Curved,
253  tmpl::list<
258  Frame::Inertial>>,
259  tmpl::list<>>>,
260  tmpl::list<>>>>;
261
263  using sources_computer =
266  LinearizedSources<EnabledEquations, ConformalGeometry,
267  ConformalMatterScale>;
268
269  // The supported boundary conditions. Boundary conditions can be
270  // factory-created from this base class.
273  3, tmpl::list<elliptic::BoundaryConditions::Registrars::
274  AnalyticSolution<FirstOrderSystem>,
275  BoundaryConditions::Registrars::Flatness>>;
276
277  // The tag of the operator to compute magnitudes on the manifold, e.g. to
278  // normalize vectors on the faces of an element
279  using inv_metric_tag = tmpl::conditional_t<
280  ConformalGeometry == Geometry::FlatCartesian, void,
282  template <typename Tag>
283  using magnitude_tag =
284  tmpl::conditional_t<ConformalGeometry == Geometry::FlatCartesian,
287 };
288
289 } // namespace Xcts
gr::Tags::TraceExtrinsicCurvature< DataVector >
Xcts::FirstOrderSystem
The Extended Conformal Thin Sandwich (XCTS) decomposition of the Einstein constraint equations,...
Definition: FirstOrderSystem.hpp:142
Xcts::Equations::HamiltonianAndLapse
@ HamiltonianAndLapse
Both the Hamiltonian constraint and the lapse equation, solved for and .
Xcts
Items related to solving the Extended Conformal Thin Sandwich (XCTS) decomposition of the Einstein co...
Definition: Flatness.hpp:22
Frame::Inertial
Definition: IndexType.hpp:44
Xcts::Tags::Conformal
The quantity Tag scaled by the Xcts::Tags::ConformalFactor to the given Power
Definition: Tags.hpp:30
Xcts::Tags::ConformalChristoffelSecondKind
The Christoffel symbols of the second kind related to the conformal metric .
Definition: Tags.hpp:212
Xcts::Tags::LapseTimesConformalFactor
The product of lapse and conformal factor .
Definition: Tags.hpp:63
Xcts::Tags::ConformalChristoffelContracted
The Christoffel symbols of the second kind (related to the conformal metric ) contracted in their fir...
Definition: Tags.hpp:222
Tags::Flux
Prefix indicating a flux.
Definition: Prefixes.hpp:40
Xcts::Tags::ConformalFactor
The conformal factor that rescales the spatial metric .
Definition: Tags.hpp:21
Xcts::Geometry::Curved
@ Curved
The conformal geometry is either curved or employs curved coordinates, so non-vanishing Christoffel s...
Xcts::Tags::LongitudinalShiftMinusDtConformalMetricOverLapseSquare
The conformal longitudinal operator applied to the shift vector minus the time derivative of the conf...
Definition: Tags.hpp:181
Xcts::Equations::HamiltonianLapseAndShift
@ HamiltonianLapseAndShift
The full XCTS equations, solved for , and .
Xcts::Sources
The sources for the first-order formulation of the XCTS equations.
Definition: FluxesAndSources.hpp:164
Tags::div
Prefix indicating the divergence.
Definition: Divergence.hpp:44
Xcts::LinearizedSources
The linearization of the sources for the first-order formulation of the XCTS equations.
Definition: FluxesAndSources.hpp:441
Tags::EuclideanMagnitude
Definition: Magnitude.hpp:109
cstddef
Xcts::Tags::ShiftStrain
The symmetric "strain" of the shift vector .
Definition: Tags.hpp:125
Xcts::Tags::ShiftExcess
The dynamic part of the shift .
Definition: Tags.hpp:93
elliptic::BoundaryConditions::BoundaryCondition
Base class for boundary conditions for elliptic systems.
Definition: BoundaryCondition.hpp:91
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
Tags::NonEuclideanMagnitude
Definition: Magnitude.hpp:124
Xcts::Tags::ShiftBackground
The constant part of the shift .
Definition: Tags.hpp:74
Xcts::Equations
Equations
Indicates a subset of the XCTS equations.
Definition: FluxesAndSources.hpp:24
Xcts::Fluxes
The fluxes for the first-order formulation of the XCTS equations.
Definition: FluxesAndSources.hpp:39
Xcts::Geometry::FlatCartesian
@ FlatCartesian
Euclidean (flat) manifold with Cartesian coordinates, i.e. the conformal metric has components in th...
Tags::dt
Prefix indicating a time derivative.
Definition: Prefixes.hpp:29
Xcts::Tags::LongitudinalShiftExcess
The conformal longitudinal operator applied to the shift excess .
Definition: Tags.hpp:138
gr::Tags::MomentumDensity
The spatial momentum density , where denotes the normal to the spatial hypersurface.
Definition: Tags.hpp:156
Xcts::Tags::ConformalChristoffelFirstKind
The Christoffel symbols of the first kind related to the conformal metric .
Definition: Tags.hpp:203
Xcts::Tags::LongitudinalShiftMinusDtConformalMetricSquare
The conformal longitudinal operator applied to the shift vector minus the time derivative of the conf...
Definition: Tags.hpp:169
Xcts::Geometry
Geometry
Types of conformal geometries for the XCTS equations.
Definition: Geometry.hpp:8
db::wrap_tags_in
tmpl::transform< TagList, tmpl::bind< Wrapper, tmpl::_1, tmpl::pin< Args >... > > wrap_tags_in
Create a new tmpl::list of tags by wrapping each tag in TagList in Wrapper<_, Args....
Definition: PrefixHelpers.hpp:30
Tags::deriv
Prefix indicating spatial derivatives.
Definition: PartialDerivatives.hpp:52
PartialDerivatives.hpp
Xcts::Equations::Hamiltonian
@ Hamiltonian
Only the Hamiltonian constraint, solved for .
Xcts::Tags::LongitudinalShiftBackgroundMinusDtConformalMetric
The conformal longitudinal operator applied to the background shift vector minus the time derivative ...
Definition: Tags.hpp:158
Prefixes.hpp
Xcts::Tags::ShiftDotDerivExtrinsicCurvatureTrace
The shift vector contracted with the gradient of the trace of the extrinsic curvature: .
Definition: Tags.hpp:194
TMPL.hpp
Xcts::Tags::ConformalRicciScalar
The Ricci scalar related to the conformal metric .
Definition: Tags.hpp:240