gregtj / stable-fluids Goto Github PK
View Code? Open in Web Editor NEWA minimal Stable Fluids inspired fluid solver with Python and NumPy.
License: The Unlicense
A minimal Stable Fluids inspired fluid solver with Python and NumPy.
License: The Unlicense
The original paper uses a nifty set_bnd
function that was very easy to extend that allowed boundary conditions to be set, e.g. adding walls to the box, preventing densities (and velocities) from escaping. Furthermore, interesting effects could be achieved by adding internal boundaries of various shapes. In this very beautiful and awesome re-implementation of the paper the boundary conditions is not possible to specify. After reading the code, it seems very doable. Perhaps you prefer to have it completely outside the Fluid
class? ๐ค
In the original paper a delta-time parameter is used, this allows duration to be expressed in seconds rather that frames, and also the viscosity and velocities and other vectors can have more sane units. In my humble opinion pixels/frame^2 is trickier to think about compared to pixels/s^2... ๐ค Furthermore, after studying the code it should be fairly easy to add a delta time parameter to both advect_diffuse()
and project()
functions. Possibly with default value of dt=1
.
I just cloned and run this, installing latest numpy and scipy. I'm getting the following warning:
SparseEfficiencyWarning: splu requires CSC matrix format
Perhaps this blazing fast simulation can be speed up even further if whatever function is emitting this warning is given a sparse csc matrix instead?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.