diff --git a/src/hydro/AnarchyPU/hydro.h b/src/hydro/AnarchyPU/hydro.h index 27501944c8afd6cd316717158057086a8f6ffd4e..9bb53f290acb16b4f9efc44e430a78a6d1f5c5ff 100644 --- a/src/hydro/AnarchyPU/hydro.h +++ b/src/hydro/AnarchyPU/hydro.h @@ -362,6 +362,23 @@ hydro_set_physical_internal_energy_dt(struct part *restrict p, p->u_dt = du_dt / cosmo->a_factor_internal_energy; } +/** + * @brief Sets the physical entropy of a particle + * + * @param p The particle of interest. + * @param xp The extended particle data. + * @param cosmo Cosmology data structure + * @param entropy The physical entropy + */ +__attribute__((always_inline)) INLINE static void hydro_set_physical_entropy( + struct part *p, struct xpart *xp, const struct cosmology *cosmo, + const float entropy) { + + /* Note there is no conversion from physical to comoving entropy */ + const float comoving_entropy = entropy; + xp->u_full = gas_internal_energy_from_entropy(p->rho, comoving_entropy); +} + /** * @brief Computes the hydro time-step of a given particle * diff --git a/src/hydro/AnarchyPU/hydro_part.h b/src/hydro/AnarchyPU/hydro_part.h index e25ca4426376576157390e7da6d5bb69b22c9418..9ddd54b67b0517f5bc37edc7061fa8d5c3072c54 100644 --- a/src/hydro/AnarchyPU/hydro_part.h +++ b/src/hydro/AnarchyPU/hydro_part.h @@ -33,6 +33,8 @@ #include "chemistry_struct.h" #include "cooling_struct.h" +#include "sftracers_struct.h" +#include "tracers_struct.h" /** * @brief Particle fields not needed during the SPH loops over neighbours. @@ -61,6 +63,12 @@ struct xpart { /*! Additional data used to record cooling information */ struct cooling_xpart_data cooling_data; + /* Additional data used by the tracers */ + struct tracers_xpart_data tracers_data; + + /* Additional data used by the tracers */ + struct sftracers_xpart_data sftracers_data; + } SWIFT_STRUCT_ALIGN; /**