diff --git a/src/runner_doiact_stars.h b/src/runner_doiact_stars.h index e3a1df7d1a941db3cb3414e76dc4f927e04f68a1..91a2a763ee054c44cca207092c8b4cc262c6c5d5 100644 --- a/src/runner_doiact_stars.h +++ b/src/runner_doiact_stars.h @@ -204,11 +204,10 @@ void DO_NONSYM_PAIR1_STARS_NAIVE(struct runner *r, struct cell *restrict ci, /* Get a pointer to the jth particle. */ struct part *restrict pj = &parts_j[pjd]; + /* Skip inhibited particles. */ if (part_is_inhibited(pj, e)) continue; - const float hj = pj->h; - /* Compute the pairwise distance. */ const float pjx[3] = {(float)(pj->x[0] - cj->loc[0]), (float)(pj->x[1] - cj->loc[1]), @@ -222,7 +221,7 @@ void DO_NONSYM_PAIR1_STARS_NAIVE(struct runner *r, struct cell *restrict ci, error("Particle pj not drifted to current time"); #endif - if (r2 < hig2) IACT_STARS(r2, dx, hi, hj, si, pj, a, H); + if (r2 < hig2) IACT_STARS(r2, dx, hi, pj->h, si, pj, a, H); } /* loop over the parts in cj. */ } /* loop over the parts in ci. */ @@ -702,6 +701,9 @@ void DOPAIR1_SUBSET_STARS_NAIVE(struct runner *r, struct cell *restrict ci, /* Get a pointer to the jth particle. */ struct part *restrict pj = &parts_j[pjd]; + /* Skip inhibited particles */ + if (part_is_inhibited(pj, e)) continue; + /* Compute the pairwise distance. */ float r2 = 0.0f; float dx[3];