diff --git a/src/cell.c b/src/cell.c index 77e5d3fe596c027b3304dbe84fe91ec2cc8bbe10..d685a69d477cc9bc9641f296b3aadd98abb9ed56 100644 --- a/src/cell.c +++ b/src/cell.c @@ -3480,8 +3480,8 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) { (p->x[1] > dim[1]) || (p->x[1] < 0.) || // y (p->x[2] > dim[2]) || (p->x[2] < 0.)) { // z - /* Print the particle's data */ - printParticle_single(p, xp); + /* One last action before death? */ + hydro_remove_part(p, xp); /* Remove the particle entirely */ struct gpart *gp = p->gpart; diff --git a/src/hydro/Default/hydro.h b/src/hydro/Default/hydro.h index 4252f2787aefcec058b8fa956eaa0351b8f41d57..b4dc25495ab5be3c2e9c5ba0153e748a344f050f 100644 --- a/src/hydro/Default/hydro.h +++ b/src/hydro/Default/hydro.h @@ -674,4 +674,14 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { p->u = u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part *p, const struct xpart *xp) {} + #endif /* SWIFT_DEFAULT_HYDRO_H */ diff --git a/src/hydro/Gadget2/hydro.h b/src/hydro/Gadget2/hydro.h index e16d41a8b4fc50d07f5cac7dd39e8d245bed9923..77c4b5dd61b7ff9b84242df61f503fb42b472952 100644 --- a/src/hydro/Gadget2/hydro.h +++ b/src/hydro/Gadget2/hydro.h @@ -779,4 +779,14 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { p->entropy = u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part *p, const struct xpart *xp) {} + #endif /* SWIFT_GADGET2_HYDRO_H */ diff --git a/src/hydro/GizmoMFM/hydro.h b/src/hydro/GizmoMFM/hydro.h index 1ce17d76f1814ec9b8d02ccbb73006748545e1e7..b00a3578d02f492050c328af49a6108d566e9204 100644 --- a/src/hydro/GizmoMFM/hydro.h +++ b/src/hydro/GizmoMFM/hydro.h @@ -1008,4 +1008,14 @@ hydro_set_init_internal_energy(struct part* p, float u_init) { p->P = hydro_gamma_minus_one * p->rho * u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part* p, const struct xpart* xp) {} + #endif /* SWIFT_GIZMO_MFM_HYDRO_H */ diff --git a/src/hydro/GizmoMFV/hydro.h b/src/hydro/GizmoMFV/hydro.h index 77db9e3a01f1cfe6a4d3211726cfd9fe30e87cf4..284b67b3b62cd7c6b75de192b299c0c48d170a05 100644 --- a/src/hydro/GizmoMFV/hydro.h +++ b/src/hydro/GizmoMFV/hydro.h @@ -1082,4 +1082,14 @@ hydro_set_init_internal_energy(struct part* p, float u_init) { p->primitives.P = hydro_gamma_minus_one * p->primitives.rho * u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part* p, const struct xpart* xp) {} + #endif /* SWIFT_GIZMO_MFV_HYDRO_H */ diff --git a/src/hydro/Minimal/hydro.h b/src/hydro/Minimal/hydro.h index 93a2b3ec8ed4ecb6dcc73314233217d37141ba46..d638c168f23c95dc3010f838846f4dfc0522bee5 100644 --- a/src/hydro/Minimal/hydro.h +++ b/src/hydro/Minimal/hydro.h @@ -769,4 +769,14 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { p->u = u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part *p, const struct xpart *xp) {} + #endif /* SWIFT_MINIMAL_HYDRO_H */ diff --git a/src/hydro/Planetary/hydro.h b/src/hydro/Planetary/hydro.h index dee65a15758043d2cf526ea889b993c694d5dab4..667bc9e29788c779bf65de0754ff30b1a997a6c8 100644 --- a/src/hydro/Planetary/hydro.h +++ b/src/hydro/Planetary/hydro.h @@ -37,6 +37,7 @@ #include "adiabatic_index.h" #include "approx_math.h" #include "cosmology.h" +#include "debug.h" #include "dimension.h" #include "equation_of_state.h" #include "hydro_properties.h" @@ -765,4 +766,17 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { p->u = u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part *p, const struct xpart *xp) { + + printParticle_single(p, xp); +} + #endif /* SWIFT_PLANETARY_HYDRO_H */ diff --git a/src/hydro/PressureEnergy/hydro.h b/src/hydro/PressureEnergy/hydro.h index 4c3cc5c1c588e19de0d4833fc867ae9c0aed1209..8dd43cd72968f89cfc818342d618688f2f39cbd3 100644 --- a/src/hydro/PressureEnergy/hydro.h +++ b/src/hydro/PressureEnergy/hydro.h @@ -792,4 +792,14 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { p->u = u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part *p, const struct xpart *xp) {} + #endif /* SWIFT_MINIMAL_HYDRO_H */ diff --git a/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h b/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h index 060694a6afa850c4d4815899fde1450316da81f5..deb013579fd33340236d3dd5817021fd100c0fcb 100644 --- a/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h +++ b/src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h @@ -763,4 +763,14 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { p->u = u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part *p, const struct xpart *xp) {} + #endif /* SWIFT_PRESSURE_ENERGY_MORRIS_HYDRO_H */ diff --git a/src/hydro/PressureEntropy/hydro.h b/src/hydro/PressureEntropy/hydro.h index b16d24cfcee9407c8213b1e17465005884da6617..38e0f66fe7ecc1b6497717c9754bc36cd10a66f7 100644 --- a/src/hydro/PressureEntropy/hydro.h +++ b/src/hydro/PressureEntropy/hydro.h @@ -760,4 +760,14 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { p->entropy = u_init; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part *p, const struct xpart *xp) {} + #endif /* SWIFT_PRESSURE_ENTROPY_HYDRO_H */ diff --git a/src/hydro/Shadowswift/hydro.h b/src/hydro/Shadowswift/hydro.h index 7e38aa6b57f383564e96d9fea24730926c0ac70b..446219104dffb2939877ae2a7c782e66af153213 100644 --- a/src/hydro/Shadowswift/hydro.h +++ b/src/hydro/Shadowswift/hydro.h @@ -847,4 +847,14 @@ __attribute__((always_inline)) INLINE static float hydro_get_physical_density( return cosmo->a3_inv * p->primitives.rho; } +/** + * @brief Operations performed when a particle gets removed from the + * simulation volume. + * + * @param p The particle. + * @param xp The extended particle data. + */ +__attribute__((always_inline)) INLINE static void hydro_remove_part( + const struct part* p, const struct xpart* xp) {} + #endif /* SWIFT_SHADOWSWIFT_HYDRO_H */