Skip to content
Snippets Groups Projects
README.md 876 B
Newer Older
Armin Damon Riess's avatar
Armin Damon Riess committed
# N Body Simulation

This code simulates particles under self-gravity. The forces are calculated via direct summation or with a tree and multipole expansion. 
In the branch "adaptive-timestepping" there is also an implementation that uses adaptive timestepping. 

Most of the code is written in C++, Python is used to make plots and animations. OpenMP is used for parallelisation. 
Armin Damon Riess's avatar
Armin Damon Riess committed

## Install OpenMP

https://www.geeksforgeeks.org/openmp-introduction-with-installation-guide/

## Clone repository

This will create a folder called nbody that contains everything. 

git clone https://gitlab.uzh.ch/armindamon.riess/nbody.git
## Make build directory
Armin Damon Riess's avatar
Armin Damon Riess committed

This requires cmake and make. Run it in the folder nbody. 
Armin Damon Riess's avatar
Armin Damon Riess committed
```
mkdir build
cd build
cmake ..
Armin Damon Riess's avatar
Armin Damon Riess committed
```
Armin Damon Riess's avatar
Armin Damon Riess committed

## Compiling and running the program
Armin Damon Riess's avatar
Armin Damon Riess committed

Go to the nbody/build directory and run these commands: 

Armin Damon Riess's avatar
Armin Damon Riess committed
```
make
./nbody