Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PySPH: a Python-based SPH framework

Shippable Status Appveyor Status Codeship Status

PySPH is an open source framework for Smoothed Particle Hydrodynamics (SPH) simulations. It is implemented in Python and the performance critical parts are implemented in Cython.

PySPH allows users to write their high-level code in pure Python. This Python code is automatically converted to high-performance Cython which is compiled and executed. PySPH can also be configured to work seamlessly with OpenMP and MPI.

The latest documentation for PySPH is available at pysph.readthedocs.org.

Here are videos of some example problems solved using PySPH.

Features

  • Flexibility to define arbitrary SPH equations operating on particles in pure Python.

  • Define your own multi-step integrators in pure Python.

  • High-performance: our performance is comparable to hand-written solvers implemented in FORTRAN.

  • Seamless multi-core support with OpenMP.

  • Seamless parallel support using Zoltan.

SPH formulations

PySPH ships with a variety of standard SPH formulations along with basic examples. Some of the formulations available are:

Installation

Up-to-date details on how to install PySPH on Linux/OS X and Windows are available from here.

If you wish to see a working build/test script please see our shippable.yml. Or you could see the build script hosted at drone.io or for Windows platforms see the appveyor.yml.

Running the examples

You can verify the installation by exploring some examples. A fairly quick running example (taking about 20 seconds) would be the following:

$ pysph run elliptical_drop

This requires that Mayavi be installed. The saved output data can be viewed by running:

$ pysph view elliptical_drop_output/

A more interesting example would be a 2D dam-break example (this takes about 30 minutes in total to run):

$ pysph run dam_break_2d

The solution can be viewed live by running (on another shell):

$ pysph view

The generated output can also be viewed and the newly generated output files can be refreshed on the viewer UI.

A 3D version of the dam-break problem is also available, and may be run as:

$ pysph run dam_break_3d

This runs the 3D dam-break problem which is also a SPHERIC benchmark Test 2

Three-dimensional dam-break example

PySPH is more than a tool for wave-body interactions::

$ pysph run cavity

This runs the driven cavity problem using the transport velocity formulation of Adami et al. The output directory cavity_output will also contain streamlines and other post-processed results after the simulation completes. For example the streamlines look like the following image:

Lid-driven-cavity example

If you want to use PySPH for elastic dynamics, you can try some of the examples from the pysph.examples.solid_mech package:

$ pysph run solid_mech.rings

Which runs the problem of the collision of two elastic rings:

Collision of two steel rings

The auto-generated code for the example resides in the directory ~/.pysph/source. A note of caution however, it’s not for the faint hearted.

There are many more examples, they can be listed by simply running:

$ pysph run

Credits

PySPH is primarily developed at the Department of Aerospace Engineering, IIT Bombay. We are grateful to IIT Bombay for their support. Our primary goal is to build a powerful SPH based tool for both application and research. We hope that this makes it easy to perform reproducible computational research.

Lead developers:

Earlier developers:

  • Pankaj Pandey (stress solver and improved load balancing, 2011)

  • Chandrashekhar Kaushik (original parallel and serial implementation in 2009)

Support

If you have any questions or are running into any difficulties with PySPH, please email or post your questions on the pysph-users mailing list here: https://groups.google.com/d/forum/pysph-users

Please also take a look at the PySPH issue tracker.

Metadata

Release files for PySPH 1.0a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for PySPH 1.0a4
File Size Uploaded Provenance
PySPH-1.0a4.zip 2.4 MB Without provenance Details
PySPH-1.0a4.tar.gz 2.3 MB Without provenance Details
PySPH-1.0a4.tar.bz2 2.3 MB Without provenance Details

Release files / PySPH-1.0a4.zip

Download URL PySPH-1.0a4.zip
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
11feaaee029a0da409e19140135258064e261bd1b8ab03f6aa46825e76195b7e
BLAKE2b-256 checksum
How to use checksums
7ceaa927c092882065e26ce290886abd3d55f52e813b17cb67665cf3219098ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PySPH-1.0a4.tar.gz

Download URL PySPH-1.0a4.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
0fbaa9516208860bc62ce3a7cb2f0f648223e5285dc1314670963ab50bd24822
BLAKE2b-256 checksum
How to use checksums
22801ddfc05058f93fe82152ab81e0515513b20ab2efa3daddf3ecb0218d010f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PySPH-1.0a4.tar.bz2

Download URL PySPH-1.0a4.tar.bz2
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
c7b33307a395f8cf098d4d5f8cc75a163e8f19ff8d5b280bbe331e744129b89c
BLAKE2b-256 checksum
How to use checksums
9aaa8b57b3d7e80e60513077963b42fb682202a3d7977a5175dc4a1cbbdd2532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for PySPH 1.0a4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page