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.  X. Cai H. P. Langtangen and  H. Moe , On the performance of the Python programming language for serial and parallel scientific computations , Sci. Program. , 13 ( 2005 ), pp. 31 -- 56 . Google Scholar

  • 2.  D. A. Calhoun C. Helzel and  R. J. LeVeque , Logically rectangular grids and finite volume methods for PDEs in circular and spherical domains , SIAM Rev. , 50 ( 2008 ), pp. 723 -- 752 . LinkISIGoogle Scholar

  • 3.  M. Emmett, PyWENO Software Package, http://memmett.github.com/PyWENO (2011).Google Scholar

  • 4.  J. Enkovaara N. A. Romero S. Shende and  J. J. Mortensen , GPAW - massively parallel electronic structure calculations with Python-based software , Procedia Computer Science , 4 ( 2011 ), pp. 17 -- 25 . CrossrefGoogle Scholar

  • 5.  S. Fomel and  J. F. Claerbout , Guest editors' introduction: Reproducible research , Comput. Sci. Eng. , 11 ( 1 ) ( 2009 ), pp. 5 -- 7 . CrossrefISIGoogle Scholar

  • 6.  J. E. Guyer D. Wheeler and  J. A. Warren , FiPy: Partial differential equations with Python , Comput. Sci. Eng. , 11 ( 3 ) ( 2009 ), pp. 6 -- 15 . CrossrefISIGoogle Scholar

  • 7.  B. Haurwitz , The motion of atmospheric disturbances on a spherical earth , J. Marine Research , 3 ( 1940 ), pp. 254 -- 267 . Google Scholar

  • 8.  D. I. Ketcheson , Highly efficient strong stability-preserving Runge--Kutta methods with low-storage implementations , SIAM J. Sci. Comput. , 30 ( 2008 ), pp. 2113 -- 2136 . LinkISIGoogle Scholar

  • 9.  D. I. Ketcheson and  R. J. LeVeque , WENOCLAW: A higher order wave propagation method , in Hyperbolic Problems: Theory, Numerics , Applications, Springer, Berlin , 2008 , pp. 609 -- 616 . CrossrefGoogle Scholar

  • 10.  D. I. Ketcheson and M. Parsani, SharpClaw Software, http://numerics.kaust.edu.sa/sharpclaw (2011).Google Scholar

  • 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.Google Scholar

  • 12.  H. P. Langtangen and  X. Cai , 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 . CrossrefGoogle Scholar

  • 13.  P. D. Lax . Liu, Solution of two-dimensional Riemann problems of gas dynamics by positive schemes , SIAM J. Sci. Comput. , 19 ( 1998 ), pp. 319 -- 340 . LinkISIGoogle Scholar

  • 14.  R. . LeVeque, Wave propagation algorithms for multidimensional hyperbolic systems , J. Comput. Phys. , 131 ( 1997 ), pp. 327 -- 353 . CrossrefISIGoogle Scholar

  • 15.  R. J. LeVeque , Finite Volume Methods for Hyperbolic Problems, Cambridge University Press, Cambridge, UK, 2002 . Google Scholar

  • 16.  R. J. LeVeque and M. J. Berger, Clawpack Software Version \textup4.5, http://www.clawpack.org (2011).Google Scholar

  • 17.  R. J. LeVeque and  D. H. Yong , Solitary waves in layered nonlinear media , SIAM J. Appl. Math. , 63 ( 2003 ), pp. 1539 -- 1560 . LinkISIGoogle Scholar

  • 18.  K. T. Mandli, D. I. Ketcheson, et al., PyClaw Software, Version 1.0, http://numerics.kaust. edu.sa/pyclaw/ (2011).Google Scholar

  • 19.  K. A. Mardal O. Skavhaug G. T. Lines G. A. Staff and  A. Python to solve partial differential equations , Comput. Sci. Eng. , 9 ( 3 ) ( 2007 ), pp. 48 -- 51 . CrossrefISIGoogle Scholar

  • 20.  J. Mortensen L. Hansen and  K. Jacobsen , Real-space grid implementation of the projector augmented wave method , Phys. Rev. B , 71 ( 2005 ), 035109 . CrossrefISIGoogle Scholar

  • 21.  J. Nilsen X. Cai B. Høyland and  H. P. Langtangen , Simplifying the parallelization of scientific codes by a function-centric approach in Python , Computational Science & Discovery , 3 ( 2010 ), 015003 . CrossrefGoogle Scholar

  • 22.  T. Oliphant, NumPy Web Page, http://numpy.scipy.org (2011).Google Scholar

  • 23.  F. Perez B. E. Granger and  J. D. Hunter , Python: An ecosystem for scientific computing , Comput. Sci. Eng. , 13 ( 2 ) ( 2011 ), pp. 13 -- 21 . CrossrefISIGoogle Scholar

  • 24.  M. Quezada de Luna , 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. Google Scholar

  • 25.  M. Quezada de Luna and  D. I. Ketcheson , Radial Solitary Waves in Two-Dimensional Periodic Media, manuscript , 2011 . Google Scholar

  • 26.  J. Shi and  C. Hu . Shu, A technique of treating negative weights in WENO schemes , J. Comput. Phys. , 175 ( 2002 ), pp. 108 -- 127 . CrossrefISIGoogle Scholar

  • 27.  V. Stodden M. G. Knepley C. Wiggins R. J. LeVeque D. Donoho S. Fomel M. P. Friedlander M. Gerstein I. Mitchell L. L. Ouellette N. W. Bramble P. O. Brown V. Carey L. DeNardis R. Gentleman D. Gezelter J. A. Goodman J. E. Moore F. A. Pasquale J. Rolnick M. Seringhaus and  R. Subramanian , Reproducible research: Addressing the need for data and code sharing in computational science , Comput. Sci. Eng. , 12 ( 5 ) ( 2010 ), pp. 8 -- 13 . CrossrefISIGoogle Scholar

  • 28.  G. Strang , On the construction and comparison of difference schemes , SIAM J. Numer. Anal. , 5 ( 1968 ), pp. 506 -- 517 . LinkISIGoogle Scholar

  • 29.  J. Thuburn and  L. Yong , Numerical simulations of Rossby-Haurwitz waves , Tellus A , 52A ( 2000 ), pp. 181 -- 189 . CrossrefGoogle Scholar

  • 30.  D. L. Williamson J. B. Drake J. J. Hack R. Jakob and  P. N. Swarztrauber , A standard test set for numerical approximations to the shallow water equations on the sphere , J. Comput. Phys. , 102 ( 1992 ), pp. 221 -- 224 . CrossrefISIGoogle Scholar