Python Codegen packages
Overview
This repository contains three python packages which build on top of each other
- pystencils: code generation for arbitrary stencil codes
- lbmpy: lattice Boltzmann code generation (build with pystencils)
- pygrandchem: special phase field model for ternary solidification based on pystencils
Documentation
The documentation can be accessed here.
Quick installation with package manager
pystencils requires Python>=3.5. If you have a recent distribution you can install the requirements with your package manager. If you use a older system or have no root access, read the next section.
For example on a recent Ubuntu you can install pystencils with:
# Get dependencies
apt install build-essential git python3-pip python3-numpy python3-appdirs python3-joblib python3-jinja2
# Clone repository
git clone https://i10git.cs.fau.de/software/pystencils.git && cd pystencils
python3 install_all.py
This gives you a minimal installation that can be used e.g. to create walberla kernels. If you want to setup, run, post-process and analyse your simulations directly from Python additional packages are helpful.
Full installation with conda
apt install graphviz ffmpeg # optional packages for visualization that don't come with conda
# Clone repository
git clone https://i10git.cs.fau.de/software/pystencils.git && cd pystencils
# Create environment with all required (and optional) packages
conda env create -f conda_environment_user.yml # for development use environment_dev.yml
source activate pystencils
python3 install_all.py
# Optional, if you have a NVidia GPU and CUDA is installed
pip install pycuda
# Open Jupyter notebook to view tutorials
jupyter notebook
Then navigate to pystencils/doc/notebooks
or lbmpy/doc/notebooks
and look at the IPython notebooks
as examples to get started.