Git Product home page Git Product logo

cudagravity's Introduction

CUDAGravity

This is a slightly dodgy gravity simulator written using CUDA.

This project contains three different applications:

cudagravity_sim

This is the main simulator, it expects an initial.ibin file in it's current directory and generates <epoch number>.bin files in the output directory it creates, it is the only application that requires CUDA.

cudagravity_viewer

This is the viewer application, it takes the <epoch number>.bin files that cudagravity_sim creates and shows them on the screen via SDL.

Currently these are the available keys:

Key Function
space Pauses/unpauses the viewer (starts paused)
a Turns auto-size on/off (auto size keeps every particle in the viewport
/ Moves the viewer's time forwards/backwards by dt
+/- On the numpad, Increases or decreases dt by a factor of 2
0 On the numpad, Goes back to the start
/ Zooms in/out, if you try zoom in past a particle with autosize on it won't do anything (use SHIFT for a bigger zoom interval and CTRL for a massive zoom interval

generate_initial.py

This generates the initial.ibin file required by cudagravity_sim, it has three modes:

Random (-r N)

In this mode you pass in the number of particles you want and it generates N random particles and writes those to a file

YAML (-f filename)

This reads the yaml file that you specify to generate the initial file (see generate_initial/sample.yaml) for an example

Editor (no arguments specified)

This opens a pygame based editor application, it's very simple but it works, you just click to create a particle and add velocity to it by dragging your mouse cursor

cudagravity's People

Contributors

exoskye avatar

Watchers

 avatar

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.