PrimsAfterRollback.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/Tags/DidRollback.hpp"
12 #include "Evolution/DgSubcell/Tags/Mesh.hpp"
13 #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
14 #include "PointwiseFunctions/Hydro/Tags.hpp"
15 #include "Utilities/TMPL.hpp"
16 
17 /// \cond
18 class DataVector;
19 namespace EquationsOfState {
20 template <bool IsRelativistic, size_t ThermodynamicDim>
21 class EquationOfState;
22 } // namespace EquationsOfState
23 template <size_t Dim>
24 class Mesh;
25 namespace gsl {
26 template <typename T>
27 class not_null;
28 } // namespace gsl
29 template <typename TagsList>
30 class Variables;
31 /// \endcond
32 
33 namespace NewtonianEuler::subcell {
34 /*!
35  * \brief Mutator that resizes the primitive variables to the subcell mesh and
36  * computes the primitives, but only if
37  * `evolution::dg::subcell::Tags::DidRollback` is `true`.
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::Labels::BeginSubcellAfterDgRollback` label.
42  */
43 template <size_t Dim>
45  private:
51 
52  public:
53  using return_tags = tmpl::list<::Tags::Variables<
54  tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>>;
55  using argument_tags =
60 
61  template <size_t ThermodynamicDim>
62  static void apply(
63  gsl::not_null<Variables<
64  tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>*>
65  prim_vars,
66  bool did_rollback, const Mesh<Dim>& subcell_mesh,
67  const Scalar<DataVector>& mass_density_cons,
68  const tnsr::I<DataVector, Dim>& momentum_density,
69  const Scalar<DataVector>& energy_density,
71  equation_of_state) noexcept;
72 };
73 } // 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
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
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
evolution::dg::subcell::Tags::DidRollback
Tag indicating whether we are retrying a step after a rollback of a failed DG step.
Definition: DidRollback.hpp:16
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecPiecewisePolynomial.hpp:11
NewtonianEuler::subcell::PrimsAfterRollback
Mutator that resizes the primitive variables to the subcell mesh and computes the primitives,...
Definition: PrimsAfterRollback.hpp:44
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13