|
CLAWPACK Sample Code
This code is modified from $CLAW/apps/advection/1d/example.
Advection equation $q_t + uq_x=0$.
Advection at constant velocity with periodic boundary conditions.
These parameters are specified in setrun.py [.html].
See Instructions
Plots of results
The following set of output plots are created by running the script
run_tests.py [.html]:
Upwind, mx=200
Lax-Wendroff, mx=200
Minmod, mx=200
MC limter, mx=200
Upwind, mx=1000
Lax-Wendroff, mx=1000
Minmod, mx=1000
MC limter, mx=1000
Fortran files
- Makefile [.html]
- 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.
- setprob.f [.html]
-
A routine by this name is called by the library routine
clawpack/1d/lib/claw1ez.f [.html]
and is generally used to set any values needed for the specific problem
being solved.
- rp1.f [.html]
-
This is the Riemann solver, which takes the $q$ values stored in the
arrays ql and qr and returns the waves in the array
wave and speeds in the array s that result in solving the
Riemann problem at each cell interface, and the fluctuations amdq
and apdq. See $CLAW/doc/rp1.html for more information about 1d
Riemann solvers.
- qinit.f [.html]
-
This subroutine sets the initial data $q(x,0)$ at time $t=0$.
Python files
- setrun.py [.html]
- This file contains a function that
specifies what run-time parameters will be used.
- setplot.py [.html]
- 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.
- claw.data [.html]
- This file contains a number of
parameter values that are used by CLAWPACK.
The values in this file are read by the library routine
clawpack/1d/lib/claw1ez.f [.html].
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
documentation .
- setprob.data [.html]
- This file contains the advection velocity $u$ and various other
parameters used in setting the initial conditions.
Values in this file are read in by the
subroutine setprob.f95 [.html].
Library routines
In addition to the Fortran routines in this library, several library
routines from $CLAW/clawpack/1d/lib are used. See the Makefile [.html]
to determine which ones are used.
Instructions
To run code:
$ make .output
View plots interactively with Iplotclaw or use "make .plots" to create html
files.
|