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

When linking the hierarchical gravity tasks, do not link to the parents if we...

When linking the hierarchical gravity tasks, do not link to the parents if we are at the super-level.
parent 4002cb53
No related branches found
No related tags found
1 merge request!680Two fixes to the gravity code
......@@ -1115,9 +1115,19 @@ void engine_link_gravity_tasks(struct engine *e) {
const enum task_types t_type = t->type;
const enum task_subtypes t_subtype = t->subtype;
struct cell *ci_parent = (ci->parent != NULL) ? ci->parent : ci;
struct cell *cj_parent =
(cj != NULL && cj->parent != NULL) ? cj->parent : cj;
/* Pointers to the parent cells for tasks going up and down the tree
* In the case where we are at the super-level we don't
* want the parent as no tasks are defined above that level. */
struct cell *ci_parent, *cj_parent;
if (ci->parent != NULL && ci->grav.super != ci)
ci_parent = ci->parent;
else
ci_parent = ci;
if (cj != NULL && cj->parent != NULL && cj->grav.super != cj)
cj_parent = cj->parent;
else
cj_parent = cj;
/* Node ID (if running with MPI) */
#ifdef WITH_MPI
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment