Skip to content

robkau/mlsmpm-particles-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mlsmpm-particles-go

This repository simulates and renders fluid particles in two dimensions.
Click HERE to run the simulation in a browser.

The simulation uses MLS-MPM algorithm (Moving Least Squares Material Point Method).
I implemented this by following nialltl's article on MLS-MPM and matching example code.

Library ebiten is used to render the output to a window and allows seamless compilation to WASM.
The simulation is single threaded but still renders the examples in real time on a fast CPU.

Running this in WASM in the browser is about 10x slower than native speed. WebGL support may help when it finally arrives...

Build and run the cmd/sim package to run simulation at native speed.


Example Videos

i-0-30.mov
i-60-15.mov
i-120-12.mov
i-180-8.mov
i-210-8.mov
streamers-512.mov