A PyTorch-based, differentiable two-dimensional shallow-water equations solver for end-to-end tsunami and flood modelling. The solver uses a structured square-cell model grid and Basilisk B-Flood/BG-Flood style finite-volume method.
git clone https://github.com/ZhonghouXu/DiffSWE2d.git
cd DiffSWE2d
conda create -n diffswe2d python=3.11
conda activate diffswe2d
pip install -r requirements.txtForward modelling (inference mode)
python ./Examples/forward/Monai_Valley/Monai_Valley_res001/example_run.pyInverse modelling
python ./Examples/inverse/Monai_Valley/Monai_Velley_BC_inversion_spline_lr002_6simg/bc_inversion_train.pyvideo_new_fps20.mp4
If you find this useful, consider citing: Xu, Z (2026). DiffSWE2d: a differentiable Shallow Water Equations solver for end-to-end flood and tsunami modelling. http://arxiv.org/abs/2609.11426