Commit 6e879d49 authored by James Willis's avatar James Willis
Browse files

Only log particles up to array length.

parent a44a0d81
......@@ -106,10 +106,14 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
++pi->num_ngb_density;
pj->ids_ngbs_density[pj->num_ngb_density] = pi->id;
++pj->num_ngb_density;
if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
++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;
}
#endif
}
......@@ -163,8 +167,10 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
++pi->num_ngb_density;
if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
++pi->num_ngb_density;
}
#endif
}
......@@ -493,10 +499,14 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
++pi->num_ngb_force;
pj->ids_ngbs_force[pj->num_ngb_force] = pi->id;
++pj->num_ngb_force;
if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
++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;
}
#endif
}
......@@ -591,8 +601,10 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
++pi->num_ngb_force;
if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
++pi->num_ngb_force;
}
#endif
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment