Skip to content
Snippets Groups Projects

Add cell links for gravity tasks

Merged Peter W. Draper requested to merge gravity-links into master

Add links for gravity tasks so that we can discover these from cells.

Also expunge external_gravity from cell.h.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1875 1887
1876 1888 /* Allocate the list of cell-task links. The maximum number of links
1877 1889 is the number of cells (s->tot_cells) times the number of neighbours (27)
1878 times the number of interaction types (2, density and force). */
1890 times the number of interaction types (2, density and force, grav). */
1879 1891 if (e->links != NULL) free(e->links);
  • 1875 1887
    1876 1888 /* Allocate the list of cell-task links. The maximum number of links
    1877 1889 is the number of cells (s->tot_cells) times the number of neighbours (27)
    1878 times the number of interaction types (2, density and force). */
    1890 times the number of interaction types (2, density and force, grav). */
    1879 1891 if (e->links != NULL) free(e->links);
    • So, we should have 26 * 3 (density, force, grav) pairs and up to 4 (density, force, grav, ext_grav) self. So in total:

      s->tot_cells * (26 * 3 + 4)

      or for GIZMO:

      s->tot_cells * (26 * 4 + 4)

  • Peter W. Draper Added 1 commit:

    Added 1 commit:

    • 7f64ed3b - Change allocations of size_links as suggested by Matthieu
  • Thanks, that makes more sense. I've pushed the fix.

  • Added 1 commit:

    • 6f12fe19 - Also update the counter of gravity self/pair tasks when linking them.
  • For consistency with the rest I have also added an update to the nr_grav counters. These counters are never used btw...

    Now, shouldn't we do this (and the linking) in engine_count_and_link task as is done for the hydro-density tasks ?

  • If you think that makes more sense, but there are a number of engine_link calls scattered in other places, so I just went for the most obvious places. I'll leave the choice to you as the most familiar with this area.

  • Added 1 commit:

    • babf1c74 - Add the gravity link in 'engine_count_and_link_tasks()'
  • Added 1 commit:

    • 59d5eb87 - Added temporary variables in 'engine_count_and_link_tasks()'
  • Ok, I have done exactly that. Would you like to look at it before the merge ?

  • Reassigned to @pdraper

  • Yes, just merged this to mark_tasks_in_drift2 and external gravity is working, so it all looks good to go now. I'll accept.

  • Peter W. Draper Status changed to merged

    Status changed to merged

  • Peter W. Draper mentioned in commit cd34c3b6

    mentioned in commit cd34c3b6

  • Spoke too soon, came across a missing (re)initialisation which is fixed in e90dd24b. Without that the Multitype test gets stuck in a loop when iterating the grav links.

  • Please register or sign in to reply
    Loading