Commit 4ed1c86e authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Add the drifting and activity checks to the subset_naive interaction function

parent fba0dd79
......@@ -459,9 +459,7 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
struct part *restrict parts_i, int *restrict ind,
int count, struct cell *restrict cj) {
struct engine *e = r->e;
// error("Don't use in actual runs ! Slow code !");
const struct engine *e = r->e;
#ifdef WITH_OLD_VECTORIZATION
int icount = 0;
......@@ -496,6 +494,12 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
const float hi = pi->h;
const float hig2 = hi * hi * kernel_gamma2;
#ifdef SWIFT_DEBUG_CHECKS
if (!part_is_active(pi, e))
error("Trying to correct smoothing length of inactive particle !");
#endif
/* Loop over the parts in cj. */
for (int pjd = 0; pjd < count_j; pjd++) {
......@@ -510,6 +514,14 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
r2 += dx[k] * dx[k];
}
#ifdef SWIFT_DEBUG_CHECKS
/* Check that particles have been drifted to the current time */
if (pi->ti_drift != e->ti_current)
error("Particle pi not drifted to current time");
if (pj->ti_drift != e->ti_current)
error("Particle pj not drifted to current time");
#endif
/* Hit or miss? */
if (r2 < hig2) {
......
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