Skip to content

An n-body type simulation using GPU acceleration to simulate galaxies, galaxy collisions and expanding universes.

License

Notifications You must be signed in to change notification settings

Lecrapouille/Janus

 
 

Repository files navigation

Janus

Project-based on Angel Uriot's Galaxy_simulation in which we add negative masses and apply either Newton (m gamma = mM/d^2) or anti-Newton law (|m| gamma = mM/d^2). More information on this model: https://www.januscosmologicalmodel.fr/post/janus

Compilation Linux

sudo apt-get install pkg-config ocl-icd-opencl-dev opencl-clhpp-headers libsfml-dev libglm-dev libglew-dev libglfw3-dev libdw-dev

git clone https://github.com/Lecrapouille/Janus.git --recursive
cd Janus
make download-external-libs
make -j`nproc --all`

./build/Janus

Note: You need SFML v2.6 (not the v 3.0).

Possible issue

  • Depending on whether you are using Ubuntu 20, Ubuntu 22, or Debian 11, you may need to modify the OpenCL header in libraries.hpp. Choose between #include <CL/opencl.hpp> and #include <CL/cl2.hpp>.
  • Not working for MacOS because OpenCL cannot be used because Apple no longer supports OpenGL 4.x used by OpenCL.

Some screenshots

Two colors: red for positive masses, green for negative masses.

unnamed

collision_newton_30p

unnamed2

Videos

https://www.youtube.com/watch?v=DqYU1c410II

About

An n-body type simulation using GPU acceleration to simulate galaxies, galaxy collisions and expanding universes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 84.3%
  • Makefile 6.8%
  • C 5.2%
  • GLSL 3.7%