Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long-ranged forces #11

Open
ElliotB256 opened this issue Feb 14, 2021 · 3 comments
Open

Long-ranged forces #11

ElliotB256 opened this issue Feb 14, 2021 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@ElliotB256
Copy link
Collaborator

Long-ranged forces are important for 3D MOTs with lots of atoms, as the repulsive forces reduce the phase space density.

Some thoughts:

  • May need to use a MacroAtom approach, where relevant quantities like repulsive forces are scaled so that a small number of atoms can simulate the PSD of an (intractable) larger number of atoms.
  • Force goes as 1/r^2 which is long ranged and a real pain to parallelise.

Possible implementation:

  • Hash spatial position to sort atoms into bins.
  • Use a tree structure to allow fine-grained forces at close range, and coarse-grained forces for long range.
    • Atoms are sorted into each leaf of the tree.
    • Each leaf in the tree calculates total 'charge' and 'centre-of-mass'.
    • The tree structure is traversed to aggregate charges into each branch.
    • Tree structure from this point is immutable.
    • Calculate force exerted on each leaf due to tree structure (parallel over each leaf). Only calculate leaves which are occupied (total charge > 0). Iterate branches and leaves, to depth based on distance from calculated leaf.
    • For each atom, determine force by looking up leaf node. Use leaf.force + force calculated pair-wise between other atoms in the leaf.

Building tree will be O(L) O(N).

@ElliotB256
Copy link
Collaborator Author

Turns out the tree method has a name, it's called Barnes-Hut https://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation

@ElliotB256
Copy link
Collaborator Author

There is a recent repo for implementing this algorithmn, wouldn't hurt to try it and see how it performs. I expect it may need a bit of profiling
https://docs.rs/nbody_barnes_hut/0.1.0/nbody_barnes_hut/

@ElliotB256 ElliotB256 added the enhancement New feature or request label Feb 18, 2021
@ElliotB256 ElliotB256 added this to the Multi-particle effects milestone Apr 27, 2021
@ElliotB256
Copy link
Collaborator Author

Good overview in Leyuan Wu, Geophys. J. Int.(2018)215,1865–1886

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant