PrimitiveGhostData.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include "DataStructures/VariablesTag.hpp"
7 #include "Domain/Tags.hpp"
8 #include "Evolution/DgSubcell/Tags/Mesh.hpp"
9 #include "PointwiseFunctions/Hydro/Tags.hpp"
10 #include "Utilities/TMPL.hpp"
11 
12 /// \cond
13 class DataVector;
14 template <size_t Dim>
15 class Mesh;
16 template <typename T>
17 class Variables;
18 /// \endcond
19 
21 /*!
22  * \brief Computes the rest mass density \f$\rho\f$, pressure \f$p\f$,
23  * Lorentz factor times the spatial velocity \f$W v^i\f$, magnetic field
24  * \f$B^i\f$, and the divergence cleaning field \f$\Phi\f$ on the subcells so
25  * they can be used for reconstruction.
26  *
27  * The computation copies the data from the primitive variables to a new
28  * Variables and computes \f$W v^i\f$. In the future we will likely want to
29  * elide this copy but that requires support from the actions.
30  *
31  * This mutator is passed to
32  * `evolution::dg::subcell::Actions::SendDataForReconstruction`.
33  */
35  private:
36  using prims_to_reconstruct_tags =
37  tmpl::list<hydro::Tags::RestMassDensity<DataVector>,
42 
43  public:
44  using return_tags = tmpl::list<>;
45  using argument_tags =
46  tmpl::list<::Tags::Variables<hydro::grmhd_tags<DataVector>>>;
47 
48  static Variables<prims_to_reconstruct_tags> apply(
49  const Variables<hydro::grmhd_tags<DataVector>>& prims) noexcept;
50 };
51 
52 /*!
53  * \brief Projects the rest mass density \f$\rho\f$, pressure \f$p\f$, Lorentz
54  * factor times the spatial velocity \f$W v^i\f$, magnetic field \f$B^i\f$, and
55  * the divergence cleaning field \f$\Phi\f$ so they can be projected to the
56  * subcells and sent to neighbors for subcell reconstruction.
57  *
58  * The computation copies the data from the primitive variables to a new
59  * Variables and computes \f$W v^i\f$, then does the projection. In the future
60  * we will likely want to elide this copy but that requires support from the
61  * actions.
62  *
63  * This mutator is passed what `Metavars::SubcellOptions::GhostDataToSlice` must
64  * be set to.
65  *
66  * \note We are ultimately projecting the primitive variables rather than
67  * computing them on the subcells. This introduces truncation level errors, but
68  * from tests so far this seems to be fine and is what is done with local time
69  * stepping ADER-DG.
70  */
72  private:
73  using prims_to_reconstruct_tags =
74  tmpl::list<hydro::Tags::RestMassDensity<DataVector>,
79 
80  public:
81  using return_tags = tmpl::list<>;
82  using argument_tags =
83  tmpl::list<::Tags::Variables<hydro::grmhd_tags<DataVector>>,
85 
86  static Variables<prims_to_reconstruct_tags> apply(
87  const Variables<hydro::grmhd_tags<DataVector>>& prims,
88  const Mesh<3>& dg_mesh, const Mesh<3>& subcell_mesh) noexcept;
89 };
90 } // namespace grmhd::ValenciaDivClean::subcell
hydro::Tags::Pressure
The fluid pressure .
Definition: Tags.hpp:119
grmhd::ValenciaDivClean::subcell
Code required by the DG-subcell/FD hybrid solver.
Definition: ComputeFluxes.hpp:11
Tags.hpp
hydro::Tags::DivergenceCleaningField
The divergence-cleaning field .
Definition: Tags.hpp:48
domain::Tags::Mesh
The computational grid of the Element in the DataBox.
Definition: Tags.hpp:107
grmhd::ValenciaDivClean::subcell::PrimitiveGhostDataOnSubcells
Computes the rest mass density , pressure , Lorentz factor times the spatial velocity ,...
Definition: PrimitiveGhostData.hpp:34
grmhd::ValenciaDivClean::subcell::PrimitiveGhostDataToSlice
Projects the rest mass density , pressure , Lorentz factor times the spatial velocity ,...
Definition: PrimitiveGhostData.hpp:71
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
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
hydro::Tags::LorentzFactorTimesSpatialVelocity
The Lorentz factor times the spatial velocity .
Definition: Tags.hpp:185
hydro::Tags::MagneticField
The magnetic field measured by an Eulerian observer, where is the normal to the spatial hypersurfac...
Definition: Tags.hpp:80
TMPL.hpp