Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blalop/bodies
N-body simulation
https://github.com/blalop/bodies
nbody simulation
Last synced: 13 days ago
JSON representation
N-body simulation
- Host: GitHub
- URL: https://github.com/blalop/bodies
- Owner: blalop
- License: mit
- Created: 2018-10-19T18:09:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-28T18:54:41.000Z (over 5 years ago)
- Last Synced: 2024-12-13T03:30:16.506Z (2 months ago)
- Topics: nbody, simulation
- Language: C++
- Homepage:
- Size: 1.48 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# n-body

A N-Body simulation.
This repo contains my Bachelor's thesis.
It has three configurations:
* brute: brute force method
* bhtree: tree based method
* parallel: tree based method (parallel)## Dependencies
* Qt 5.
* C++11 onwards## Instructions
```
qmake
make
bin/nbody configuration [iterations] [trace]
```## Inputs
Input must come in a file format, in which the first line indicates the number of bodies and the second the radius of the universe.From the third line, each line represents a body, with the parameters as follows:
```
mass posx posy velx vly
```The program reads the input file from the standard input.
### Provided inputs
`10k.txt`: 10000 bodies orbiting in an elliptical way.`10k.txt`: 20000 bodies orbiting in an elliptical way.
`30k.txt`: 30000 bodies orbiting in an elliptical way.
`asteroids.txt`: 1000 asteroids orbiting around a star.
`cluster.txt`: A 2500 particle cloud.
`collapse.txt`: A 2500 particle cloud collapses into a galaxy.
`dual.txt`: Two galaxies orbiting each other.
`galaxy.txt`: A galaxy moving through space.
`merge.txt`: Four 1000 particles collapse.
`planets.txt`: A star system composed by 4 planets.
`saturn.txt`: Saturn rings.
`spiral.txt`: A round galaxy becomes a spiral one.
Credits of the input files to Adam Chin and Rohan Kapadia.