From 3f14010d262cd25f4d0bac8baf3c5c7fb97e212c Mon Sep 17 00:00:00 2001 From: James Willis <james.s.willis@durham.ac.uk> Date: Mon, 11 Dec 2017 14:44:41 +0000 Subject: [PATCH] If the neighbour count goes above NUM_OF_NEIGHBOURS don't log the neighbour id but keep logging the neighbour count. --- src/hydro/Gadget2/hydro_iact.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hydro/Gadget2/hydro_iact.h b/src/hydro/Gadget2/hydro_iact.h index a0cd5bacba..f6d8be0da0 100644 --- a/src/hydro/Gadget2/hydro_iact.h +++ b/src/hydro/Gadget2/hydro_iact.h @@ -110,10 +110,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_density( pi->ids_ngbs_density[pi->num_ngb_density] = pj->id; ++pi->num_ngb_density; } + else ++pi->num_ngb_density; + if(pj->num_ngb_density < NUM_OF_NEIGHBOURS) { pj->ids_ngbs_density[pj->num_ngb_density] = pi->id; ++pj->num_ngb_density; } + else ++pj->num_ngb_density; #endif } @@ -171,6 +174,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density( pi->ids_ngbs_density[pi->num_ngb_density] = pj->id; ++pi->num_ngb_density; } + else ++pi->num_ngb_density; #endif } @@ -503,10 +507,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_force( pi->ids_ngbs_force[pi->num_ngb_force] = pj->id; ++pi->num_ngb_force; } + else ++pi->num_ngb_force; + if(pj->num_ngb_force < NUM_OF_NEIGHBOURS) { pj->ids_ngbs_force[pj->num_ngb_force] = pi->id; ++pj->num_ngb_force; } + else ++pj->num_ngb_force; #endif } @@ -605,6 +612,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force( pi->ids_ngbs_force[pi->num_ngb_force] = pj->id; ++pi->num_ngb_force; } + else ++pi->num_ngb_force; #endif } -- GitLab