Skip to content

Baseline taichi code used in DiffFR (SIGGRAPH Asia 2023)

Notifications You must be signed in to change notification settings

zhehaoli1999/DFSPH_difftaichi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPH Taichi

A high-performance implementation of Smooth Particle Hydrodynamics (SPH) simulator in Taichi. (working in progress)

Examples

  • Dragon Bath (~420 K particles, ~280 FPS on RTX 3090 GPU, with timestep 4e-4)

  • Armadillo Bath (~1.74 M particles, ~80 FPS on RTX 3090 GPU, with timestep 4e-4)

Features

Currently, the following features have been implemented:

  • Cross-platform: Windows, Linux
  • Support massively parallel GPU computing
  • Weakly Compressible SPH (WCSPH)[1]
  • One-way/two-way fluid-solid coupling[2]
  • Shape-matching based rigid-body simulator[3]
  • Neighborhood search accelerated by GPU parallel prefix sum + counting sort

Note

The GPU parallel prefix sum is only supported by cuda/vulkan backend currently.

Install

python -m pip install -r requirements.txt

To reproduce the demos show above:

python run_simulation.py --scene_file ./data/scenes/dragon_bath.json
python run_simulation.py --scene_file ./data/scenes/armadillo_bath_dynamic.json

Reference

  1. M. Becker and M. Teschner (2007). "Weakly compressible SPH for free surface flows". In:Proceedings of the 2007 ACM SIGGRAPH/Eurographics symposium on Computer animation. Eurographics Association, pp. 209–217.
  2. N. Akinci, M. Ihmsen, G. Akinci, B. Solenthaler, and M. Teschner. 2012. Versatile rigid-fluid coupling for incompressible SPH. ACM Transactions on Graphics 31, 4 (2012), 62:1–62:8.
  3. Miles Macklin, Matthias Müller, Nuttapong Chentanez, and Tae-Yong Kim. 2014. Unified particle physics for real-time applications. ACM Trans. Graph. 33, 4, Article 153 (July 2014), 12 pages.

Acknowledgement

Implementation is largely inspired by SPlisHSPlasH.

Diff-Taichi with DFSPH

Try

python run_simulation_diff_forward_checker.py --scene_file ./data/scenes/armadillo_bath_small_rigid_box.json

to enable GPU scene preview.

Try

python run_simulation_diff_forward.py --scene_file ./data/scenes/armadillo_bath_small_rigid_box.json

to calculate gradient in forward mode autodiff

About

Baseline taichi code used in DiffFR (SIGGRAPH Asia 2023)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages