Skip to content

Leveraging GPU with OpenCL to run a particle simulator

Notifications You must be signed in to change notification settings

EmmanuelMess/CollisionBasedGasSimulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

First-collision timestep gas simulator with OpenCL

This simulator computes all possible intersections, then checks which of those possible intersections is soonest to occur, and does some checks, the simulator then runs for time for enough time for the collision to occur. Once the intersection occurs, the whole process runs again.

The idea is that GPUs allow this to go very fast, by computing a lot of data in parallel (all segments and intersections), this method of simulation is very precise as intersections are computed analytically, not in steps.

Architecture

The general arch is in architecture.md.

Gallery

Compilation and running

First compile with:

cd code
./generate_kernels.sh
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -G Ninja -S ./ -B ./cmake-build-debug
cmake --build ./cmake-build-debug --target CollisionBasedGasSimulator -j 3

Then run with:

./cmake-build-debug/CollisionBasedGasSimulator

Some refrences and thanks


Become a patreon

About

Leveraging GPU with OpenCL to run a particle simulator

Topics

Resources

Stars

Watchers

Forks