Index of /rjl/pubs/cise09/cise08levequeV3

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[   ]Makefile 2008-08-29 10:21 2.4K 
[   ]clawcode2html 2008-08-29 10:21 369  
[   ]xclaw 2008-08-29 10:21 46K 
[   ]driver.f 2008-08-29 10:21 818  
[   ]mapc2p.f 2008-08-29 10:21 1.0K 
[   ]qinit.f 2008-08-29 10:21 1.0K 
[   ]rpn2ad1.f 2008-08-29 10:21 2.3K 
[   ]rpt2ad1.f 2008-08-29 10:21 1.0K 
[   ]setaux.f 2008-08-29 10:21 2.1K 
[   ]setprob.f 2008-08-29 10:21 464  
[   ]stream.f 2008-08-29 10:21 366  
[   ]afterframe.py 2008-08-29 10:21 504  
[   ]clawcode2html.py 2008-08-29 10:21 17K 
[   ]clawplotting.py 2008-08-29 10:21 11K 
[   ]clawtest.py 2008-08-29 10:21 13K 
[   ]clawtestsubset.py 2008-08-29 10:21 1.9K 
[   ]clawtools.py 2008-08-29 10:21 20K 
[   ]mapc2p.py 2008-08-29 10:21 880  
[   ]plotclaw.py 2008-08-29 10:21 14K 
[   ]plotgrids.py 2008-08-29 10:21 2.4K 
[   ]setplot2user.py 2008-08-29 10:21 1.2K 
[   ]claw2ez.data 2008-08-29 10:22 2.1K 
[   ]setplot2.data 2008-08-29 10:22 81  
[   ]setprob.data 2008-08-29 10:22 165  
[DIR]paper/ 2008-08-29 10:22 -  
[TXT]afterframe.py.html 2011-10-22 13:25 1.5K 
[TXT]claw2ez.data.html 2011-10-22 13:25 3.8K 
[TXT]clawcode2html.html 2011-10-22 13:25 734  
[TXT]clawplotting.py.html 2011-10-22 13:25 14K 
[TXT]clawtest.py.html 2011-10-22 13:25 16K 
[TXT]clawtestsubset.py.html 2011-10-22 13:25 3.4K 
[TXT]clawtools.py.html 2011-10-22 13:25 23K 
[TXT]driver.f.html 2011-10-22 13:25 2.1K 
[DIR]lib/ 2011-10-22 13:25 -  
[TXT]mapc2p.f.html 2011-10-22 13:25 2.4K 
[TXT]mapc2p.py.html 2011-10-22 13:25 2.1K 
[TXT]plotclaw.py.html 2011-10-22 13:25 17K 
[TXT]plotgrids.py.html 2011-10-22 13:25 3.9K 
[TXT]qinit.f.html 2011-10-22 13:25 2.2K 
[TXT]rpn2ad1.f.html 2011-10-22 13:25 4.4K 
[TXT]rpt2ad1.f.html 2011-10-22 13:25 2.2K 
[TXT]setaux.f.html 2011-10-22 13:25 3.9K 
[TXT]setplot2.data.html 2011-10-22 13:25 1.1K 
[TXT]setplot2user.py.html 2011-10-22 13:25 2.4K 
[TXT]setprob.data.html 2011-10-22 13:25 1.3K 
[TXT]setprob.f.html 2011-10-22 13:25 1.5K 
[TXT]stream.f.html 2011-10-22 13:25 1.5K 

README.html

Clawpack and Python code to reproduce results in the paper

    Python Tools for Reproducible Research on Hyperbolic Problems
       by R. J. LeVeque, CiSE (submitted) ... paper/cise08levequeV2.pdf

Description

The test problem is two-dimensional advection with solid body rotation using the Clawpack software. This directory is a self-contained version of this code along with some additional Python tools.

Reproducible Results

The tables in the paper are generated by the Python script clawtest.py, which uses several functions from the module clawtools.py (see below for links to these files).

These modules assume you are using Python 2.4 or later.

NumPy is used for for array operations and mathematics and you may need to install this first and ensure that it is on the PYTHONPATH.

The plotting also requires that matplotlib be installed from SciPy .

See pythonhints.html for advice on obtaining an appropriate version of Python and other required modules.

