PyClaw: Accessible, Extensible, Scalable Tools for Wave Propagation Problems
Development of scientific software involves tradeoffs between ease of use, generality, and performance. We describe the design of a general hyperbolic PDE solver that can be operated with the convenience of MATLAB yet achieves efficiency near that of hand-coded Fortran and scales to the largest supercomputers. This is achieved by using Python for most of the code while employing automatically wrapped Fortran kernels for computationally intensive routines, and using Python bindings to interface with a parallel computing library and other numerical packages. The software described here is PyClaw, a Python-based structured grid solver for general systems of hyperbolic PDEs [K. T. Mandli et al., PyClaw Software, Version 1.0, http://numerics.kaust.edu.sa/pyclaw/ (2011)]. PyClaw provides a powerful and intuitive interface to the algorithms of the existing Fortran codes Clawpack and SharpClaw, simplifying code development and use while providing massive parallelism and scalable solvers via the PETSc library. The package is further augmented by use of PyWENO for generation of efficient high-order weighted essentially nonoscillatory reconstruction code. The simplicity, capability, and performance of this approach are demonstrated through application to example problems in shallow water flow, compressible flow, and elasticity.
1. , On the performance of the Python programming language for serial and parallel scientific computations , Sci. Program. , 13 ( 2005 ), pp. 31 -- 56 .
2. , Logically rectangular grids and finite volume methods for PDEs in circular and spherical domains , SIAM Rev. , 50 ( 2008 ), pp. 723 -- 752 .
3. M. Emmett, PyWENO Software Package, http://memmett.github.com/PyWENO (2011).
4. , GPAW - massively parallel electronic structure calculations with Python-based software , Procedia Computer Science , 4 ( 2011 ), pp. 17 -- 25 .
5. , Guest editors' introduction: Reproducible research , Comput. Sci. Eng. , 11 ( 1 ) ( 2009 ), pp. 5 -- 7 .
6. , FiPy: Partial differential equations with Python , Comput. Sci. Eng. , 11 ( 3 ) ( 2009 ), pp. 6 -- 15 .
7. , The motion of atmospheric disturbances on a spherical earth , J. Marine Research , 3 ( 1940 ), pp. 254 -- 267 .
8. , Highly efficient strong stability-preserving Runge--Kutta methods with low-storage implementations , SIAM J. Sci. Comput. , 30 ( 2008 ), pp. 2113 -- 2136 .
WENOCLAW: A higher order wave propagation method, in Hyperbolic Problems: Theory, Numerics , Applications, Springer, Berlin , 2008 , pp. 609 -- 616 .
10. D. I. Ketcheson and M. Parsani, SharpClaw Software, http://numerics.kaust.edu.sa/sharpclaw (2011).
11. D. I. Ketcheson, M. Parsani, and R. J. LeVeque, High-Order Wave Propagation Algorithms for General Hyperbolic Systems, http://arxiv.org/abs/1111.3499.
On the efficiency of Python for high-performance computing: A case study involving stencil updates for partial differential equations, in Modeling, Simulation and Optimization of Complex Processes , H. G. Block, E. Kostina, H. X. Phu, and R. Rannacher, eds., Springer , Berlin , 2008 , pp. 337 -- 358 .
13. . Liu, Solution of two-dimensional Riemann problems of gas dynamics by positive schemes , SIAM J. Sci. Comput. , 19 ( 1998 ), pp. 319 -- 340 .
14. . LeVeque, Wave propagation algorithms for multidimensional hyperbolic systems , J. Comput. Phys. , 131 ( 1997 ), pp. 327 -- 353 .
15. , Finite Volume Methods for Hyperbolic Problems, Cambridge University Press, Cambridge, UK, 2002 .
16. R. J. LeVeque and M. J. Berger, Clawpack Software Version \textup4.5, http://www.clawpack.org (2011).
17. , Solitary waves in layered nonlinear media , SIAM J. Appl. Math. , 63 ( 2003 ), pp. 1539 -- 1560 .
18. K. T. Mandli, D. I. Ketcheson, et al., PyClaw Software, Version 1.0, http://numerics.kaust. edu.sa/pyclaw/ (2011).
19. Python to solve partial differential equations , Comput. Sci. Eng. , 9 ( 3 ) ( 2007 ), pp. 48 -- 51 .
20. , Real-space grid implementation of the projector augmented wave method , Phys. Rev. B , 71 ( 2005 ), 035109 .
21. , Simplifying the parallelization of scientific codes by a function-centric approach in Python , Computational Science & Discovery , 3 ( 2010 ), 015003 .
22. T. Oliphant, NumPy Web Page, http://numpy.scipy.org (2011).
23. , Python: An ecosystem for scientific computing , Comput. Sci. Eng. , 13 ( 2 ) ( 2011 ), pp. 13 -- 21 .
24. , Nonlinear Wave Propagation and Solitary Wave Formation in Two-Dimensional Heterogeneous Media , M.Sc. thesis, King Abdullah University of Science and Technology (KAUST) , Thuwal, Saudi Arabia, 2011 ; available online from http://numerics.kaust.edu.sa/papers/quezada-thesis/quezada-thesis.html.
25. , Radial Solitary Waves in Two-Dimensional Periodic Media, manuscript , 2011 .
26. . Shu, A technique of treating negative weights in WENO schemes , J. Comput. Phys. , 175 ( 2002 ), pp. 108 -- 127 .
27. , Reproducible research: Addressing the need for data and code sharing in computational science , Comput. Sci. Eng. , 12 ( 5 ) ( 2010 ), pp. 8 -- 13 .
28. , On the construction and comparison of difference schemes , SIAM J. Numer. Anal. , 5 ( 1968 ), pp. 506 -- 517 .
29. , Numerical simulations of Rossby-Haurwitz waves , Tellus A , 52A ( 2000 ), pp. 181 -- 189 .
30. , A standard test set for numerical approximations to the shallow water equations on the sphere , J. Comput. Phys. , 102 ( 1992 ), pp. 221 -- 224 .