diff --git a/examples/main.c b/examples/main.c index d06bf85bc23f76b8997f25b345ca46bb8f3deffb..62d7d877c675c752b299a1faf1da90ecd3eb2c23 100644 --- a/examples/main.c +++ b/examples/main.c @@ -380,9 +380,9 @@ int main(int argc, char *argv[]) { N_total[0] = Ngas; N_total[1] = Ngpart - Ngas; #endif - if (myrank == 0) - message("Read %lld gas particles and %lld DM particles from the ICs", - N_total[0], N_total[1]); + if (myrank == 0) + message("Read %lld gas particles and %lld DM particles from the ICs", + N_total[0], N_total[1]); /* Apply h scaling */ if (scaling != 1.0) diff --git a/src/common_io.c b/src/common_io.c index efeed75f01dbb36c0f2c24fb9388e812890f44fe..30ac6de81cdba59a72c02e7b6399e3dccca17da6 100644 --- a/src/common_io.c +++ b/src/common_io.c @@ -489,8 +489,8 @@ void prepare_dm_gparts(struct gpart* gparts, int Ndm) { for (int i = 0; i < Ndm; ++i) { /* 0 ir negative ids are not allowed */ - if(gparts[i].id <= 0) error("0 or negative ID for DM particle"); - + if (gparts[i].id <= 0) error("0 or negative ID for DM particle"); + gparts[i].id = -gparts[i].id; } } diff --git a/src/engine.c b/src/engine.c index e40f82b29c380972814bb00f7f770bc402e645c4..c34214c05b6fb45991208dd78689b58ba5d9731f 100644 --- a/src/engine.c +++ b/src/engine.c @@ -797,11 +797,13 @@ void engine_maketasks(struct engine *e) { /* /\* Add the gravity mm tasks. *\/ */ /* for (int i = 0; i < nr_cells; i++) */ /* if (cells[i].gcount > 0) { */ - /* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0, */ + /* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0, + */ /* &cells[i], NULL, 0); */ /* for (int j = i + 1; j < nr_cells; j++) */ /* if (cells[j].gcount > 0) */ - /* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0, */ + /* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, + * 0, */ /* &cells[i], &cells[j], 0); */ /* } */ @@ -817,16 +819,19 @@ void engine_maketasks(struct engine *e) { error("Failed to allocate cell-task links."); e->nr_links = 0; - /* /\* Add the gravity up/down tasks at the top-level cells and push them down. *\/ */ + /* /\* Add the gravity up/down tasks at the top-level cells and push them + * down. *\/ */ /* for (int k = 0; k < nr_cells; k++) */ /* if (cells[k].nodeID == nodeID && cells[k].gcount > 0) { */ /* /\* Create tasks at top level. *\/ */ /* struct task *up = */ - /* scheduler_addtask(sched, task_type_grav_up, task_subtype_none, 0, 0, */ + /* scheduler_addtask(sched, task_type_grav_up, task_subtype_none, 0, + * 0, */ /* &cells[k], NULL, 0); */ /* struct task *down = */ - /* scheduler_addtask(sched, task_type_grav_down, task_subtype_none, 0, 0, */ + /* scheduler_addtask(sched, task_type_grav_down, task_subtype_none, 0, + * 0, */ /* &cells[k], NULL, 0); */ /* /\* Push tasks down the cell hierarchy. *\/ */ diff --git a/src/map.c b/src/map.c index 4766f070dec163fd8ac00871c07635ff315f97be..96f3981f8d85041669a9d7e5f39d1eb02ccd8bb5 100644 --- a/src/map.c +++ b/src/map.c @@ -121,14 +121,14 @@ void map_cellcheck(struct cell *c, void *data) { p->x[0] > c->loc[0] + c->h[0] || p->x[1] > c->loc[1] + c->h[1] || p->x[2] > c->loc[2] + c->h[2]) { printf( - "map_cellcheck: g-particle at [ %.16e %.16e %.16e ] outside of cell [ " + "map_cellcheck: g-particle at [ %.16e %.16e %.16e ] outside of cell " + "[ " "%.16e %.16e %.16e ] - [ %.16e %.16e %.16e ].\n", p->x[0], p->x[1], p->x[2], c->loc[0], c->loc[1], c->loc[2], c->loc[0] + c->h[0], c->loc[1] + c->h[1], c->loc[2] + c->h[2]); error("g-particle out of bounds!"); } } - } /** diff --git a/src/space.c b/src/space.c index 93e3a09cfc1cdeced5fc5fa6662d43d2fb0b6411..04ce059a252290c4a9338286928d6b9468661df5 100644 --- a/src/space.c +++ b/src/space.c @@ -456,13 +456,12 @@ void space_rebuild(struct space *s, double cell_max, int verbose) { /* Exchange the strays, note that this potentially re-allocates the parts arrays. */ - //s->nr_gparts = + // s->nr_gparts = // nr_gparts + engine_exchange_strays(s->e, nr_gparts, &ind[nr_gparts], // s->nr_gparts - nr_gparts); - if(nr_gparts > 0) + if (nr_gparts > 0) error("Need to implement the exchange of strays for the gparts"); - /* Re-allocate the index array if needed.. */ if (s->nr_gparts > gind_size) { size_t *gind_new;