pcisph-wasm
2D Predictive-Corrective Smoothed Particle Hydrodynamics (SPH) implementation in Rust with WASM + WebGL
Reimplementation of my previous Rust PCISPH repository now including a WASM thread parallel solver using wasm-bindgen-rayon
For further information, see SPH tutorials on my website, including an introduction to SPH math and a simple SPH solver.
Demo
Since Github Pages does not support setting HTTP headers, this project is deployed on Netlify after building with Github Actions.
Usage
Install dependencies
npm install
rustup install nightly
Compile WASM, run webpack, and spawn a local server (note you might need to download additional rust-src, etc. with rustup)
npm run serve
Then visit http://localhost:8080
Note
This solver is not exactly PCISPH, but can be viewed as 1-iteration of SPH relaxation plus sub-stepping. The “prediction-relaxation” scheme of my implementation actually comes mainly from the (much easier to follow) paper "Particle-based Viscoelastic Fluid Simulation”, as opposed to "Predictive-Corrective Incompressible SPH”.