Skip to content

NBody Forces

Raul edited this page Dec 4, 2017 · 4 revisions

NBody Forces is an interactor Module [1]. It makes all particle in the system interact with all the others directly, as an NxN computation.

For users

NbodyForces is an identical module to PairForces[4]. Only it uses an infinite cutoff distance. If you want to evaluate a potential with an infinite range you should use PairForces, which will fall back to NBody if the cutoff is large. If you want an arbitrary NBody interaction you should use the NBody class[5], which has an interface very similar to a neighbour list. See BDHI_Lanczos for an example on how to use NBody.

See below for how to implement a Transverser.

For developers

NBody is a very simple class in which the main kernel, NBody_ns::computeGPU contains the NVIDIA nbody algorithm [2]. The transversal of the system by each particle is performed by this function. While the logic of what to do with each pair of particles and with all the pairs involving particle i its outsourced using the Transversed concept [3].

Implementing a NBody Transverser

See [3] for information on how to implement a transverser.

Notice how this works for any general NxN computation, i.e summing the forces of all particles acting on each other or performing a matrix vector multiplication.


[1] https://github.com/RaulPPelaez/UAMMD/wiki/Interactor
[2]http://http.developer.nvidia.com/GPUGems3/gpugems3_ch31.html
[3] https://github.com/RaulPPelaez/UAMMD/wiki/List-Transverser
[4] https://github.com/RaulPPelaez/UAMMD/wiki/Pair-Forces
[5] https://github.com/RaulPPelaez/UAMMD/wiki/NBody









Clone this wiki locally