FirstOrderSystem.hpp
Go to the documentation of this file.
2 // See LICENSE.txt for details.
3
4 /// \file
5 /// Defines class Poisson::FirstOrderSystem
6
7 #pragma once
8
9 #include <cstddef>
10
11 #include "DataStructures/DataBox/PrefixHelpers.hpp"
12 #include "DataStructures/Tensor/EagerMath/Magnitude.hpp"
13 #include "DataStructures/VariablesTag.hpp"
14 #include "Elliptic/Systems/Poisson/Equations.hpp"
15 #include "Elliptic/Systems/Poisson/Geometry.hpp"
18 #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
19 #include "Utilities/TMPL.hpp"
20
21 namespace Poisson {
22
23 /*!
24  * \brief The Poisson equation formulated as a set of coupled first-order PDEs.
25  *
26  * \details This system formulates the Poisson equation \f$-\Delta_\gamma u(x) = 27 * f(x)\f$ on a background metric \f$\gamma_{ij}\f$ as the set of coupled
28  * first-order PDEs
29  *
30  * \f[
31  * -\frac{1}{\sqrt{\gamma}} \partial_i \sqrt{\gamma}\gamma^{ij} v_j(x) = f(x) \\
32  * -\partial_i u(x) + v_i(x) = 0
33  * \f]
34  *
35  * where we have chosen the field gradient as an auxiliary variable \f$v_i\f$.
36  * This scheme also goes by the name of _mixed_ or _flux_ formulation (see e.g.
37  * \cite Arnold2002). The reason for the latter name is that we can write the
38  * set of coupled first-order PDEs in flux-form
39  *
40  * \f[
41  * -\partial_i F^i_A + S_A = f_A(x)
42  * \f]
43  *
44  * by choosing the fluxes and sources in terms of the system variables
45  * \f$u(x)\f$ and \f$v_i(x)\f$ as
46  *
47  * \f{align*}
48  * F^i_u &= \sqrt{\gamma}\gamma^{ij} v_j(x) \\
49  * S_u &= 0 \\
50  * f_u &= \sqrt{\gamma} f(x) \\
51  * F^i_{v_j} &= u \delta^i_j \\
52  * S_{v_j} &= v_j \\
53  * f_{v_j} &= 0 \text{.}
54  * \f}
55  *
56  * Note that we use the system variables to index the fluxes and sources, which
57  * we also do in the code by using DataBox tags.
58  * Also note that we have defined the _fixed sources_ \f$f_A\f$ as those source
59  * terms that are independent of the system variables.
60  *
61  * The field gradient \f$v_i\f$ is treated on the same footing as the field
62  * \f$u\f$ in this first-order formulation. This allows us to make use of the DG
63  * architecture developed for coupled first-order hyperbolic PDEs in flux-form,
64  * in particular the flux communication and lifting code. It does, however,
65  * introduce auxiliary degrees of freedom that can be avoided in the
66  * second-order (or _primal_) formulation. Furthermore, the linear operator that
67  * represents the DG discretization for this system is not symmetric. This
68  * property further increase the computational cost (see \ref LinearSolverGroup)
69  * and is remedied in the second-order formulation.
70  */
71 template <size_t Dim, Geometry BackgroundGeometry>
73  private:
74  using field = Tags::Field;
77
78  public:
79  static constexpr size_t volume_dim = Dim;
80
81  // The physical fields to solve for
82  using primal_fields = tmpl::list<field>;
84  using fields_tag =
86
87  using fluxes =
88  tmpl::conditional_t<BackgroundGeometry == Geometry::Euclidean,
90  using sources = Sources;
91
92  // The tag of the operator to compute magnitudes on the manifold, e.g. to
93  // normalize vectors on the faces of an element
94  template <typename Tag>
95  using magnitude_tag = tmpl::conditional_t<
96  BackgroundGeometry == Geometry::Euclidean,
100 };
101 } // namespace Poisson
Frame::Inertial
Definition: IndexType.hpp:44
gr::Tags::SpatialMetric
Definition: Tags.hpp:26
Poisson::NonEuclideanFluxes
Compute the fluxes for the curved-space Poisson equation on a spatial metric .
Definition: Equations.hpp:87
Tags::Variables
Definition: VariablesTag.hpp:21
Poisson::Sources
Compute the sources for the Poisson equation.
Definition: Equations.hpp:118
Poisson::FirstOrderSystem
The Poisson equation formulated as a set of coupled first-order PDEs.
Definition: FirstOrderSystem.hpp:72
Tags::EuclideanMagnitude
Definition: Magnitude.hpp:110
cstddef
Poisson::Tags::Field
The scalar field to solve for.
Definition: Tags.hpp:28
Tags::NonEuclideanMagnitude
Definition: Magnitude.hpp:125
Poisson::EuclideanFluxes
Compute the fluxes for the Poisson equation on a flat metric in Cartesian coordinates.
Definition: Equations.hpp:61
Tags::deriv
Prefix indicating spatial derivatives.
Definition: PartialDerivatives.hpp:53
PartialDerivatives.hpp
Poisson
Items related to solving a Poisson equation .
Definition: Equations.cpp:15
TMPL.hpp
Tags.hpp