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

Ignore buffer particles in the initial test for identical positions.

parent 44f618ee
No related branches found
No related tags found
2 merge requests!688Star formation (non-MPI),!684Add star particles on-the-fly
...@@ -2773,6 +2773,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs, ...@@ -2773,6 +2773,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
double *prev_x = s->parts[0].x; double *prev_x = s->parts[0].x;
long long *prev_id = &s->parts[0].id; long long *prev_id = &s->parts[0].id;
for (size_t k = 1; k < s->nr_parts; k++) { for (size_t k = 1; k < s->nr_parts; k++) {
/* Ignore fake buffer particles for on-the-fly creation */
if (s->parts[k].time_bin == time_bin_not_created) continue;
if (prev_x[0] == s->parts[k].x[0] && prev_x[1] == s->parts[k].x[1] && if (prev_x[0] == s->parts[k].x[0] && prev_x[1] == s->parts[k].x[1] &&
prev_x[2] == s->parts[k].x[2]) { prev_x[2] == s->parts[k].x[2]) {
if (e->verbose) if (e->verbose)
...@@ -2795,6 +2799,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs, ...@@ -2795,6 +2799,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
int failed = 0; int failed = 0;
double *prev_x = s->gparts[0].x; double *prev_x = s->gparts[0].x;
for (size_t k = 1; k < s->nr_gparts; k++) { for (size_t k = 1; k < s->nr_gparts; k++) {
/* Ignore fake buffer particles for on-the-fly creation */
if (s->gparts[k].time_bin == time_bin_not_created) continue;
if (prev_x[0] == s->gparts[k].x[0] && prev_x[1] == s->gparts[k].x[1] && if (prev_x[0] == s->gparts[k].x[0] && prev_x[1] == s->gparts[k].x[1] &&
prev_x[2] == s->gparts[k].x[2]) { prev_x[2] == s->gparts[k].x[2]) {
if (e->verbose) if (e->verbose)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment