» StableFluids
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

StableFluids

plugin
Credits: Jos Stamhttp://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf

about

This project was a research project for the #node17 visuals and wasn't really aimed for production. It quite strictly reproduces the credited paper, since it mainly served as a reference for evaluating other algorithms and implementation attempts. The only deviations are the additional vorticity confinement routines, eliminating the restriction to a square and evenly spaced base grid, and using Jacobi instead of Gauss-Seidel solver in order to benefit from SIMD instructions.

The repo demonstrates one way how to take advantage of c++'s native speed (SSE instructions) in vvvv without the need for two separate dlls and interop.
https://github.com/woeishi/StableFluids for detailed info

Nodes

all nodes come 2d and 3d versions

  • StableFluid: Creates and holds a fluid simulation space
  • Evaluate: Drives the fluid simulation, giving access to global parameters
  • SetVelocity / SetDensity: Sets the velocities/densities of the entire fluid simulation space
  • AddVelocity / AddDensity: Adds velocities/densities to the entire fluid simulation space
  • AddRadialVelocity / AddRadialDensity: Adds velocities/densities around the given center to the fluid simulation space (think of it as an emitter)
  • AddRadial: Adds velocities and densities around the given center to the fluid simulation space
  • GetVelocity / GetDensity: Returns the velocities/densities of the enire fluid simulation space
  • Split: Returns the velocities and densities of the enire fluid simulation space
please check this list if your cpu is compatible

download

StableFluids_v1.0_avx.zip
26.10.17 [13:45 UTC] by woei | 1089 downloads
StableFluids_v1.0 x64 avx
Show 1 older revisions

Older Revisions

StableFluids_v1.0.zip
25.10.17 [12:55 UTC] by woei | 378 downloads
StableFluids_v1.0 x64 avx2

timpernagel 25/10/2017 - 16:06

Nice! (And <3 for using GDI Renderer)

io 26/10/2017 - 12:10

Red "Evaluate" node here and then it crashes within 20 seconds.

woei 26/10/2017 - 12:26

@io thats a bit unspecific. x64 and you processor must support avx extensions. wiki says intel processors since 2008 and amd 2011

io 26/10/2017 - 12:53

This is a i7 Sandybridge with GTX 675xm, 64bit machine and latest 64bit vvvv

woei 26/10/2017 - 13:22

evaluate is red once you open the help patch? does tty say anything?

woei 26/10/2017 - 13:30

ah, might be incompatible with avx2 extensions. let me check, if i can compile with avx only

io 26/10/2017 - 13:32

Red on open.

woei 26/10/2017 - 13:50

uploaded another version which should be compatible for older cpus. check the list though.

io 26/10/2017 - 13:57

Ok working now thanks

kopffarben 07/11/2017 - 19:33

Hi Woei,
on github you write you do this in c++ because it must be unmanaged for SSE/AVX.

Just for info you now this System.Numerics.Vectors?
It provides hardware-accelerated numeric types (SIMD), suitable for high-performance processing and graphics applications.

woei 08/11/2017 - 14:46

@kopffarben: yep, i know.
however numerics apply those instruction on vectors. which in this case is maximum 3. i do that on iteration which maxes to 8.
the cost of this algorithm is not really complicated arithmetics but just running a lot of loops over a lot of arrays. thus unmanaged outperformes .net quite a bit, since there is no boundschecking on array access.
cli would of course also optimize into simd instructions, but only for cases where you exactly loop from 0 to length-1 of the array. and that is nearly never the case here, due to special boundary conditions in the algorithm.

i've also got the same implementation in c# with all the performance optimizations i could think of. still didn't get near the speed of c++

anonymous user login

Shoutbox

~2d ago

joreg: Workshop on 09 05: Deepdive into the Stride 3D Engine. Signup here: https://thenodeinstitute.org/courses/ss24-vvvv-advanced-3d-rendering-in-vvvv-with-stride/

~2d ago

tekcor: Dear vvvv community, I am leaving my personal fundraiser here because I know many of you personally, sending love https://t.ly/iV9l_

~3d ago

joreg: Rewatch the 24th vvvvorldwide meetup here: https://www.youtube.com/live/gNszIiRAjDo?si=0RXF0pW73EUaRqGk

~3d ago

joreg: LINK - the vvvv summer camp 2024 is announced: https://visualprogramming.net/blog/2024/link-the-vvvv-summer-camp-24/

~5d ago

joreg: Tonight, May 3, vvvv meetup in Berlin or via stream: https://visualprogramming.net/blog/2024/24.-vvvv-worldwide-meetup/

~9d ago

joreg: Workshop on 02 05: Intro to the Stride 3D Engine. Signup here: https://thenodeinstitute.org/courses/ss24-vvvv-intro-to-the-stride-3d-engine-in-vvvv/

~10d ago

joreg: The new vvvv Show-Off-Reel is out: https://vimeo.com/930568091

~16d ago

joreg: The summer season of vvvv workshops at The NODE Institute is out: https://thenodeinstitute.org/ss24-vvvv-intermediates/