Skip to content
Snippets Groups Projects
Commit af15acb8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Corrected typos in runner_doiact.h

parent a6deb080
Branches
Tags
1 merge request!632Add functions to permanently remove particles from a simulation
...@@ -741,7 +741,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci, ...@@ -741,7 +741,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci,
#endif #endif
/* Hit or miss? */ /* Hit or miss? */
if (r2 < hig2 && pj_inhibited) { if (r2 < hig2 && !pj_inhibited) {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H); IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
...@@ -1466,7 +1466,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid, ...@@ -1466,7 +1466,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
/* Check that particles have been drifted to the current time */ /* Check that particles have been drifted to the current time */
if (pi->ti_drift != e->ti_current && !pi_inhibited) if (pi->ti_drift != e->ti_current && !pi_inhibited)
error("Particle pi not drifted to current time"); error("Particle pi not drifted to current time");
if (pj->ti_drift != e->ti_current && pj_inhibited) if (pj->ti_drift != e->ti_current && !pj_inhibited)
error("Particle pj not drifted to current time"); error("Particle pj not drifted to current time");
#endif #endif
/* Hit or miss? /* Hit or miss?
...@@ -1808,14 +1808,13 @@ void DOSELF1(struct runner *r, struct cell *restrict c) { ...@@ -1808,14 +1808,13 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
/* Get a pointer to the jth particle. */ /* Get a pointer to the jth particle. */
struct part *restrict pj = &parts[indt[pjd]]; struct part *restrict pj = &parts[indt[pjd]];
const int pj_inhibited = part_is_inhibited(pj, e);
const float hj = pj->h; const float hj = pj->h;
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
/* Check that particles have been drifted to the current time */ /* Check that particles have been drifted to the current time */
if (pi->ti_drift != e->ti_current && !pi_inhibited) if (pi->ti_drift != e->ti_current && !pi_inhibited)
error("Particle pi not drifted to current time"); error("Particle pi not drifted to current time");
if (pj->ti_drift != e->ti_current && !pj_inhibited) if (pj->ti_drift != e->ti_current)
error("Particle pj not drifted to current time"); error("Particle pj not drifted to current time");
#endif #endif
...@@ -1862,6 +1861,8 @@ void DOSELF1(struct runner *r, struct cell *restrict c) { ...@@ -1862,6 +1861,8 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
const int doj = const int doj =
(part_is_active(pj, e)) && (r2 < hj * hj * kernel_gamma2); (part_is_active(pj, e)) && (r2 < hj * hj * kernel_gamma2);
const int doi = (r2 < hig2);
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
/* Check that particles have been drifted to the current time */ /* Check that particles have been drifted to the current time */
if (pi->ti_drift != e->ti_current && !pi_inhibited) if (pi->ti_drift != e->ti_current && !pi_inhibited)
...@@ -1871,20 +1872,23 @@ void DOSELF1(struct runner *r, struct cell *restrict c) { ...@@ -1871,20 +1872,23 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
#endif #endif
/* Hit or miss? */ /* Hit or miss? */
if (r2 < hig2 || doj) { if (doi || doj) {
/* Which parts need to be updated? */ /* Which parts need to be updated? */
if (r2 < hig2 && doj) { if (doi && doj) {
IACT(r2, dx, hi, hj, pi, pj, a, H); IACT(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H); runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H);
#endif #endif
} else if (!doj && !pj_inhibited) { } else if (doi && !pj_inhibited) {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H); IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H); runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
#endif #endif
} else { } else if (doj && !pi_inhibited) {
dx[0] = -dx[0]; dx[0] = -dx[0];
dx[1] = -dx[1]; dx[1] = -dx[1];
dx[2] = -dx[2]; dx[2] = -dx[2];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment