ResizeAndComputePrimitives.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/VariablesTag.hpp"
10 #include "Domain/Tags.hpp"
11 #include "Evolution/DgSubcell/ActiveGrid.hpp"
12 #include "Evolution/DgSubcell/Tags/ActiveGrid.hpp"
13 #include "Evolution/DgSubcell/Tags/Mesh.hpp"
14 #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
15 #include "PointwiseFunctions/Hydro/Tags.hpp"
16 #include "Utilities/TMPL.hpp"
17 
18 /// \cond
19 class DataVector;
20 namespace EquationsOfState {
21 template <bool IsRelativistic, size_t ThermodynamicDim>
22 class EquationOfState;
23 } // namespace EquationsOfState
24 template <size_t Dim>
25 class Mesh;
26 namespace gsl {
27 template <typename T>
28 class not_null;
29 } // namespace gsl
30 template <typename TagsList>
31 class Variables;
32 /// \endcond
33 
34 namespace NewtonianEuler::subcell {
35 /*!
36  * \brief Mutator that resizes the primitive variables to have the size of the
37  * active mesh and then computes the primitive variables on the active mesh.
38  *
39  * In the DG-subcell `step_actions` list this will normally be called using the
40  * `::Actions::MutateApply` action right after the
41  * `evolution::dg::subcell::Actions::TciAndSwitchToDg` action. We only need to
42  * compute the primitives if we switched to the DG grid because otherwise we
43  * computed the primitives during the FD TCI. After the primitive variables tag
44  * is resized for the DG grid, the primitives are computed directly on the DG
45  * grid from the reconstructed conserved variables, not via a reconstruction
46  * operation applied to the primitives.
47  */
48 template <size_t Dim>
50  private:
56 
57  public:
58  using return_tags = tmpl::list<::Tags::Variables<
59  tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>>;
60  using argument_tags =
66 
67  template <size_t ThermodynamicDim>
68  static void apply(
69  gsl::not_null<Variables<
70  tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>*>
71  prim_vars,
72  evolution::dg::subcell::ActiveGrid active_grid, const Mesh<Dim>& dg_mesh,
73  const Mesh<Dim>& subcell_mesh,
74  const Scalar<DataVector>& mass_density_cons,
75  const tnsr::I<DataVector, Dim>& momentum_density,
76  const Scalar<DataVector>& energy_density,
78  equation_of_state) noexcept;
79 };
80 } // namespace NewtonianEuler::subcell
EquationsOfState
Contains all equations of state, including base class.
Definition: DarkEnergyFluid.hpp:26
EquationsOfState::EquationOfState
Base class for equations of state depending on whether or not the system is relativistic,...
Definition: EquationOfState.hpp:63
Tags.hpp
NewtonianEuler::Tags::MassDensity
The mass density of the fluid.
Definition: Tags.hpp:26
Tags::Variables
Definition: VariablesTag.hpp:21
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::Tags::MassDensityCons
The mass density of the fluid (as a conservative variable).
Definition: Tags.hpp:31
NewtonianEuler::subcell
Code required by the DG-subcell/FD hybrid solver.
Definition: InitialDataTci.hpp:22
evolution::dg::subcell::ActiveGrid
ActiveGrid
Definition: ActiveGrid.hpp:11
cstddef
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
NewtonianEuler::Tags::Pressure
The fluid pressure.
Definition: Tags.hpp:66
NewtonianEuler::Tags::EnergyDensity
The energy density of the fluid.
Definition: Tags.hpp:45
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::MomentumDensity
The momentum density of the fluid.
Definition: Tags.hpp:37
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
TypeAliases.hpp
hydro::Tags::EquationOfStateBase
Base tag for the equation of state.
Definition: Tags.hpp:53
NewtonianEuler::Tags::Velocity
The macroscopic or flow velocity of the fluid.
Definition: Tags.hpp:51
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecPiecewisePolynomial.hpp:11
NewtonianEuler::subcell::ResizeAndComputePrims
Mutator that resizes the primitive variables to have the size of the active mesh and then computes th...
Definition: ResizeAndComputePrimitives.hpp:49
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13