Skip to content

pants721/luna

Repository files navigation

LUNA (LUcas' N-body Analyzer)

3D N-body simulator built in C++20. Implements Barnes-Hut octree and direct summation force solvers with OpenMP and Intel TBB parallelization, symplectic leapfrog integration, and real-time OpenGL rendering. Runs everything on the CPU (for now).

luna_cut_compressed

Demos

demo1_small

Full quality video demo

10,000 Bodies running at ~160 FPS

Running LUNA

Install system dependencies (Fedora/RHEL):

sudo dnf install gcc-c++ cmake ninja-build mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel

Or on Debian/Ubuntu:

sudo apt install build-essential cmake libgl-dev libx11-dev libxrandr-dev libxi-dev libxcursor-dev libxinerama-dev

Clone the repo:

git clone --recurse-submodules https://github.com/pants721/luna

Run setup.sh:

cd luna
./setup.sh

Build:

./build.sh

Run LUNA:

# GUI (requires a display)
./build/luna_gui examples/luna_text.json
# Headless (no window, no OpenGL required)
./build/luna_headless examples/luna_text.json

Performance

I haven't taken the time to formally measure performance yet, but here are my estimates for FPS at N bodies using TBB Barnes-Hut solver and TBB Leap Frog integrator. I measured these numbers on my PC, which is more performant than average, so the measurements are optimistic.

N Bodies FPS
<7500 Max
10,000 160
20,000 90
30,000 50
40,000 40
50,000 30
60,000 22
70,000 20
80,000 16
90,000 14
100,000 12

About

Lagrangian Universal N-body Analyzer (or LUcas' N-body Analyzer if you're fun). It's a 3D N-body simulator.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors