ConservativeFromPrimitive.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 
10 /// \cond
11 namespace gsl {
12 template <typename T>
13 class not_null;
14 } // namespace gsl
15 /// \endcond
16 
17 namespace NewtonianEuler {
18 
19 /*!
20  * \brief Compute the conservative variables from the primitive variables.
21  *
22  * \f{align*}
23  * S^i &= \rho v^i \\
24  * e &= \dfrac{1}{2}\rho v^2 + \rho\epsilon
25  * \f}
26  *
27  * where \f$S^i\f$ is the momentum density, \f$e\f$ is the energy density,
28  * \f$\rho\f$ is the mass density, \f$v^i\f$ is the velocity, \f$v^2\f$ is its
29  * magnitude squared, and \f$\epsilon\f$ is the specific internal energy.
30  */
31 template <size_t Dim, typename DataType>
33  gsl::not_null<tnsr::I<DataType, Dim>*> momentum_density,
34  gsl::not_null<Scalar<DataType>*> energy_density,
35  const Scalar<DataType>& mass_density,
36  const tnsr::I<DataType, Dim>& velocity,
37  const Scalar<DataType>& specific_internal_energy) noexcept;
38 
39 } // namespace NewtonianEuler
Implementations from the Guideline Support Library.
Definition: ConservativeFromPrimitive.hpp:10
Defines a list of useful type aliases for tensors.
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
void conservative_from_primitive(gsl::not_null< tnsr::I< DataType, Dim > *> momentum_density, gsl::not_null< Scalar< DataType > *> energy_density, const Scalar< DataType > &mass_density, const tnsr::I< DataType, Dim > &velocity, const Scalar< DataType > &specific_internal_energy) noexcept
Compute the conservative variables from the primitive variables.
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12
Items related to evolving the Newtonian Euler system.
Definition: Characteristics.hpp:17