Installing PyClaw

The fastest way to install the latest release of PyClaw is:

pip install clawpack

To get the latest development version, do this instead:

git clone git@github.com:clawpack/clawpack.git
cd clawpack
python setup.py install

If you encounter any difficulties in the installation process, please contact us or raise an issue.

To run an example, launch an IPython session and then:

from clawpack.pyclaw import examples
claw = examples.shock_bubble_interaction.setup()
claw.run()
claw.plot()

This will run the code and then place you in an interactive plotting shell. To view the simulation output frames in sequence, simply press ‘enter’ repeatedly. To exit the shell, type ‘q’. For help, type ‘?’ or see Plotting PyClaw results.

Dependencies: Python, gfortran, numpy, and matplotlib

PyClaw requires Python 2.7 or greater and a modern Fortran 95 compiler. PyClaw is known to work with GNU gfortran 4.2 and higher and the IBM XLF compiler.

  • Python version >= 2.7.
  • numpy version >= 1.6.
  • matplotlib version >= 1.0.1 (optional – only for plotting).
  • pip
  • A Fortran 90 compiler, such as gfortran version >= 4.2. If you do not have one already, we recommend getting one via GCC Wiki GFortranBinaries.

There are some additional dependencies for running in parallel; see Running in parallel.

Obtaining Python, numpy, and matplotlib

If you don’t already have these on your system, we recommend Anaconda CE or Enthought Canopy Express (both free).

Clawpack

PyClaw is part of Clawpack, which includes several other packages; see Clawpack components. Note that the installation instructions above will install PyClaw, Riemann and VisClaw. If you also wish to use AMRClaw or GeoClaw, you should follow the more general Clawpack Installation options.

Testing your installation with nose

If you’ve manually downloaded the source, or cloned from Github, then you can easily test your installation. First install nose:

pip install nose

Then

cd clawpack/pyclaw
nosetests

If you have followed the instructions for Running in parallel, you can run the tests in parallel:

mpirun -n 4 nosetests

Note

PyClaw automatically enables tests that require PETSc if it detects a petsc4py installation. Otherwise, tests that use PETSc are disabled.

Next steps

Now you’re ready to set up your own PyClaw simulation. Try the PyClaw tutorial: Solve the acoustics equations!