SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/NewtonianEuler - PrimitiveFromConservative.hpp Hit Total Coverage
Commit: b5f497991094937944b0a3f519166bb54739d08a Lines: 1 5 20.0 %
Date: 2024-03-28 18:20:13
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include <cstddef>
       7             : 
       8             : #include "DataStructures/Tensor/TypeAliases.hpp"
       9             : #include "Evolution/Systems/NewtonianEuler/TagsDeclarations.hpp"
      10             : #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp"
      11             : #include "PointwiseFunctions/Hydro/Tags.hpp"
      12             : #include "Utilities/TMPL.hpp"
      13             : 
      14             : /// \cond
      15             : namespace gsl {
      16             : template <typename T>
      17             : class not_null;
      18             : }  // namespace gsl
      19             : 
      20             : class DataVector;
      21             : /// \endcond
      22             : 
      23             : // IWYU pragma: no_forward_declare Tensor
      24             : 
      25             : namespace NewtonianEuler {
      26             : 
      27             : /*!
      28             :  * \brief Compute the primitive variables from the conservative variables.
      29             :  *
      30             :  * \f{align*}
      31             :  * v^i &= \frac{S^i}{\rho} \\
      32             :  * \epsilon &= \frac{e}{\rho} - \frac{1}{2}\frac{S^2}{\rho^2}
      33             :  * \f}
      34             :  *
      35             :  * where \f$v^i\f$ is the velocity, \f$\epsilon\f$ is the specific
      36             :  * internal energy, \f$e\f$ is the energy density, \f$\rho\f$
      37             :  * is the mass density, \f$S^i\f$ is the momentum density, and
      38             :  * \f$S^2\f$ is the momentum density squared.
      39             :  *
      40             :  * This routine also returns the mass density as a primitive, and the pressure
      41             :  * from a generic equation of state \f$p = p(\rho, \epsilon)\f$.
      42             :  */
      43             : template <size_t Dim>
      44           1 : struct PrimitiveFromConservative {
      45           0 :   using return_tags =
      46             :       tmpl::list<hydro::Tags::RestMassDensity<DataVector>,
      47             :                  hydro::Tags::SpatialVelocity<DataVector, Dim>,
      48             :                  hydro::Tags::SpecificInternalEnergy<DataVector>,
      49             :                  hydro::Tags::Pressure<DataVector>>;
      50             : 
      51           0 :   using argument_tags =
      52             :       tmpl::list<Tags::MassDensityCons, Tags::MomentumDensity<Dim>,
      53             :                  Tags::EnergyDensity, hydro::Tags::EquationOfState<false, 2>>;
      54             : 
      55             :   template <size_t ThermodynamicDim>
      56           0 :   static void apply(
      57             :       gsl::not_null<Scalar<DataVector>*> mass_density,
      58             :       gsl::not_null<tnsr::I<DataVector, Dim>*> velocity,
      59             :       gsl::not_null<Scalar<DataVector>*> specific_internal_energy,
      60             :       gsl::not_null<Scalar<DataVector>*> pressure,
      61             :       const Scalar<DataVector>& mass_density_cons,
      62             :       const tnsr::I<DataVector, Dim>& momentum_density,
      63             :       const Scalar<DataVector>& energy_density,
      64             :       const EquationsOfState::EquationOfState<false, ThermodynamicDim>&
      65             :           equation_of_state);
      66             : };
      67             : }  // namespace NewtonianEuler

Generated by: LCOV version 1.14