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. scientific software
  2. wave propagation
  3. Python
  4. hyperbolic PDEs
  5. Clawpack

MSC codes

  1. 35L65
  2. 65Y05
  3. 65Y15
  4. 65M08

Get full access to this article

View all available purchase options and get full access to this article.


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.
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.
M. Emmett, PyWENO Software Package, http://memmett.github.com/PyWENO (2011).
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.
S. Fomel and J. F. Claerbout, Guest editors' introduction: Reproducible research, Comput. Sci. Eng., 11 (1) (2009), pp. 5--7.
J. E. Guyer, D. Wheeler, and J. A. Warren, FiPy: Partial differential equations with Python, Comput. Sci. Eng., 11 (3) (2009), pp. 6--15.
B. Haurwitz, The motion of atmospheric disturbances on a spherical earth, J. Marine Research, 3 (1940), pp. 254--267.
D. I. Ketcheson, Highly efficient strong stability-preserving Runge--Kutta methods with low-storage implementations, SIAM J. Sci. Comput., 30 (2008), pp. 2113--2136.
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.
D. I. Ketcheson and M. Parsani, SharpClaw Software, http://numerics.kaust.edu.sa/sharpclaw (2011).
D. I. Ketcheson, M. Parsani, and R. J. LeVeque, High-Order Wave Propagation Algorithms for General Hyperbolic Systems, http://arxiv.org/abs/1111.3499.
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.
P. D. Lax and X.-D. Liu, Solution of two-dimensional Riemann problems of gas dynamics by positive schemes, SIAM J. Sci. Comput., 19 (1998), pp. 319--340.
R. J. LeVeque, Wave propagation algorithms for multidimensional hyperbolic systems, J. Comput. Phys., 131 (1997), pp. 327--353.
R. J. LeVeque, Finite Volume Methods for Hyperbolic Problems, Cambridge University Press, Cambridge, UK, 2002.
R. J. LeVeque and M. J. Berger, Clawpack Software Version \textup4.5, http://www.clawpack.org (2011).
R. J. LeVeque and D. H. Yong, Solitary waves in layered nonlinear media, SIAM J. Appl. Math., 63 (2003), pp. 1539--1560.
K. T. Mandli, D. I. Ketcheson, et al., PyClaw Software, Version 1.0, http://numerics.kaust. edu.sa/pyclaw/ (2011).
K. A. Mardal, O. Skavhaug, G. T. Lines, G. A. Staff, and A. Ødeg\aard, Using Python to solve partial differential equations, Comput. Sci. Eng., 9 (3) (2007), pp. 48--51.
J. Mortensen, L. Hansen, and K. Jacobsen, Real-space grid implementation of the projector augmented wave method, Phys. Rev. B, 71 (2005), 035109.
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.
T. Oliphant, NumPy Web Page, http://numpy.scipy.org (2011).
F. Perez, B. E. Granger, and J. D. Hunter, Python: An ecosystem for scientific computing, Comput. Sci. Eng., 13 (2) (2011), pp. 13--21.
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.
M. Quezada de Luna and D. I. Ketcheson, Radial Solitary Waves in Two-Dimensional Periodic Media, manuscript, 2011.
J. Shi, C. Hu, and C.-W. Shu, A technique of treating negative weights in WENO schemes, J. Comput. Phys., 175 (2002), pp. 108--127.
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.
G. Strang, On the construction and comparison of difference schemes, SIAM J. Numer. Anal., 5 (1968), pp. 506--517.
J. Thuburn and L. Yong, Numerical simulations of Rossby-Haurwitz waves, Tellus A, 52A (2000), pp. 181--189.
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.

Information & Authors


Published In

cover image SIAM Journal on Scientific Computing
SIAM Journal on Scientific Computing
Pages: C210 - C231
ISSN (online): 1095-7197


Submitted: 28 November 2011
Accepted: 8 May 2012
Published online: 15 August 2012


  1. scientific software
  2. wave propagation
  3. Python
  4. hyperbolic PDEs
  5. Clawpack

MSC codes

  1. 35L65
  2. 65Y05
  3. 65Y15
  4. 65M08



Manuel Quezada de Luna

Metrics & Citations



If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download.

Cited By







Copy the content Link

Share with email

Email a colleague

Share on social media

The SIAM Publications Library now uses SIAM Single Sign-On for individuals. If you do not have existing SIAM credentials, create your SIAM account https://my.siam.org.