KineticEnergyDensity.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
8 #include "DataStructures/DataBox/Tag.hpp"
10 #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
11 #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp"
12 #include "PointwiseFunctions/Hydro/Tags.hpp"
13 #include "Utilities/Gsl.hpp"
14 #include "Utilities/TMPL.hpp"
15 
16 namespace NewtonianEuler {
17 //@{
18 /*!
19  * Compute the kinetic energy density, \f$\rho v^2/2\f$,
20  * where \f$\rho\f$ is the mass density, and \f$v\f$ is the
21  * magnitude of the velocity.
22  */
23 template <typename DataType, size_t Dim, typename Fr>
26  const Scalar<DataType>& mass_density,
27  const tnsr::I<DataType, Dim, Fr>& velocity) noexcept;
28 
29 template <typename DataType, size_t Dim, typename Fr>
31  const Scalar<DataType>& mass_density,
32  const tnsr::I<DataType, Dim, Fr>& velocity) noexcept;
33 //@}
34 
35 namespace Tags {
36 /// Compute item for the kinetic energy density, \f$\rho v^2/2\f$.
37 /// \see NewtonianEuler::kinetic_energy_density
38 ///
39 /// Can be retrieved using `NewtonianEuler::Tags::KineticEnergyDensity`
40 template <typename DataType, size_t Dim, typename Fr = Frame::Inertial>
44 
45  using argument_tags =
46  tmpl::list<MassDensity<DataType>, Velocity<DataType, Dim, Fr>>;
47 
48  using return_type = Scalar<DataType>;
49 
50  static constexpr auto function = static_cast<void (*)(
52  const tnsr::I<DataType, Dim, Fr>&)>(
53  &kinetic_energy_density<DataType, Dim, Fr>);
54 };
55 } // namespace Tags
56 } // namespace NewtonianEuler
db::ComputeTag
Mark a struct as a compute tag by inheriting from this.
Definition: Tag.hpp:157
NewtonianEuler::kinetic_energy_density
void kinetic_energy_density(gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &mass_density, const tnsr::I< DataType, Dim, Fr > &velocity) noexcept
NewtonianEuler
Items related to evolving the Newtonian Euler system.
Definition: EvolveNewtonianEulerFwd.hpp:8
NewtonianEuler::Tags::KineticEnergyDensityCompute
Compute item for the kinetic energy density, .
Definition: KineticEnergyDensity.hpp:41
cstddef
NewtonianEuler::Tags::KineticEnergyDensity
The kinetic energy density.
Definition: Tags.hpp:110
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
Tensor.hpp
NewtonianEuler::Tags::Velocity
The macroscopic or flow velocity of the fluid.
Definition: Tags.hpp:51
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13