Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <iosfwd>
7 :
8 : /// \cond
9 : namespace Options {
10 : class Option;
11 : template <typename T>
12 : struct create_from_yaml;
13 : } // namespace Options
14 : /// \endcond
15 :
16 : namespace dg {
17 : /*!
18 : * \ingroup DiscontinuousGalerkinGroup
19 : * \brief The DG formulation to use
20 : *
21 : * - The `StrongInertial` formulation is also known as the integrate then
22 : * transform formulation. The "Inertial" part of the name refers to the fact
23 : * that the integration is done over the physical/inertial coordinates, while
24 : * the "strong" part refers to the fact that the boundary correction terms are
25 : * zero if the solution is continuous at the interfaces.
26 : * See \cite Teukolsky2015ega for an overview.
27 : * - The `WeakInertial` formulation is also known as the integrate then
28 : * transform formulation. The "Inertial" part of the name refers to the fact
29 : * that the integration is done over the physical/inertial coordinates, while
30 : * the "weak" part refers to the fact that the boundary correction terms are
31 : * non-zero even if the solution is continuous at the interfaces.
32 : * See \cite Teukolsky2015ega for an overview.
33 : * - The `StrongLogical` formulation is also known as the transform then
34 : * integrate formulation. The "logical" part of the name refers to the fact
35 : * that the integration is done over the logical coordinates, while the
36 : * "strong" part refers to the fact that the boundary correction terms are
37 : * zero if the solution is continuous at the interfaces. This formulation
38 : * arises from the `StrongInertial` formulation by moving the Jacobians that
39 : * appear when computing the divergence of fluxes into the divergence so the
40 : * divergence is computed in logical coordinates:
41 : * \begin{equation}
42 : * \partial_i F^i = \frac{1}{J} \partial_\hat{\imath} J F^\hat{\imath}
43 : * \end{equation}
44 : * where $J$ is the Jacobian determinant and $\hat{\imath}$ are the logical
45 : * coordinates. This is possible because of the "metric identities"
46 : * \begin{equation}
47 : * \partial_\hat{\imath} \left(J \frac{\partial \xi^\hat{\imath}}
48 : * {\partial x^i}\right) = 0.
49 : * \end{equation}
50 : * See also `dg::metric_identity_det_jac_times_inv_jac` for details and for
51 : * functions that compute the Jacobians so they satisfy the metric identities
52 : * numerically (which may or may not be useful or necessary).
53 : */
54 0 : enum class Formulation { StrongInertial, WeakInertial, StrongLogical };
55 :
56 0 : std::ostream& operator<<(std::ostream& os, Formulation t);
57 : } // namespace dg
58 :
59 : /// \cond
60 : template <>
61 : struct Options::create_from_yaml<dg::Formulation> {
62 : template <typename Metavariables>
63 : static dg::Formulation create(const Options::Option& options) {
64 : return create<void>(options);
65 : }
66 : };
67 :
68 : template <>
69 : dg::Formulation Options::create_from_yaml<dg::Formulation>::create<void>(
70 : const Options::Option& options);
71 : /// \endcond
|