Skip to main content

SPlisHSPlasH Project Python Bindings

Project description


      Documentation Status

SPlisHSPlasH is an open-source library for the physically-based simulation of fluids. The simulation in this library is based on the Smoothed Particle Hydrodynamics (SPH) method which is a popular meshless Lagrangian approach to simulate complex fluid effects. The SPH formalism allows an efficient computation of a certain quantity of a fluid particle by considering only a finite set of neighboring particles. One of the most important research topics in the field of SPH methods is the simulation of incompressible fluids. SPlisHSPlasH implements current state-of-the-art pressure solvers (WCSPH, PCISPH, PBF, IISPH, DFSPH, PF) to simulate incompressibility. Moreover, the library provides different methods to simulate viscosity, surface tension and vorticity.

The library uses the following external libraries: Eigen, json, partio, zlib, cxxopts, tinyexpr, toojpeg, pybind, glfw, and imgui or AntTweakBar. All external dependencies are included.

Furthermore we use our own libraries:

SPlisHSPlasH can export the particle data in the partio and vtk format. If you want to import partio files in Maya, try out our Maya plugin:

Author: Jan Bender, License: MIT

Build Instructions

This project is based on CMake. Simply generate project, Makefiles, etc. using CMake and compile the project with a compiler of your choice that supports C++11. The code was tested with the following configurations:

  • Windows 10 64-bit, CMake 3.18.3, Visual Studio 2019
  • Debian 9 64-bit, CMake 3.12.3, GCC 6.3.0.

Note: Please use a 64-bit target on a 64-bit operating system. 32-bit builds on a 64-bit OS are not supported.

Python Installation Instruction

For Windows and Linux targets there exists prebuilt python wheel files which can be installed using

pip install pysplishsplash

These are available for Python Versions: 2.7, 3.5, 3.6, 3.7, 3.8. If you do not meet these conditions please refer to the build instructions and to the python binding Getting started guide.

The command line simulator is available by running one of the following

splash
splash --help

Documentation

Features

SPlisHSPlasH implements:

  • an open-source SPH fluid simulation (2D & 3D)
  • neighborhood search on CPU or GPU
  • supports vectorization using AVX
  • Python binding (thanks to Stefan Jeske)
  • supports embedded Python scripts
  • several implicit pressure solvers (WCSPH, PCISPH, PBF, IISPH, DFSPH, PF)
  • explicit and implicit viscosity methods
  • current surface tension approaches
  • different vorticity methods
  • computation of drag forces
  • support for multi-phase simulations
  • simulation of deformable solids
  • rigid-fluid coupling with static and dynamic bodies
  • two-way coupling with deformable solids
  • fluid emitters
  • scripted animation fields
  • a json-based scene file importer
  • automatic surface sampling
  • a tool for volume sampling of closed geometries
  • a tool to generate spray, foam and bubble particles in a postprocessing step
  • partio file export of all particle data
  • VTK file export of all particle data (enables the data import in ParaView)
  • rigid body export
  • a Maya plugin to model and generate scene files
  • a ParaView plugin to import particle data

Pressure Solvers

The SPlisHSPlasH library implements the following pressure solvers:

  • Weakly compressible SPH for free surface flows (WCSPH)
  • Predictive-corrective incompressible SPH (PCISPH)
  • Position based fluids (PBF)
  • Implicit incompressible SPH (IISPH)
  • Divergence-free smoothed particle hydrodynamics (DFSPH)
  • Projective Fluids (PF)
  • Implicit compressible SPH (ICSPH)

Boundary Handling

The SPlisHSPlasH library implements the following boundary handling methods:

  • Nadir Akinci, Markus Ihmsen, Gizem Akinci, Barbara Solenthaler, and Matthias Teschner, "Versatile rigid-fluid coupling for incompressible SPH", ACM Transactions on Graphics 31(4), 2012

  • Dan Koschier and Jan Bender, "Density Maps for Improved SPH Boundary Handling", In Proceedings of ACM SIGGRAPH / EUROGRAPHICS Symposium on Computer Animation (SCA), 2017

  • Jan Bender, Tassilo Kugelstadt, Marcel Weiler, Dan Koschier, "Volume Maps: An Implicit Boundary Representation for SPH", ACM SIGGRAPH Conference on Motion, Interaction and Games, 2019

Viscosity

The SPlisHSPlasH library implements explicit viscosity methods:

  • Standard SPH formulation of viscosity
  • XSPH