You also need to set the environment variable FC to the Fortran compiler that should be used to compile the Clawpack code, e.g.

    unix>  setenv FC f77

Check that the clawtest.py script works by doing

    unix>  python clawtest.py
This is set to run only two tests on a single grid type with coarse grids, so it should run quickly.

To run all the tests presented in the paper, do

    unix>  python clawtest.py itest=3
Alternatively, you can execute this from within Python:
    unix>  python 
    >>> from clawtest import *
    >>> runtests(itest=3)
    >>> quit()

This will generate files errortables.txt, errortables.tex, and errors.png that should agree with those archived in paper subdirectory.

If you want to generate plots of the solution evolving on each grid, try

     >>> runtests(itest=3,plotsoln=True)

This requires that matplotlib be installed. See pythonhints.html for advice.

Related EagleClaw examples

You can also experiment with a related example (different initial conditions) online at this page .

Links to files in this directory:

Two versions are listed for each file, the original file and an html version that is created by executing "make htmls" in this directory. If the original file is changed then you will have to "make htmls" again to see the changed reflected in the html versions.

Executing "make htmls" invokes the script clawcode2html.py to covert code into html files, if you have this code from Clawpack. See the mathcode2html webpage for a more general version and some examples of its use.

Python files

clawtest.py [.html]
Module to run the tests presented in the paper and generate the tables of errors.

clawtestsubset.py [.html]
The short version of clawtest.py [.html] that appears in the paper.

clawtools.py [.html]
Module of Python tools for Clawpack that are used in clawtest.py.

plotgrids.py [.html]
Module to plot the grids shown in Figure 1 of the paper.

clawplotting.py [.html]
Module of Python plotting tools for Clawpack using matplotlib.

mapc2p.py [.html]
Maps the computational rectangular domain to the physical grid.

setplot2user.py [.html]
This file contains commands that are executed on start-up, and sets various plotting parameters.

afterframe.py [.html]
This file contains commands that are executed after plotting each frame (i.e. each specified output time).

Data files

These data files are read by the Fortran code when Clawpack is run. Some of the values in these files are changed by the Python script in order to run a sequence of tests (see the ClawData class in clawtools.py).

claw2ez.data [.html]
Standard parameter values that are read by library routine claw/clawpack/2d/lib/claw2ez.f [.html] Each line contains one or more values to be read in, followed by comments that are ignored by the Fortran code but used by the Python read or write methods of class clawtools.ClawData.

Some parameters that you might want to modify are described in the documentation .

setprob.data [.html]
Problem-specific parameters.

setplot2.data [.html]
This file contains plotting parameters.

Fortran files

Makefile
Determines which version of fortran files are used when compiling the code with make.

driver.f [.html]
This is the main program. This code declares a few arrays and then calls the library routine claw/clawpack/1d/lib/claw1ez.f [.html]. For most applications of CLAWPACK calling this routine or higher dimensional versions is sufficient to solve the problem and the driver routine rarely changes, except to adjust the array dimensions if necessary.

The parameter mx in the data file claw1ez.data [.html] determines how many grid cells are used in the computation. Some arrays in driver.f.html [.html] are dimensioned using the parameter maxmx. If mx > maxmx then an error will result and the value of maxmx must be adjusted, along with another parameter mwork that is the length of a work array. The error message will tell you how to fix these parameters if necessary. After fixing driver.f [.html] you must recompile with the make command.

setprob.f [.html]
A routine by this name is called by the library routine claw/clawpack/1d/lib/claw1ez.f [.html] and is generally used to set any values needed for the specific problem being solved. In this example, the value of the advection velocity $u$ and a parameter $\beta$ used in setting the initial conditions are read from the file setprob.data [.html].

mapc2p.f [.html]
Maps the computational rectangular domain to the physical grid.

Riemann solvers:

rpn2ad1.f [.html]
Normal Riemann solver (normal to cell interface).

rpt2ad1.f [.html]
Transverse Riemann solver.

Library routines:

The routines in the lib subdirectory are from the kingkong.amath.washington.edu/claw/clawpack/2d/lib/ directory and are standard library routines for two-dimensional clawpack. These were taken from Subversion revision 282, though the codes in this directory should work with any other version of Clawpack 4.3 or 5.0. See the Clawpack wiki for information on the Subversion repository.

See the Makefile to see which library routines are used in this example.