Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.71 KB

README.md

File metadata and controls

42 lines (30 loc) · 1.71 KB

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