From 6bf0c9482d152c67bc39f64d41ee99114a45953c Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Mon, 17 Dec 2018 16:10:16 +0100 Subject: [PATCH] Upgrade the function signature of the internal energy getters in the Pressure-Energy MM scheme. --- src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h b/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h index 900a1ed55c..428e1415f3 100644 --- a/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h +++ b/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h @@ -50,22 +50,26 @@ #include <float.h> /** - * @brief Returns the comoving internal energy of a particle + * @brief Returns the comoving internal energy of a particle at the last + * time the particle was kicked. * * For implementations where the main thermodynamic variable * is not internal energy, this function computes the internal * energy from the thermodynamic variable. * * @param p The particle of interest + * @param xp The extended data of the particle of interest. */ __attribute__((always_inline)) INLINE static float -hydro_get_comoving_internal_energy(const struct part *restrict p) { +hydro_get_comoving_internal_energy(const struct part *restrict p, + const struct xpart *restrict xp) { - return p->u; + return xp->u_full; } /** - * @brief Returns the physical internal energy of a particle + * @brief Returns the physical internal energy of a particle at the last + * time the particle was kicked. * * For implementations where the main thermodynamic variable * is not internal energy, this function computes the internal @@ -73,13 +77,15 @@ hydro_get_comoving_internal_energy(const struct part *restrict p) { * physical coordinates. * * @param p The particle of interest. + * @param xp The extended data of the particle of interest. * @param cosmo The cosmological model. */ __attribute__((always_inline)) INLINE static float hydro_get_physical_internal_energy(const struct part *restrict p, + const struct xpart *restrict xp, const struct cosmology *cosmo) { - return p->u * cosmo->a_factor_internal_energy; + return xp->u_full * cosmo->a_factor_internal_energy; } /** -- GitLab