Skip to content

seb45tian/nbody

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-body simulation program

This program simulates the behaviour of a system of n particles/bodies following Newton's law of universal gravitation. The basic principles can be found here.

A number of random particles can be specified or a file to read the particle data from. The format of the file has to be:

[mass] [x] [y] [z] [vx] [vy] [vz]

You can choose between a brute-force approach (standard) or using the Barnes-Hut method.

Installation:

Use the provided Makefile to compile the code. Tested on Linux and Max OSX 10.9.5. Boost and GL/GLUT,OpenGL libraries required.

Usage:

./nbody -h

Allowed options:
  -h [ --help ]                 produce help message
  -p [ --particles ] arg (=100) set number of particles
  -f [ --infile ] arg           specify input file
  -e [ --epsilon ] arg (=0)     set softening factor
  -t [ --theta ] arg (=1)       set threshold value for theta
  -B [ --Barneshut ] [=arg(=1)] use Barnes-Hut method
  -b [ --boundary ] [=arg(=1)]  use periodic boundary conditions
  -o [ --octants ] [=arg(=1)]   make octants visible
  -n [ --threads ] arg (=1)     specify number of threads (only for BH. No need
                                to add -B.)

Author

Sebastian Potthoff: [email protected]

University of Warwick, March 2016

About

nbody simulation for cy903

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published