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/DataBox/Tag.hpp"
9 : #include "DataStructures/Tensor/Tensor.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 internal energy density, \f$\rho \epsilon\f$,
20 : * where \f$\rho\f$ is the mass density, and \f$\epsilon\f$ is the
21 : * specific internal energy.
22 : */
23 : template <typename DataType>
24 1 : void internal_energy_density(gsl::not_null<Scalar<DataType>*> result,
25 : const Scalar<DataType>& mass_density,
26 : const Scalar<DataType>& specific_internal_energy);
27 :
28 : template <typename DataType>
29 1 : Scalar<DataType> internal_energy_density(
30 : const Scalar<DataType>& mass_density,
31 : const Scalar<DataType>& specific_internal_energy);
32 : /// @}
33 :
34 : namespace Tags {
35 : /// Compute item for the internal energy density, \f$\rho \epsilon\f$.
36 : /// \see NewtonianEuler::internal_energy_density
37 : ///
38 : /// Can be retrieved using `NewtonianEuler::Tags::InternalEnergyDensity`
39 : template <typename DataType>
40 1 : struct InternalEnergyDensityCompute : InternalEnergyDensity<DataType>,
41 : db::ComputeTag {
42 0 : using base = InternalEnergyDensity<DataType>;
43 :
44 0 : using argument_tags =
45 : tmpl::list<hydro::Tags::RestMassDensity<DataType>,
46 : hydro::Tags::SpecificInternalEnergy<DataType>>;
47 :
48 0 : using return_type = Scalar<DataType>;
49 :
50 0 : static constexpr auto function =
51 : static_cast<void (*)(const gsl::not_null<Scalar<DataType>*>,
52 : const Scalar<DataType>&, const Scalar<DataType>&)>(
53 : &internal_energy_density<DataType>);
54 : };
55 : } // namespace Tags
56 : } // namespace NewtonianEuler
|