[WIP] Self gravity (Barnes-Hut version)
First iteration of the gravity solver. This is a copy of the BH code in the Quickhed examples. Compute forces up to quadrupole order.
Comes with the following limitations:
- Not MPI
- Not periodic
- Only fixdt
- Gravity is not softened
The last 2 points are trivial to implement and won't affect the logic.
At the moment there is little logic in scheduler_splittask()
, everything is in the tasks themselves. Obvious improvements to the logic would be to not lock a cell when only its multipole is required.
This should not be merged in as it is but it is here for you to look at.
There are three types of task (besides the multipole construction):
-
pair
: interacts two cells that are neighbours of each others (potentially by recursing). -
self
: interacts one cell with itself (potentially by recursing). -
mm
: interacts two cells that are NOT neighbours (using particle-multipole interactions, no recursion).
When we are happy, the mm
tasks can be replaced by a multipole-multipole interaction to make the algorithm FMM and not Barnes-Hut any more.
Merge request reports
Activity
Here is a histogram of the relative errors when compared to a stupid N^2 algorithm. We are more accurate than the ~1% achieved by Gadget. This will improve further when softened interactions are used.
@rgb Is that plot sexy enough ?
Edited by Matthieu SchallerAdded 4 commits:
Toggle commit listAdded 1 commit:
- f647b6fa - Compiling but wrong softening
Added 57 commits:
-
f647b6fa...b90156c9 - 55 commits from branch
master
- fa8062c7 - Merge branch 'master' into Self_gravity_BH
- 09f3bcc2 - Post-merge fixes
-
f647b6fa...b90156c9 - 55 commits from branch
Added 14 commits:
-
1310ca75...778c4cca - 12 commits from branch
master
- bd058d2f - Merge branch 'master' into Self_gravity_BH
- 4f4227c4 - Post-merge fixes
-
1310ca75...778c4cca - 12 commits from branch
Added 1 commit:
- 9e28ec1e - Upated the kernel functions for gravity. Added a unit test to test it against the Gadget-2 kernel
Added 6 commits:
-
5497fe79...78f0419b - 5 commits from branch
master
- 8ef31673 - Merge branch 'master' into Self_gravity_BH
-
5497fe79...78f0419b - 5 commits from branch
Added 12 commits:
-
8ef31673...a4f97e08 - 7 commits from branch
master
- b4721778 - Merge branch 'master' into Self_gravity_BH
- 6b6c7c84 - Use definition of atomics everywhere in cell.c
- 487a1f08 - Use atomic definitions
- 111fdbf9 - Set the locking and unlocking of cells for gravity tasks
- c5197e08 - Added function to compute long-range FFT correction term
Toggle commit list-
8ef31673...a4f97e08 - 7 commits from branch
Added 1 commit:
- e1b31a15 - Better documentation of the gravity stuff in engine
Added 15 commits:
-
f0728bfb...ca0eafb8 - 13 commits from branch
master
- 24e3b63a - Merge branch 'master' into Self_gravity_BH
- 01f51f70 - Post-merge fixes
-
f0728bfb...ca0eafb8 - 13 commits from branch