and the implicit methods of the following publications:

  • Jan Bender and Dan Koschier, "Divergence-free SPH for incompressible and viscous fluids", IEEE Transactions on Visualization and Computer Graphics, 2017

  • Andreas Peer, Markus Ihmsen, Jens Cornelis, and Matthias Teschner, "An Implicit Viscosity Formulation for SPH Fluids", ACM Transactions on Graphics, 34(4), 2015

  • Andreas Peer and Matthias Teschner. Prescribed Velocity Gradients for Highly Viscous SPH Fluids with Vorticity Diffusion. IEEE Transactions on Visualization and Computer Graphics, 2016

  • An improved version of: Tetsuya Takahashi, Yoshinori Dobashi, Issei Fujishiro, Tomoyuki Nishita, and Ming C. Lin. Implicit Formulation for SPH-based Viscous Fluids. Computer Graphics Forum, 34, 2015.

  • Marcel Weiler, Dan Koschier, Magnus Brand and Jan Bender. A Physically Consistent Implicit Viscosity Solver for SPH Fluids. Computer Graphics Forum (Eurographics), 37(2), 2018

Surface Tension

The SPlisHSPlasH library implements the surface tension methods of the following publications:

  • Markus Becker and Matthias Teschner. Weakly compressible SPH for free surface flows. In Proceedings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2007. Eurographics Association.
  • Nadir Akinci, Gizem Akinci, and Matthias Teschner. Versatile surface tension and adhesion for SPH fluids. ACM Trans. Graph., 32(6):182:1–182:8, 2013.
  • Xiaowei He, Huamin Wang, Fengjun Zhang, Hongan Wang, Guoping Wang, and Kun Zhou, "Robust simulation of sparsely sampled thin features in SPH-based free surface flows", ACM Transactions on Graphics, 34(1), 2014.
  • F. Zorilla, M. Ritter, J. Sappl, W. Rauch, M. Harders, "Accelerating Surface Tension Calculation in SPH via Particle Classification and Monte Carlo Integration", Computers 9, 23, 2020.

Vorticity

The SPlisHSPlasH library implements the vorticity methods of the following publications:

  • Jan Bender, Dan Koschier, Tassilo Kugelstadt and Marcel Weiler. A Micropolar Material Model for Turbulent SPH Fluids. In Proceedings of ACM SIGGRAPH / EUROGRAPHICS Symposium on Computer Animation, 2017

  • Miles Macklin and Matthias Müller. Position based fluids. ACM Trans. Graph., 32(4):104:1–104:12, July 2013.

Drag Forces

The SPlisHSPlasH library implements the drag force computation of the following publications:

  • Christoph Gissler, Stefan Band, Andreas Peer, Markus Ihmsen and Matthias Teschner. Approximate Air-Fluid Interactions for SPH. In Proceedings of Virtual Reality Interactions and Physical Simulations, 2017

  • Miles Macklin, Matthias Müller, Nuttapong Chentanez and Tae-Yong Kim. Unified Particle Physics for Real-Time Applications. ACM Trans. Graph., 33(4), 2014

Elastic Forces

  • M. Becker, M. Ihmsen, and M. Teschner. Corotated SPH for deformable solids. Proceedings of Eurographics Conference on Natural Phenomena, 2009

  • A. Peer, C. Gissler, S. Band, and M. Teschner. An Implicit SPH Formulation for Incompressible Linearly Elastic Solids. Computer Graphics Forum, 2017

Multi-Phase Fluid Simulation

The SPlisHSPlasH library implements the following publication to realize multi-phase simulations:

  • B. Solenthaler and R. Pajarola. Density Contrast SPH Interfaces. In Proceedings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2008.

Screenshots

Videos

The following videos were generated using the SPlisHSPlasH library:

A Micropolar Material Model for Turbulent SPH Fluids Density Maps for Improved SPH Boundary Handling
Video Video
Divergence-Free Smoothed Particle Hydrodynamics Divergence-Free SPH for Incompressible and Viscous Fluids
Video Video
A Physically Consistent Implicit Viscosity Solver for SPH Fluids Turbulent Micropolar SPH Fluids with Foam
Video Video
Volume Maps: An Implicit Boundary Representation for SPH Implicit Frictional Boundary Handling for SPH
Video Video

