begin_html [use: jsMath] [use: doc/doc.css]

CLAWPACK Sample Code

Advection equation for 2d solid body rotation in an annulus. $q_t + u(x,y)q_x + v(x,y)q_x = 0$, with \[ u(x,y) = -2\pi y, \qquad v(x,y) = 2\pi x. \] Solid body rotation with period 1. There is also an AMR version in subdirectory amr (see [link: amr/README.html]). See [link: #instructions Instructions]

Plots of results

After running this code and creating plots via "make .plots", you should be able to view the plots in [link: _plots/_PlotIndex.html].

Fortran files

[code: Makefile]
Determines which version of fortran files are used when compiling the code with make and specifies where output and plots should be directed. Type "make .help" at the Unix prompt for options.
[code: driver.f]
The driver routine allocates storage and then calls the main Clawpack routine.
[code: setprob.f]
A routine by this name is called by the library routine [clawcode: clawpack/2d/lib/claw2ez.f] and is generally used to set any values needed for the specific problem being solved.
[code: rpn2ad1.f]
Normal Riemann solver (normal to cell interface).
[code: rpt2ad1.f]
Transverse Riemann solver.
[code: qinit.f]
This subroutine sets the initial data at time $t=0$.
[code: setaux.f]
Sets auxiliary arrays containing velocities and cell areas.
[code: mapc2p.f]
Maps computation points on rectangular grid to physical points on mapped grid.
[code: stream.f]
Stream function to define velocity field.

Python files

[code: setrun.py]
This file contains a function that specifies what run-time parameters will be used.
[code: setplot.py]
This file contains a function that specifies what plots will be done and sets various plotting parameters.

Data files

Warning: These files are generally changed when setting up a run and the versions here may not be the ones actually used.
[code: claw.data]
This file contains a number of parameter values that are used by CLAWPACK. The values in this file are read by the library routine [clawcode: clawpack/2d/lib/claw2ez.f]. Each line contains one or more values to be read in, followed by comments that are ignored by the Fortran code but may be used by Pythons scripts. Some parameters that you might want to modify are described in the [http://www.clawpack.org/users documentation].
[code: setprob.data]
This file may contain various parameters used in setting the initial conditions or otherwise setting up the problem.

Library routines

In addition to the Fortran routines in this library, several library routines from [claw:clawpack/2d/lib] are used. See the [code: Makefile] to determine which ones are used. [name: instructions]

Instructions

To run code: {{{ $ make .output }}} View plots interactively with Iplotclaw or use "make .plots" to create html files. end_html