Coder Social home page Coder Social logo

loserking / mpm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from windqaq/mpm

0.0 2.0 0.0 12.46 MB

Simulating on GPU using Material Point Method and rendering.

Home Page: https://windqaq.github.io/MPM/

Makefile 0.22% CMake 0.91% Shell 0.02% C++ 22.25% C 71.28% Cuda 5.10% GLSL 0.23%

mpm's Introduction

MPM Simulation & Voxels Rendering

gpgpu free fall

This is the final project for the course, General-Purpose GPU Programming @ NTU CSIE.

We model and simulate fluid-like materials, such as snow and sand, using material point method. MPM is implemented in C++ & CUDA. And OpenGL is used for real-time result viewing. Besides, for high quality rendering, we use NVIDIA GVDB + OptiX Ray Tracing Engine.

Overview

Material point method overview

The material point method (MPM) is a numerical technique used to simulate the behavior of solids, liquids, gases, and any other continuum material. In the MPM, a continuum body is described by a number of small Lagrangian elements referred to as 'material points'. These material points are surrounded by a background mesh/grid that is used only to calculate gradient terms such as the deformation gradient. For more information, please go to Material point method - Wikipedia

Implementations

For more details about implementation, please go to our Project Page

Dependencies

Required

The following libraries has been put into this repository,

Optional

For high quality rendering as screenshots,

To generate videos from saved rendered frames,

How to Build

Source code are put in inc/ and src/. To compile the simulation program, simply type make. Compiled objects would appear in obj/, and there would be the executable file in root directory of the repository.

To compile the rendering program, GVDB-Voxels library and Nvidia OptiX ray tracing engine are needed. So please build gvdb-library at first. Then build the code in directory, gPointCloud/, which is modified from the sample code. For more information, please go to NVIDIA/gvdb-voxels.

How to Run

First of all, run make to generate the executable. Then prepare your own configuration file with format as follows:

model=MODEL

where MODEL is a JSON file formatted as:

{
  "model1": {
    "path": "PATH",
    "translate": [50.0, 0.0, 50.0],
    "scale": 0.5,
    "mass": 0.000026,
    "velocity": [0.0, -10.0, 0.0],
    "hardening": 15.0,
    "young": 1.4e5,
    "poisson": 0.2,
    "compression": 5.0e-2,
    "stretch": 5.0e-2
  }
}

The PATH is the ascii point cloud file where each line contains three values x y z seperated by a single space, and other parameters depend on your model setting. Finally, run

./test --config CONFIG_FILE

to simulate using MPM and render with OpenGL!

Screenshots

Letters falling scene

gpgpu free fall crashed completely

Two snow balls crashed each other

two snow balls crashed each other

References

Papers
Other Implementations

Contact

Issues and pull requests are welcomed, so are stars! ^_^ Feel free to contact project owner Sung Tzu-Wei, or contributors Yist Lin and Chen Li-Yu.

mpm's People

Contributors

yistlin avatar windqaq avatar jcly-rikiu avatar

Watchers

James Cloos avatar Yueh-Cheng Lin 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.