GPU Optimizations of Material Point Method and Collision Detection
Xinlei Wang, 王鑫磊 浙江大学
Collision Detection Xinlei Wang, Material Point Method Fluid - - PowerPoint PPT Presentation
GPU Optimizations of Material Point Method and Collision Detection Xinlei Wang, Material Point Method Fluid Smoothed-Particle Hydrodynamics Grid-based Methods Solid Finite Element Method Finite
Xinlei Wang, 王鑫磊 浙江大学
𝑛𝑞
𝑜 𝑤𝑞 𝑜 𝑦𝑞 𝑜
𝑛𝑗
𝑜 𝑞𝑗 𝑜
𝑤𝑗
𝑜+1
particle to grid
𝑤𝑞
𝑜+1 𝐺 𝑞 𝑜+1
grid to particle
𝑦𝑞
𝑜+1
advection transfer time integration
Maintain Structures
Rasterize
momentum, etc.)
Time Integration
𝑜+1 = (𝑞𝑗 𝑜 + 𝜀𝑢 ∗ 𝑔𝑓𝑦𝑢)/𝑛𝑗 𝑜
𝑜+1
Resample
Advection
deformation gradient, etc)
Lagrangian material paticles Eulerian Cartesian grids
explicit implicit
Up to 90%
Gather (node based) Scatter (particle based)
n n+1 n+2 n+4 notation grid node particle 1 2 3 4 5 6 7 transfer 1 2 3 4 5 6 7 n n+1 n+2 n+3
Discontinuity and Two-Way Rigid Body Coupling
cuda-mpm-sand-simulation-for-vfx.mp4
region region 1 region 2 region 3
iteration 0, stride 1 iteration 1, stride 2 node n node n+1 node n+2 node n+3 sh shared memory
ballot clz shfl warp intrinsics
CPU:18-core Intel Xeon Gold 6140, ¥16000 GPU:Nvidia Titan XP, ¥8000
5 10 15 20 Gaussian_μ=10 Uniform_μ=10 Gaussian_μ=18 Uniform_μ=18 Mapping Stress P2G G2P Re-Sorting m s
2 4 6 8 10 Reorder No Reorder Mapping Stress P2G Solver G2P Sorting Others
(or Velocity Gradient)
3 1 5 4 2 7 6 7 1 6 4 5 2 3 particle index step n step n+1 𝑛0
𝑜 𝑛1 𝑜 𝑛2 𝑜 𝑛3 𝑜 𝑛4 𝑜 𝑛5 𝑜 𝑛6 𝑜 𝑛7 𝑜
𝑤3
𝑜
𝑤4
𝑜
𝑤1
𝑜
𝑤2
𝑜
𝑤6
𝑜
𝑤0
𝑜
𝑤7
𝑜
𝑤5
𝑜
𝑦3
𝑜
𝑦1
𝑜
𝑦5
𝑜
𝑦4
𝑜
𝑦0
𝑜
𝑦2
𝑜
𝑦7
𝑜
𝑦6
𝑜
𝑛0
𝑜 𝑛1 𝑜 𝑛2 𝑜 𝑛3 𝑜 𝑛4 𝑜 𝑛5 𝑜 𝑛6 𝑜 𝑛7 𝑜
𝑤3
𝑜
𝑤1
𝑜
𝑤5
𝑜
𝑤4
𝑜
𝑤0
𝑜
𝑤2
𝑜
𝑤7
𝑜
𝑤6
𝑜
𝑦7
𝑜
𝑦1
𝑜
𝑦6
𝑜
𝑦4
𝑜
𝑦5
𝑜
𝑦2
𝑜
𝑦0
𝑜
𝑦3
𝑜
3 4 1 2 6 7 5 step n-1 𝑛0
𝑜 𝑛1 𝑜 𝑛2 𝑜 𝑛3 𝑜 𝑛4 𝑜 𝑛5 𝑜 𝑛6 𝑜 𝑛7 𝑜
𝑦3
𝑜
𝑦4
𝑜
𝑦1
𝑜
𝑦2
𝑜
𝑦6
𝑜
𝑦0
𝑜
𝑦7
𝑜
𝑦5
𝑜
particle attribute
Particle Attribute (Dimension) Read Write
arbitrary contiguous arbitrary contiguous
mass (1) 1 1 1 position (d) 1 3 1+1 velocity (d) 1 1 1+1 deformation gradient (d*d) 1 1 1+1 … … … Access times per-particle per-timestep Particle Attribute (Dimension) Read Write
arbitrary contiguous arbitrary contiguous
mass (1) 1 position (d) 1 3 1+1 velocity (d) 1 1 deformation gradient (d*d) 1 1 … … …
2 4 6 8 10 Reorder No Reorder Mapping Stress P2G Solver G2P Sorting Others
using escape index Linear BVH built on top of primitives sorted by their Morton codes
using escape index Depth-first order traversal track
with all the other primitives
4 2 1 0 3 6 5
0 1 2 3 4 5 6
to bottom
4 2 6 1 3 3 4 5 5 6 7 2 1 1 5 3 1 4 3 4 6 5 6 7 2 2 Sort
2~3x speedup !
https://github.com/littlemine Xinlei Wang, 王鑫磊
https://www.3dgep.com/cuda-thread-execution-model/
attributes
PIC/FLIP/APIC)