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 email@example.com:clawpack/clawpack.git
python setup.py install
To run an example, launch an IPython session and then:
from clawpack.pyclaw import examples
claw = examples.shock_bubble_interaction.setup()
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.
There are some additional dependencies for running in parallel; see Running in parallel.
Obtaining Python, numpy, and matplotlib¶
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 Installing Clawpack.
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
If you have followed the instructions for Running in parallel, you can run the tests in parallel:
mpirun -n 4 nosetests
PyClaw automatically enables tests that require PETSc if it detects a petsc4py installation. Otherwise, tests that use PETSc are disabled.
Now you’re ready to set up your own PyClaw simulation. Try the PyClaw tutorial: Solve the acoustics equations!