Clawpack Gallery of Jupyter Notebooks¶
The Jupyter notebook (formerly known as IPython notebook) is a very nice platform for illustrating Clawpack examples.
The links below will take you to static view of several notebooks as html files. You can also play animations in them and interact with some plots, but to actually run the code yourself you should clone the apps repository.
Version: Most of these notebooks now work with Clawpack 5.7.0.
Finding the notebooks: The links below are to html rendered versions of the notebooks. See the beginning of each notebook for information on where to find the original .ipynb file. Many of them are in the apps repository, in some subdirectory of $CLAW/apps/notebooks.
If you have used Clawpack with the Jupyter notebook and would like to submit your notebook for inclusion, please send us a link or submit a pull request to the apps repository.
Examples using PyClaw¶
Examples using Fortran Classic¶
advection_1d illustrating upwind, Lax-Wendroff, and limiter methods. From $CLAW/apps/notebooks/classic/advection_1d.ipynb.
acoustics_1d_example1. From $CLAW/apps/notebooks/classic/acoustics_1d_example1.ipynb.
Examples using AMRClaw¶
RuledRectangles Illustration of Ruled Rectangles from clawpack.amrclaw.region_tools.
Examples using GeoClaw¶
topotools_examples illustrates some of the tools from topotools_module.
dtopotools_examples illustrates some of the tools from dtopotools_module.
Okada illustrates use of the Okada model for generating sea floor deformation.
CSZ_example illustrates use of the Okada model on triangles rather than rectangles, creating a dtopo file for a “random” Cascadia Subduction Zone event.
MarchingFront illustrates a marching front algorithm that can be used to identify land behind dikes, and also useful for creating Ruled Rectangles for use as flagregions, or to select fgmax points below some fixed elevation.
ForceDry illustrates how to force some regions to be initialized as dry land even if they are below sea level (but protected by dikes).
MakeFlagregionsCoast illustrates making a ruled rectangle for use as a flagregion using the marching front algorithm.
IslandBuffering illustrates how to make a ruled rectangle surrounding an island with a buffer zone that extends out some distance that is independent of water depth.
Tsunami modeling examples¶
Radial Ocean¶
These notebooks are part of $CLAW/geoclaw/examples/tsunami/radial_ocean_island_fgmax.
make_input_files creates input files.
process_fgmax makes plots of fgmax results.
Chile 2010¶
chile2010a illustrates how to set up a basic GeoClaw run with adaptive refinement.
chile2010b illustrates setting regions and gauges.
Tohoku 2011¶
compare_results compares GeoClaw results to observations at a tide gauge and ADCP current profiler in Hawaii.
Tools for running clawpack and visualizing results in notebooks¶
Several of the notebooks above use the clawpack.clawutil.nbtools module of notebook tools to compile and run Fortran versions of Clawpack Classic, AMRClaw, or GeoClaw, and display the plots and/or animations of the results in the notebook. For example, see
The animations are presented with the aid of the
clawpack.visclaw.animation_tools module.
The notebook
shows some other related animation tools.
Plotting and visualization¶
In addition to the notebooks referenced above, the following notebooks also show how to use various plotting and visualization tools available in Clawpack:
pcolorcells A version of pcolormesh that works better for finite volume cell averaged data, also with an illustration of use in making kml overlays for Google Earth.
gridtools Tools to extract data from (so far only 2D) AMRClaw output, e.g. to extract a uniform grid or a 1D transect that uses the finest available grid info at each point.
animation tools demo illustrates animation tools, including ways to create interactive animations using Jupyter widgets or as embedded or stand-alone javascript or mp4 files. (These tools may be useful for plots created outside of Clawpack as well.)
Riemann solvers¶
A collection of notebooks illustrating exact and approximate Riemann solvers is available in the repository
and visible as rendered html files at
These were developed for the book Riemann Problems and Jupyter Solutions by D. I. Ketcheson, R. J. LeVeque, and M. J. del Razo. A paperback version was published by SIAM in 2020.