Skip to main content

Three-Dimensional Hierarchical Gravitational Force Calculations on GPUs

As part of my Bachelor’s thesis at ETH Zürich, I developed a Barnes-Hut N-body simulation using Nvidia CUDA to accelerate gravitational calculations on the GPU.

The video shows a real-time simulation of a Milky Way–Andromeda galaxy merger using the Dubinski 1996 dataset. The system evolves 81,920 particles, each with full six-dimensional phase space coordinates (x, y, z, vx, vy, vz), representing the initial conditions of the galactic collision. The simulation runs on an Nvidia GTX 470 and uses CUDA to parallelize hierarchical force approximations via the Barnes-Hut algorithm.