Commit c3480fcb authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added a few more checks that no inhibited particles are going through the calculations.

parent ec104141
......@@ -1028,6 +1028,11 @@ INLINE static void gravity_P2M(struct gravity_tensors *multi,
for (int k = 0; k < gcount; k++) {
const double m = gparts[k].mass;
#ifdef SWIFT_DEBUG_CHECKS
if (gparts[k].time_bin == time_bin_inhibited)
error("Inhibited particle in P2M. Should have been remvoed earlier.");
#endif
mass += m;
com[0] += gparts[k].x[0] * m;
com[1] += gparts[k].x[1] * m;
......
......@@ -2013,7 +2013,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) {
const int gcount = c->grav.count;
const int scount = c->stars.count;
struct part *restrict parts = c->hydro.parts;
struct xpart *restrict xparts = c->hydro.xparts;
// struct xpart *restrict xparts = c->hydro.xparts;
struct gpart *restrict gparts = c->grav.parts;
struct spart *restrict sparts = c->stars.parts;
const int periodic = s->periodic;
......@@ -2043,7 +2043,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) {
/* Get a handle on the part. */
struct part *restrict p = &parts[k];
struct xpart *restrict xp = &xparts[k];
// struct xpart *restrict xp = &xparts[k];
if (part_is_active(p, e)) {
......
......@@ -1924,6 +1924,10 @@ void space_split_recursive(struct space *s, struct cell *c,
sizeof(struct cell_buff) * count) != 0)
error("Failed to allocate temporary indices.");
for (int k = 0; k < count; k++) {
#ifdef SWIFT_DEBUG_CHECKS
if (parts[k].time_bin == time_bin_inhibited)
error("Inhibited particle present in space_split()");
#endif
buff[k].x[0] = parts[k].x[0];
buff[k].x[1] = parts[k].x[1];
buff[k].x[2] = parts[k].x[2];
......@@ -1934,6 +1938,10 @@ void space_split_recursive(struct space *s, struct cell *c,
sizeof(struct cell_buff) * gcount) != 0)
error("Failed to allocate temporary indices.");
for (int k = 0; k < gcount; k++) {
#ifdef SWIFT_DEBUG_CHECKS
if (gparts[k].time_bin == time_bin_inhibited)
error("Inhibited particle present in space_split()");
#endif
gbuff[k].x[0] = gparts[k].x[0];
gbuff[k].x[1] = gparts[k].x[1];
gbuff[k].x[2] = gparts[k].x[2];
......@@ -1944,6 +1952,10 @@ void space_split_recursive(struct space *s, struct cell *c,
sizeof(struct cell_buff) * scount) != 0)
error("Failed to allocate temporary indices.");
for (int k = 0; k < scount; k++) {
#ifdef SWIFT_DEBUG_CHECKS
if (sparts[k].time_bin == time_bin_inhibited)
error("Inhibited particle present in space_split()");
#endif
sbuff[k].x[0] = sparts[k].x[0];
sbuff[k].x[1] = sparts[k].x[1];
sbuff[k].x[2] = sparts[k].x[2];
......
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