Opensource code for Multi-GPU MPM. It is a modified fork from opensource code page for the SIGGRAPH 2020 paper:
A Massively Parallel and Scalable Multi-GPU Material Point Method
Authors: Xinlei Wang*, Yuxing Qiu*, Stuart R. Slattery, Yu Fang, Minchen Li, Song-Chun Zhu, Yixin Zhu, Min Tang, Dinesh Manocha Chenfanfu Jiang (* Equal contributions)
This is a cross-platform C++/CUDA cmake project. The minimum version requirement of cmake is 3.16, yet the latest version is generally recommended. The required CUDA version is 10.2 or 11.
Currently, supported OS includes Windows 10 and Ubuntu (>=18.04), and tested compilers includes gcc8.4, msvc v142, clang-9 (includes msvc version).
Run the following command in the root directory. Note that adding "--config Release" to the last command is needed when compiling using msvc.
cd build
cmake ..
cmake --build .
Or configure the project using the CMake Tools extension in Visual Studio Code (recommended).
Time-Integration (Explicit) Material models (Fixed-corotated, NA Cam-Clay, Drucker-Prager, Weakly Comp. Fluid) Shape Function (2nd Order B-Spline) Transfer Scheme (Affine Particle-In-Cell) Kernel (Grid-to-Particle-to-Grid)
JSON input files are used to configure some simulation settings.
Currently, binary position data and the level-set (signed distance field) data are accepted as input files for particles. Uniformly sampling particles from analytic geometries is another viable way for the initialization of models.
Starting from an *.obj or *.stl file, SDFGen page can make appropiate *.sdf files.
Particle output includes
Position (x, y, z) Stress (
$\sigma_{1}$ ,$\sigma_{2}$ ,$\sigma_{3}$ ) Deformation Gradient ($J = ||F||$ )
Particle data is segmented by object and device.
Grid output includes
Index (x, y, z) Mass (m) Momentum (
$M_{x}$ ,$M_{y}$ ,$M_{z}$ )
Grid data is dynamic (inactive cells not included) and down-sampled (one block output per 4x4x4 cells)
Outputs are binary geometry files (*.bgeo). Houdini Apprentice can render these efficiently.
The project provides the following GPU-based schemes for MPM:
- GMPM: Improved single-GPU pipeline
- MGSP: Static geometry (particle) partitioning multi-GPU pipeline
- WASIRF: Single-GPU simulation of flume experiments.
Go to Projects/**, run the executable.
Use the codebase in another cmake c++ project.
Directly include the codebase as a submodule, and follow the examples in the Projects.
Develop upon the codebase.
Create a sub-folder in Projects with a cmake file at its root.
Please cite the original paper if you use this code for your research:
@article{Wang2020multiGMPM,
author = {Xinlei Wang* and Yuxing Qiu* and Stuart R. Slattery and Yu Fang and Minchen Li and Song-Chun Zhu and Yixin Zhu and Min Tang and Dinesh Manocha and Chenfanfu Jiang},
title = {A Massively Parallel and Scalable Multi-GPU Material Point Method},
journal = {ACM Transactions on Graphics},
year = {2020},
volume = {39},
number = {4},
articleno = {Article 30}
}
This project draws inspirations from Taichi, GMPM.
The following libraries are adopted in our project development:
For particle data IO and generation, we use these two libraries in addition:
Due to the C++ standard requirement (at most C++14) for compiling CUDA (10.2) code, we import these following libraries as well: