FixConservativesAndComputePrims.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "Evolution/Systems/GrMhd/ValenciaDivClean/FixConservatives.hpp"
10 #include "Evolution/Systems/GrMhd/ValenciaDivClean/System.hpp"
11 #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp"
12 #include "Evolution/VariableFixing/Tags.hpp"
13 #include "PointwiseFunctions/GeneralRelativity/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 namespace gsl {
24 template <typename T>
25 class not_null;
26 } // namespace gsl
27 template <typename TagsList>
28 class Variables;
29 /// \endcond
30 
32 /*!
33  * \brief Fix the conservative variables and compute the primitive variables.
34  *
35  * Sets `ValenciaDivClean::Tags::VariablesNeededFixing` to `true` if the
36  * conservative variables needed fixing, otherwise sets the tag to `false`.
37  */
38 template <typename OrderedListOfRecoverySchemes>
40  using return_tags = tmpl::list<ValenciaDivClean::Tags::VariablesNeededFixing,
41  typename System::variables_tag,
43  using argument_tags = tmpl::list<
49 
50  template <size_t ThermodynamicDim>
51  static void apply(
52  gsl::not_null<bool*> needed_fixing,
54  gsl::not_null<Variables<hydro::grmhd_tags<DataVector>>*>
55  primitive_vars_ptr,
56  const grmhd::ValenciaDivClean::FixConservatives& fix_conservatives,
58  const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric,
59  const tnsr::II<DataVector, 3, Frame::Inertial>& inv_spatial_metric,
60  const Scalar<DataVector>& sqrt_det_spatial_metric) noexcept;
61 };
62 } // 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::Variables
Definition: VariablesTag.hpp:21
grmhd::ValenciaDivClean::Tags::VariablesNeededFixing
Set to true if the variables needed fixing.
Definition: Tags.hpp:62
cstddef
grmhd::ValenciaDivClean::subcell::FixConservativesAndComputePrims
Fix the conservative variables and compute the primitive variables.
Definition: FixConservativesAndComputePrims.hpp:39
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
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.
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::FixConservatives
Fix conservative variables using method developed by Foucart.
Definition: FixConservatives.hpp:99
Tags::VariableFixer
The global cache tag for the variable fixer.
Definition: Tags.hpp:42
gr::Tags::SqrtDetSpatialMetric
Definition: Tags.hpp:44