Commit 820f2846 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fix old bug in the original linking of gas and gparts read in from the ICs.

parent f0b6fa84
...@@ -679,6 +679,9 @@ int main(int argc, char *argv[]) { ...@@ -679,6 +679,9 @@ int main(int argc, char *argv[]) {
for (size_t k = 0; k < Ngpart; ++k) for (size_t k = 0; k < Ngpart; ++k)
if (gparts[k].type == swift_type_gas) error("Linking problem"); if (gparts[k].type == swift_type_gas) error("Linking problem");
} }
/* Check that the other links are correctly set */
part_verify_links(parts, gparts, sparts, Ngas, Ngpart, Nspart, 1);
#endif #endif
/* Get the total number of particles across all nodes. */ /* Get the total number of particles across all nodes. */
......
...@@ -708,7 +708,7 @@ void io_duplicate_hydro_gparts_mapper(void* restrict data, int Ngas, ...@@ -708,7 +708,7 @@ void io_duplicate_hydro_gparts_mapper(void* restrict data, int Ngas,
gparts[i + Ndm].type = swift_type_gas; gparts[i + Ndm].type = swift_type_gas;
/* Link the particles */ /* Link the particles */
gparts[i + Ndm].id_or_neg_offset = -i; gparts[i + Ndm].id_or_neg_offset = -(long long)(offset + i);
parts[i].gpart = &gparts[i + Ndm]; parts[i].gpart = &gparts[i + Ndm];
} }
} }
...@@ -764,7 +764,7 @@ void io_duplicate_hydro_sparts_mapper(void* restrict data, int Nstars, ...@@ -764,7 +764,7 @@ void io_duplicate_hydro_sparts_mapper(void* restrict data, int Nstars,
gparts[i + Ndm].type = swift_type_star; gparts[i + Ndm].type = swift_type_star;
/* Link the particles */ /* Link the particles */
gparts[i + Ndm].id_or_neg_offset = -i; gparts[i + Ndm].id_or_neg_offset = -(long long)(offset + i);
sparts[i].gpart = &gparts[i + Ndm]; sparts[i].gpart = &gparts[i + Ndm];
} }
} }
......
...@@ -1435,7 +1435,8 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) { ...@@ -1435,7 +1435,8 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
switch (t->type) { switch (t->type) {
case task_type_self: case task_type_self:
case task_type_sub_self: case task_type_sub_self:
if (t->subtype == task_subtype_grav || t->subtype == task_subtype_external_grav) if (t->subtype == task_subtype_grav ||
t->subtype == task_subtype_external_grav)
qid = t->ci->super_gravity->owner; qid = t->ci->super_gravity->owner;
else else
qid = t->ci->super_hydro->owner; qid = t->ci->super_hydro->owner;
......
Markdown is supported
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