begin_html [use: jsMath] [use: doc/doc.css]
CLAWPACK Sample Code
Euler equations with hump initial data to test accuracy, comparing against a
reference solution obtained on a finer grid.
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: Makefile_qref]
- Version to create reference solution and direct output to _output_qref.
- [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/1d/lib/claw1ez.f]
and is generally used to set any values needed for the specific problem
being solved.
- [code: ../rp/rp1.f]
-
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.
- [code: qinit.f]
-
This subroutine sets the initial data at time $t=0$.
Python files
- [code: setrun.py]
- This file contains a function that
specifies what run-time parameters will be used.
Some parameters that you might want to modify are described in the
[http://kingkong.amath.washington.edu/clawpack/users documentation].
- [code: setplot.py]
- This file contains a function that
specifies what plots will be done and
sets various plotting parameters.
- [code: setrun_qref.py]
- Specifies parameters for reference solution. You might want to increase
mx.
See the [http://kingkong.amath.washington.edu/clawpack/users documentation].
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/1d/lib/claw1ez.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.
- [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/1d/lib] are used. See the [code: Makefile]
to determine which ones are used.
[name: instructions]
Instructions
To create reference solution:
{{{
$ make .output -f Makefile_qref
}}}
To run code:
{{{
$ make clean # to remove junk left from making qref
$ make .output
}}}
View plots interactively with Iplotclaw or use "make .plots" to create html
files.
All of this is done by
{{{
$ source make_all.sh
}}}
end_html