References

  • Nadir Akinci, Gizem Akinci, and Matthias Teschner. Versatile surface tension and adhesion for SPH fluids. ACM Trans. Graph., 32(6):182:1–182:8, 2013.
  • Nadir Akinci, Markus Ihmsen, Gizem Akinci, Barbara Solenthaler, and Matthias Teschner, "Versatile rigid-fluid coupling for incompressible SPH", ACM Transactions on Graphics 31(4), 2012
  • Markus Becker and Matthias Teschner. Weakly compressible SPH for free surface flows. In Proceedings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2007. Eurographics Association.
  • M. Becker, M. Ihmsen, and M. Teschner. Corotated SPH for deformable solids. Proceedings of Eurographics Conference on Natural Phenomena, 2009
  • Jan Bender and Dan Koschier. Divergence-free smoothed particle hydrodynamics. In Proceedings of ACM SIGGRAPH / Eurographics Symposium on Computer Animation, 2015. ACM.
  • Jan Bender and Dan Koschier. Divergence-free SPH for incompressible and viscous fluids. IEEE Transactions on Visualization and Computer Graphics, 2017.
  • Jan Bender, Dan Koschier, Tassilo Kugelstadt and Marcel Weiler. A Micropolar Material Model for Turbulent SPH Fluids. In Proceedings of ACM SIGGRAPH / EUROGRAPHICS Symposium on Computer Animation, 2017
  • Jan Bender, Dan Koschier, Tassilo Kugelstadt and Marcel Weiler. Turbulent Micropolar SPH Fluids with Foam. IEEE Transactions on Visualization and Computer Graphics 25(6), 2019
  • Jan Bender, Tassilo Kugelstadt, Marcel Weiler, Dan Koschier, "Volume Maps: An Implicit Boundary Representation for SPH", ACM SIGGRAPH Conference on Motion, Interaction and Games, 2019
  • Jan Bender, Tassilo Kugelstadt, Marcel Weiler, Dan Koschier, "Implicit Frictional Boundary Handling for SPH", IEEE Transactions on Visualization and Computer Graphics, 2020
  • Jan Bender, Matthias Müller, Miguel A. Otaduy, Matthias Teschner, and Miles Macklin. A survey on position-based simulation methods in computer graphics. Computer Graphics Forum, 33(6):228–251, 2014.
  • Jan Bender, Matthias Müller, and Miles Macklin. Position-based simulation methods in computer graphics. In EUROGRAPHICS 2015 Tutorials. Eurographics Association, 2015.
  • Christoph Gissler, Stefan Band, Andreas Peer, Markus Ihmsen and Matthias Teschner. Approximate Air-Fluid Interactions for SPH. In Proceedings of Virtual Reality Interactions and Physical Simulations, 2017
  • C. Gissler, A. Henne, S. Band, A. Peer and M. Teschner. An Implicit Compressible SPH Solver for Snow Simulation, ACM Transactions on Graphics 39(4), 2020.
  • Xiaowei He, Huamin Wang, Fengjun Zhang, Hongan Wang, Guoping Wang, and Kun Zhou. Robust simulation of sparsely sampled thin features in SPH-based free surface flows. ACM Trans. Graph., 34(1):7:1–7:9, December 2014.
  • Markus Ihmsen, Nadir Akinci, Gizem Akinci, Matthias Teschner. Unified spray, foam and air bubbles for particle-based fluids. The Visual Computer 28(6), 2012
  • Markus Ihmsen, Jens Cornelis, Barbara Solenthaler, Christopher Horvath, and Matthias Teschner. Implicit incompressible SPH. IEEE Transactions on Visualization and Computer Graphics, 20(3):426–435, March 2014.
  • Markus Ihmsen, Jens Orthmann, Barbara Solenthaler, Andreas Kolb, and Matthias Teschner. SPH Fluids in Computer Graphics. In Eurographics 2014 - State of the Art Reports. The Eurographics Association, 2014.
  • Dan Koschier and Jan Bender, "Density Maps for Improved SPH Boundary Handling", In Proceedings of ACM SIGGRAPH / EUROGRAPHICS Symposium on Computer Animation (SCA), 2017
  • Miles Macklin and Matthias Müller. Position based fluids. ACM Trans. Graph., 32(4):104:1–104:12, July 2013.
  • Miles Macklin, Matthias Müller, Nuttapong Chentanez and Tae-Yong Kim. Unified Particle Physics for Real-Time Applications. ACM Trans. Graph., 33(4), 2014
  • A. Peer, C. Gissler, S. Band, and M. Teschner. An Implicit SPH Formulation for Incompressible Linearly Elastic Solids. Computer Graphics Forum, 2017
  • Andreas Peer, Markus Ihmsen, Jens Cornelis, and Matthias Teschner. An Implicit Viscosity Formulation for SPH Fluids. ACM Trans. Graph., 34(4), 2015.
  • Andreas Peer and Matthias Teschner. Prescribed Velocity Gradients for Highly Viscous SPH Fluids with Vorticity Diffusion. IEEE Transactions on Visualization and Computer Graphics, 2016.
  • Hagit Schechter and Robert Bridson. Ghost sph for animating water. ACM Trans. Graph., 31(4):61:1–61:8, July 2012.
  • B. Solenthaler and R. Pajarola. Density Contrast SPH Interfaces. In Proceedings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2008.
  • B. Solenthaler and R. Pajarola. Predictive-corrective incompressible SPH. ACM Trans. Graph., 28(3):40:1–40:6, July 2009.
  • Tetsuya Takahashi, Yoshinori Dobashi, Issei Fujishiro, Tomoyuki Nishita, and Ming C. Lin. Implicit Formulation for SPH-based Viscous Fluids. Computer Graphics Forum, 34, 2015.
  • Marcel Weiler, Dan Koschier and Jan Bender. Projective Fluids. Proceedings of the 9th International Conference on Motion in Games, ACM, 2016, 79-84
  • Marcel Weiler, Dan Koschier, Magnus Brand and Jan Bender. A Physically Consistent Implicit Viscosity Solver for SPH Fluids. Computer Graphics Forum (Eurographics), 37(2), 2018
  • F. Zorilla, M. Ritter, J. Sappl, W. Rauch, M. Harders, "Accelerating Surface Tension Calculation in SPH via Particle Classification and Monte Carlo Integration", Computers 9, 23, 2020.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pySPlisHSPlasH-2.10.1-cp38-cp38-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.8Windows x86-64

