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/GrMhd/ValenciaDivClean/Tags.hpp"
14 #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.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 /// \endcond
31 
33 /*!
34  * \brief Mutator that resizes the primitive variables to the subcell mesh and
35  * computes the primitives, but only if
36  * `evolution::dg::subcell::Tags::DidRollback` is `true`.
37  *
38  * In the DG-subcell `step_actions` list this will normally be called using the
39  * `::Actions::MutateApply` action in the following way in the action list:
40  * - `Actions::Label<Labels::BeginSubcellAfterDgRollback>`
41  * - `Actions::MutateApply<grmhd::ValenciaDivClean::subcell::SwapGrTags>`
42  * - `Actions::MutateApply<PrimsAfterRollback<primitive_recovery_schemes>>`
43  * Note that the GR tags are swapped to the subcell grid before this action is
44  * called.
45  */
46 template <typename OrderedListOfRecoverySchemes>
48  using return_tags =
49  tmpl::list<::Tags::Variables<hydro::grmhd_tags<DataVector>>>;
50  using argument_tags =
61 
62  template <size_t ThermodynamicDim>
63  static void apply(
64  gsl::not_null<Variables<hydro::grmhd_tags<DataVector>>*> prim_vars,
65  bool did_rollback, const Mesh<3>& dg_mesh, const Mesh<3>& subcell_mesh,
66  const Scalar<DataVector>& tilde_d, const Scalar<DataVector>& tilde_tau,
67  const tnsr::i<DataVector, 3, Frame::Inertial>& tilde_s,
68  const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
69  const Scalar<DataVector>& tilde_phi,
70  const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric,
71  const tnsr::II<DataVector, 3, Frame::Inertial>& inv_spatial_metric,
72  const Scalar<DataVector>& sqrt_det_spatial_metric,
74  eos) noexcept;
75 };
76 } // namespace grmhd::ValenciaDivClean::subcell
EquationsOfState
Contains all equations of state, including base class.
Definition: DarkEnergyFluid.hpp:26
gr::Tags::SpatialMetric
Definition: Tags.hpp:26
EquationsOfState::EquationOfState
Base class for equations of state depending on whether or not the system is relativistic,...
Definition: EquationOfState.hpp:63
grmhd::ValenciaDivClean::subcell
Code required by the DG-subcell/FD hybrid solver.
Definition: ComputeFluxes.hpp:11
Tags.hpp
domain::Tags::Mesh
The computational grid of the Element in the DataBox.
Definition: Tags.hpp:107
cstddef
grmhd::ValenciaDivClean::Tags::TildeS
The densitized momentum density .
Definition: Tags.hpp:42
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
grmhd::ValenciaDivClean::subcell::PrimsAfterRollback
Mutator that resizes the primitive variables to the subcell mesh and computes the primitives,...
Definition: PrimsAfterRollback.hpp:47
evolution::dg::subcell::Tags::Mesh
The mesh on the subcells.
Definition: Mesh.hpp:19
grmhd::ValenciaDivClean::Tags::TildeB
The densitized magnetic field .
Definition: Tags.hpp:49
Mesh
Holds the number of grid points, basis, and quadrature in each direction of the computational grid.
Definition: Mesh.hpp:49
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
gr::spatial_metric
tnsr::ii< DataType, SpatialDim, Frame > spatial_metric(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute spatial metric from spacetime metric.
grmhd::ValenciaDivClean::Tags::TildeD
The densitized rest-mass density .
Definition: Tags.hpp:31
grmhd::ValenciaDivClean::Tags::TildePhi
The densitized divergence-cleaning field .
Definition: Tags.hpp:55
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
TMPL.hpp
gr::Tags::InverseSpatialMetric
Inverse of the spatial metric.
Definition: Tags.hpp:33
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13
grmhd::ValenciaDivClean::Tags::TildeTau
The densitized energy density .
Definition: Tags.hpp:36
gr::Tags::SqrtDetSpatialMetric
Definition: Tags.hpp:44