Smoothed particle hydrodynamics analysis and visualization with Python.
Plonk supports the following SPH file formats:
- Phantom output in HDF format.
Note: you can convert Phantom standard dumps to HDF. See the Phantom wiki.
To read in a simulation with dump files like
disc_00000.h5, ..., and evolution files like
disc01.ev, ..., in the current directory, and see what dumps there are:
>>> import plonk >>> simulation = plonk.Simulation(prefix='disc') >>> simulation.dumps [<plonk.Dump: "disc_00000.h5">, ... <plonk.Dump: "disc_01000.h5">]
The Dump objects contain the particle and sinks arrays, lazily loaded from the HDF5 file, as well as the dump header stored as a dictionary.
To visualize a single dump file:
>>> dump = plonk.Dump('disc_00000.h5') >>> plonk.Visualization( ... dump=dump, ... render='density', ... extent=[-200, 200, -200, 200] ... )
For further usage, see
examples folder and documentation. The code is internally documented with docstrings. Try, for example,
Plonk is a Python 3 only package.
The easiest and recommended way to install Plonk is via the package manager Conda
conda install plonk --channel dmentipl
conda config --add channels dmentipl conda install plonk
Note: Using this method you don't need to have this repository on your machine.
This will install the required dependencies. For details on Conda, see https://docs.conda.io/.
If you need help, try the following, in order:
- Check the documentation.
- Ask questions on Stack Overflow using the plonk tag.
- File an issue, as a bug report or feature request, using the issue tracker.
If you don't get an immediate response, please be patient. Plonk is run by one person, @dmentipl.
Thank you for considering contributing to Plonk. Contributions are welcome.
See CONTRIBUTING.md for guidelines on how to contribute.
If you use Plonk in a scientific publication, please cite
You should also consider citing any other scientific software packages that you use.