pySPlisHSPlasH-2.10.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

pySPlisHSPlasH-2.10.1-cp37-cp37m-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.7mWindows x86-64

pySPlisHSPlasH-2.10.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

pySPlisHSPlasH-2.10.1-cp36-cp36m-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.6mWindows x86-64

pySPlisHSPlasH-2.10.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

pySPlisHSPlasH-2.10.1-cp35-cp35m-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.5mWindows x86-64

pySPlisHSPlasH-2.10.1-cp27-cp27m-win_amd64.whl (3.4 MB view details)

Uploaded CPython 2.7mWindows x86-64

File details

Details for the file pySPlisHSPlasH-2.10.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pySPlisHSPlasH-2.10.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 52fefaa3d3ba2c2e18c7c9d137d8f5c9fe46eaa5b5c5f592b855f920912bb13d
MD5 376e9cf5a38b4f2b30921e89767b49aa
BLAKE2b-256 7ef80f32bf6023437edc761f6de8ae4281fbd5f75978bd4ec1b52e125196f2fd

See more details on using hashes here.

File details

Details for the file pySPlisHSPlasH-2.10.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9f8e139dace17ea3865fb95cb787975fa1dcaf7ac5357541c024a33e3125dbaf
MD5 c992c1f41ae704f049e876178e001310
BLAKE2b-256 2011a4203d3e7fb518d6afda8f8347851c425d2a0c9bb7a2d98e43e487da95f6

See more details on using hashes here.

File details

Details for the file pySPlisHSPlasH-2.10.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pySPlisHSPlasH-2.10.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.9

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fe74e3fa3623e27aaa8525b57820c0e8327045f39cdb71ea13094e71eddfddef
MD5 a20eb2fc367d26137abff7a3781e78d5
BLAKE2b-256 c0b103a5f454d68a2bd236ee9f270b376127e142ce1347a184aca3dc62f4d9fe

See more details on using hashes here.

File details

Details for the file pySPlisHSPlasH-2.10.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e1a9141c7174d8178fc4c6f5d4794a4dd3493a7715747a371c95de12ceea54f3
MD5 58456c7832f79ac8bf4abe01f0f9669c
BLAKE2b-256 c1b46bdde464eacca356101164d900825ddae1c1968597b644f3fef8d0ad0264

See more details on using hashes here.

File details

Details for the file pySPlisHSPlasH-2.10.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pySPlisHSPlasH-2.10.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.8

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 023ceba11550f88e54b084afff3d5fcbe7defae7f8ff6e22f34478d5be299f5c
MD5 9909059bda7f086a0e10070a90e6fc6d
BLAKE2b-256 e789223db570ec3f904440b61a8ec0b45f0c46c051c7c0ac10db935e055c53e6

See more details on using hashes here.

File details

Details for the file pySPlisHSPlasH-2.10.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 14f92bc88eb94960e3bfb57a233fd1ec1c1a1e55b0f7383f4409cf0918d62011
MD5 c5970677074d07e3c219b5e1ba691ee2
BLAKE2b-256 c5bf349053117f63fdc317e802188044f3ba7c80c3e51157e82dc78d45b3f9e8

See more details on using hashes here.

File details

Details for the file pySPlisHSPlasH-2.10.1-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pySPlisHSPlasH-2.10.1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.5.4

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 f55e39c99f3dde70298b86574ee39db687da0ebb0b98d6bff03a00b7f0d774af
MD5 dda2b554072131acfcd8bd5c4d3b852b
BLAKE2b-256 26429432441e004d69ac91549d4c00f1d7109264f7f78921704a94752069e258

See more details on using hashes here.

File details

Details for the file pySPlisHSPlasH-2.10.1-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: pySPlisHSPlasH-2.10.1-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/2.7.18

File hashes

Hashes for pySPlisHSPlasH-2.10.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2b10060e05f2392a6282930573c333f81455fa3b5bebf535e6f50092a4cc8bb0
MD5 05acbe5ac9379c8f3fe26be91e2b0546
BLAKE2b-256 593c85bc6dd5eb4f52acbd67015c62b11a8612183a6b0964f0896e9b5d969b11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page