PrimitiveGhostData.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
8 #include "DataStructures/VariablesTag.hpp"
9 #include "Domain/Tags.hpp"
10 #include "Evolution/DgSubcell/Tags/Mesh.hpp"
11 #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
12 #include "Utilities/TMPL.hpp"
13 
14 /// \cond
15 template <size_t Dim>
16 class Mesh;
17 template <typename TagsList>
18 class Variables;
19 /// \endcond
20 
21 namespace NewtonianEuler::subcell {
22 /*!
23  * \brief Computes the mass density, velocity, and pressure on the subcells so
24  * they can be sent to the neighbors for their reconstructions.
25  *
26  * The computation just copies the data from the primitive variables tag to a
27  * new Variables (the copy is subcell grid to subcell grid). In the future we
28  * will likely want to elide this copy but that requires support from the
29  * actions.
30  *
31  * This mutator is passed to
32  * `evolution::dg::subcell::Actions::SendDataForReconstruction`.
33  */
34 template <size_t Dim>
36  private:
42 
43  using prim_tags =
44  tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>;
45  using prims_to_reconstruct_tags = tmpl::list<MassDensity, Velocity, Pressure>;
46 
47  public:
48  using return_tags = tmpl::list<>;
49  using argument_tags = tmpl::list<::Tags::Variables<prim_tags>>;
50 
51  static Variables<prims_to_reconstruct_tags> apply(
52  const Variables<prim_tags>& prims) noexcept;
53 };
54 
55 /*!
56  * \brief Projects the mass density, velocity, and pressure to the subcells so
57  * they can be sent to the neighbors for their reconstructions.
58  *
59  * Computes the data on the subcells that other generic code will slice before
60  * sending it to the neighbors. That is, a `ghost_zone_size * y_points *
61  * z_points` is sent to the `x`-direction neighbors.
62  *
63  * The computation just copies the data from the primitive variables tag to a
64  * new Variables, then projects that Variables to the subcells. In the future
65  * we will likely want to elide this copy but that requires support from the
66  * actions.
67  *
68  * This mutator is what `Metavars::SubcellOptions::GhostDataToSlice` must be set
69  * to.
70  *
71  * \note This projects the primitive variables rather than computing them on the
72  * subcells. This introduces truncation level errors, but from tests so far this
73  * seems to be fine and is what is done with local time stepping ADER-DG.
74  */
75 template <size_t Dim>
77  private:
83 
84  using prim_tags =
85  tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>;
86  using prims_to_reconstruct_tags = tmpl::list<MassDensity, Velocity, Pressure>;
87 
88  public:
89  using return_tags = tmpl::list<>;
90  using argument_tags =
91  tmpl::list<::Tags::Variables<prim_tags>, domain::Tags::Mesh<Dim>,
93 
94  static Variables<prims_to_reconstruct_tags> apply(
95  const Variables<prim_tags>& prims, const Mesh<Dim>& dg_mesh,
96  const Mesh<Dim>& subcell_mesh) noexcept;
97 };
98 } // namespace NewtonianEuler::subcell
Tags.hpp
NewtonianEuler::Tags::MassDensity
The mass density of the fluid.
Definition: Tags.hpp:26
NewtonianEuler::Tags::SpecificInternalEnergy
The specific internal energy of the fluid.
Definition: Tags.hpp:60
domain::Tags::Mesh
The computational grid of the Element in the DataBox.
Definition: Tags.hpp:107
NewtonianEuler::subcell
Code required by the DG-subcell/FD hybrid solver.
Definition: InitialDataTci.hpp:22
NewtonianEuler::subcell::PrimitiveGhostDataToSlice
Projects the mass density, velocity, and pressure to the subcells so they can be sent to the neighbor...
Definition: PrimitiveGhostData.hpp:76
NewtonianEuler::subcell::PrimitiveGhostDataOnSubcells
Computes the mass density, velocity, and pressure on the subcells so they can be sent to the neighbor...
Definition: PrimitiveGhostData.hpp:35
cstddef
NewtonianEuler::Tags::Pressure
The fluid pressure.
Definition: Tags.hpp:66
evolution::dg::subcell::Tags::Mesh
The mesh on the subcells.
Definition: Mesh.hpp:19
Mesh
Holds the number of grid points, basis, and quadrature in each direction of the computational grid.
Definition: Mesh.hpp:49
NewtonianEuler::Tags::Velocity
The macroscopic or flow velocity of the fluid.
Definition: Tags.hpp:51
TMPL.hpp