Skip to content
A parallel galaxy evolution simulator
C++ Cuda C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
BHSpaceModel.cpp
BHSpaceModel.h
FMMSpaceModel.cpp
FMMSpaceModel.h
Makefile
MortonSpaceModel.cpp
MortonSpaceModel.h
MortonTree.cpp
MortonTree.h
Object.cpp
Object.h
Perf.cpp
Perf.h
QuadTree.cpp
QuadTree.h
README.md
Report.cpp
Report.h
Screen.cpp
Screen.h
SpaceController.cpp
SpaceController.h
SpaceModel.cpp
SpaceModel.h
SpaceView.cpp
SpaceView.h
basic_types.cpp
basic_types.h
build_config.h
cudaBHSpaceModel.cu
cudaBHSpaceModel.h
cudaMortonSpaceModel.cu
cudaMortonSpaceModel.h
glfw.h
log.h
main.cpp

README.md

About

GravitySim is a gravity simulator written in C/C++, using two algorithms to approximate gravity interactions between objects, one is Barnus-Hut, the other is MortonCode. Also, we use CUDA techniques to speedup the two algorithms.

Usage

Compile with make mac for OSX or make linux for linux (only tested on ubuntu). Now you should be able to run it using ./gravitysim.
To customize simulation you can call it with different arguments.

./gravitysim number_of_loops number_of_galaxies objects_per_galaxy galaxy_size

For instance:
./gravitysim 500 10 1000 100 creates 10 galaxies with 1000 objects per galaxy, diameter 100 pixels and 500 loops.
./gravitysim 500 10000 1 1 creates 10000 galaxies with one object per galaxy, diameter 1 pixel, and 500 loops.
You could also customize a lot of options using build_config.h file (such as G constant, sd treshold, max speed or max mass), but it requires rebuilding whole project.

Dependency

The only dependency is the GLFW2 library, you shoud be able to install it using either apt-get on linux or homebrew on OSX.

Installing GLFW2 on OSX
brew tap homebrew/versions
brew install --build-bottle --static glfw2

License

The MIT License (MIT)

You can’t perform that action at this time.