GithubHelp home page GithubHelp logo

kevinmcgin / simulation Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.84 MB

Simulates the motion of particles on the GPU with Nvidia's CUDA. Renders simulations on OpengGL.

License: MIT License

C++ 44.85% Cuda 20.38% CMake 3.90% Shell 4.11% PowerShell 3.65% C 19.15% HTML 0.49% CSS 3.37% Meson 0.10%
simulation cuda opengl gpu physics-engine

simulation's Introduction

Ubuntu CPU Build & Test Quality Gate Status Coverage Bugs Code Smells Duplicated Lines (%) Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Simulation

Simulates the motion of particles on the CPU or on the GPU with CUDA.

Renders these simulations with OpenGL.

Render Example

2021-12-16.13-08-52.mp4

Road Map

Wiki

Dependencies

  • CMake
  • CUDA
  • OpenGL

Installation

Installation Guide

Configuration

Configuration files are in the config folder.

Git ignored configuration files are generate from *.config.example files after building.

Project

The project config file allows the configuration of the BUILD_PATH and whether to USE_GPU in the simulation engine.

Scripts

Scripts Guide

simulation's People

Contributors

kevinmcgin avatar kevinmcginley-cityswift avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

simulation's Issues

Law Interaction

for (const auto& p1 : particles)
for (const auto& p2 : particles) {
if (p1 != p2) {

		}
	}

timing of main.cpp runs

Update a time field in the cmd line.
Maybe after each pass of a particle in Law, might be slow

Correct radius initialising from mass

New classes:
DistributionDensity {
getMassRadius(double &mass, &radius);
}
DistributionMassRadius(mass, radius) : DistributionDenisty
DistributionMassDensity(mass, density): DistributionDensity
DistrubtuionValue(value) : Distribution

Runnable to be Open Source

Project as easy to run as possible.
Last prerequiste to going public!
Should test running on linux usb from scratch. Use knowledge gained to add to readme.

pure parallel laws

GPU run functions to only manipulate GPU data and not to copy data to and from the CPU. The CPU data is to be copied to and from at the beginning and end of each frame.
Blocked by #64

  • GPU data allocated and deallocated between frames only
  • only deallocate and reallocate memory if a particle is deleted
  • refactor/fix GPU tests
  • add NewtonFirstLaw GPU tests

Parrallise Collision

gpuRun function for Collision.
The run function for Collision is segmented into 4 different sections by comments. The frist 3 segments can be put into 3 kernels for the GPU. the final segment can be added as a separte Law that is run on the CPU: DeletionLaw (Those particles who have been marked for deletion shall be cast away!)

benchmark GPU vs CPU

Using CPU
Simulation running
101 particles
100% 18.8768s Simulation complete
Using GPU
Simulation running
101 particles
100% 34.4751s Simulation complete

Using CPU
Simulation running
1001 particles
100% 7.04874mins Simulation complete
Using GPU
Simulation running
1001 particles
100% 5.699mins Simulation complete

Using CPU
Simulation running
3001 particles
10.833% 10.5476mins
Using GPU
Simulation running
3001 particles
49.185% 11.5413mins

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.