GPU-accelerated geomorphological and hydraulic flow modeling powered by Taichi
A lot of work will be put into finalising v1.0 in Q1 2026 + paper
PyFastFlow is a high-performance Python package for general geomorphological and hydrodynamic computations on GPU. Built on the Taichi programming language with bindings to pytopotoolbox, it provides efficient, portable parallel algorithms for flow accumulation, depression filling, (simple) shallow water flow modeling, and landscape evolution simulations.
The fast flow routines are implemented following Jain et al., 2024 📝, delivering state-of-the-art performance for GPU-oriented flow computation (flow accumulation and local minima handling).
The flooding/hydraulic modelling implements a GPU version of GraphFlood (Gailleton et al., 2024) for stationary solutions and an implementation of Bates et al., 2010 and inertial flow.
- GPU-accelerated flow routing: Steepest descent algorithms with multiple boundary conditions
- Advanced depression filling: Priority flood and carving algorithms for handling closed basins
- Flow accumulation: Efficient rake-and-compress algorithms for parallel tree traversal
- Boundary conditions: Normal, periodic (EW/NS), and custom per-node boundary handling
- LisFlood implementation: Bates et al. 2010 explicit finite difference scheme
- GraphFlood: Fast approximation of the 2D shallow water 2D stationary solution
- Manning's friction: Configurable roughness coefficients
- Precipitation input: Rainfall and boundary conditions
- Refactor in progress, not usable right now
- Stream Power Law (SPL): Bedrock erosion with detachment and transport-limited models
- Sediment transport: Erosion-deposition coupling with transport capacity
- Tectonic uplift: Block and spatially-varying uplift patterns
- Non linear hillslope: Based on Carretier et al. 2016
- Hillshading: GPU-accelerated terrain shading with multiple illumination models
- Real-time 3D visualization: Interactive terrain rendering with using mordernGL (Experimental)
- Field pooling system: Efficient GPU memory management for taichi with automatic field reuse/clean
- General Parallel algorithms: Utilities written in taichi (e.g. Blelloch parallel scan, ping-pong, swap, ...)
- Scalable: Handles large grids (up to hundreds of millions of nodes) efficiently
pip install pyfastflowgit clone https://github.com/bgailleton/pyfastflow.git
cd pyfastflow
pip install -e .- Python ≥ 3.9
- Taichi ≥ 1.4.0
- NumPy ≥ 1.20.0
- Matplotlib ≥ 3.3.0 (for visualization)
WIP
- Flow routing through local minimas: Improved depression handling with Cordonnier et al. (2019) adapted to GPU by Jain et al. (2024)
- Rake-and-Compress: Parallel flow accumulation following Jain et al. (2024)
- LisFlood: Explicit finite difference scheme (Bates et al., 2010)
- GraphFlood: Graph-based implicit flow routing (Gaileton et al., 2024)
- Stream Power Law: E = K × A^m × S^n erosion model (Howard and Kerby 1983)
- Transport-Limited: Erosion-transport-deposition coupling (Davy and Lague, 2009 style - WIP)
- Non linear hillslope: adapted from CIDRE with a semi-implicit scheme (Carretier et al., 2016 - WIP)
CeCILL v2.1
If you use PyFastFlow in your research, please contact me.
- Jain, A., et al. (2024). "Fast Flow Computation using GPU". Proceedings of Graphics Interface 2024.
- Bates, P. D., et al. (2010). "A simple inertial formulation of the shallow water equations". Journal of Hydrology.
Main Authors:
- Boris Gailleton - Géosciences Rennes - boris.gailleton@univ-rennes.fr
- Guillaume Cordonnier - INRIA Sophia Antipolis
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Documentation: Read the Docs (coming soon - hopefully)
- Repository: https://github.com/bgailleton/pyfastflow
- Documentation: https://pyfastflow.readthedocs.io/ (coming soon)
- PyPI Package: https://pypi.org/project/pyfastflow/ (coming soon)
- Jain et al. 2024 Paper: PDF