Install from source
git clone firstname.lastname@example.org:clawpack/clawpack.git
git tag -l # see available versions
git checkout v5.9.2 # Checkout version you want
git submodule init # for repositories pyclaw, clawutil, visclaw, etc.
git submodule update # clones all the submodule repositories
export CLAW=/path/to/clawpack # in your shell config
If you want to compile python/pyclaw support do this
conda install ipython jupyterlab matplotlib meson-python ninja nose numpy scipy seaborn six
conda install petsc4py # if you want parallel support.
# Add flah "-c conda-forge" if not using miniforge.
pip install --user --no-build-isolation -e . # note trailing dot indicating "this directory"
This should install some files in your
Recommended: You can also do this inside a conda environment in order to not mess with your base environment, see below for how to do this.
The following command does all the steps: compile, run and make plots
_plots/_PlotIndex.html file to see the results.
make .exe # compile
make .data # generate claw.data file
make .output # compile and run
make .plots # compile, run and make plots
Install using script
I have made a shell script which installs clawpack from source and uses conda to get python packages.
export CLAW=/path/to/clawpack # where you want to install clawpack sources
bash ./clawpack.sh v5.9.2
Install using conda
This does not seem to give the classic fortran version. But it will install pyclaw including parallel version which needs PETSc.
unset CLAW PYTHONPATH # These might interfere if set to something already.
conda create -n claw
conda activate claw
conda install -c conda-forge clawpack ipython jupyterlab nose six seaborn
Test pyclaw: start ipython and
from clawpack.pyclaw import examples
claw = examples.shock_bubble_interaction.setup()
To go out of this environment
To delete this environment
conda remove -n claw --all
You can see a list of environments using
conda env list
Riemann solver book
See here github.com/clawpack/riemann_book and install like this (do this inside your claw conda environment)
git clone https://github.com/clawpack/riemann_book
pip install -r requirements.txt
jupyter nbextension enable --py widgetsnbextension
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable equation-numbering/main
Examples from the book
The original set of examples designed to run with clawpack-4.3 are here. To run these, download Clawpack-4.3 and set
CLAW to the path where it is located. Visualizing the results requires matlab.
cd $CLAW # or where ever you want apps to be
git checkout master
git clone --recursive https://github.com/clawpack/apps
The book examples are in the directory