A Software Package for Generating Test Matrices for the Convection-Diffusion
Version 1.0, July 1997
Department of Computer Science
University of Kentucky
Lexington, KY 40506--0046, USA
Convection-Diffusion Test Problems
Test problems (matrices) for multigrid method and other iterative methods.
The convection-diffusion equation is of the form
-[Uxx + Uyy + Re( p(x,y)Ux + q(x,y)Uy )] = f(x,y),
where Re is the so-called Reynolds number. This equation
offers some simple but non-trivial
test problems for iterative linear system solvers. In the context of
multigrid methods, some geometric, algebraic multigrid methods, and
multigrid methods with the so-called matrix-dependent grid-transfer
operators have been designed and tested for solving the
However, most of these multigrid methods were designed with the
assumption that the coefficient matrix is an $M$-matrix or with similarly
very nice property, although in reality, as I am aware of, many of these
methods can solve problems that do not satisfy this assumption.
As a result of lacking more demanding test problems, most of
these methods have been tested with the upwind finite difference
discretization (or similar discretization schemes with added diffusion
terms) and the resulting
coefficient matrix is usually strongly diagonally dominant. In fact,
there is no much difference in the published results in terms of the
tested convergence and the number of iterations.
In order to facilitate testing iterative methods, followed by several
requests, I provide here, for convenience,
some codes to generate several test problems
(linear systems) using different different discretization schemes:
For large Re, the above order represents decreasing order of difficulty
for iterative methods. The coefficient matrices can be generated using
Re and uniform meshsize $h$, assuming the problems are defined on the
unit square (0,1)x(0,1). Dirichlet boundary conditions are assumed and
the exact solutions are given.
the 2nd-order 5-point central difference scheme;
the 4th-order 9-point compact difference scheme; and
the 1st-order 5-point upwind difference scheme.
I have Fortran that can generate matrices with Compressed Sparse Row Format,
standard codes are also available to store and read the matrices in standard
Harwell-Boeing sparse matrix format.
I just put the Fortran source codes on-line
and you can down load these subroutines and generate the matrices when they
are needed. If you want to generate matrices using other format or do
not want any specific format, a Fortran code that can be used to compute
the stencils are given. These codes do not mean to be very efficient in
terms of cos, but they do their job quite well.
We may need some standard reference to the matrices (problems) in order to
compare results from different authors. Here are something
that I would like to suggest:
We should have fixed right-hand side and exact solution to compare. These
are in-cooperated in the above-mentioned codes;
We should have fixed initial guess. I propose to choose the zero vector;
I propose to take values of Re as the exponent of 10, i.e., 1, 10, 100,
1,000, 10,000, 100,000 and 1,000,000. They roughly
represent problems from diffusion-dominated to convection-dominated.
(My experience suggests that things change quickly between Re = 1,000 and
Re = 10,000.
We may choose the meshsize $h$ as 1/32, 1/64, 1/128, 1/256 and 1/512.
The test problems that I put here are of the well-known types.
Although some high Reynolds
number problems do not have a clear physical meaning, they do offer a
challenge to many iterative solvers.
Multigrid Network of Craig Douglas, where you can find interesting
information on multigrid methods and some multigrid softwares;
Sparskit Package of Yousef Saad that provides basic tool-kit for
sparse matrix computations, in particular, some useful routines to read
Jun Zhang, author of this page, to whom you may offer some suggestions.
For problems and suggestions, send e-mail to:
If there is enough interest, code for generating matrices of 3D
convection-diffusion equation will be put on-line;
A new page to publish results that provided by software authors and
practioners who solved some of these test matrices.
This page was created by
Jun Zhang as a voluntary service to the community
of iterative method researchers and practioners.
This software package comes with no warranty. The author
is not liable for any loss/damage or inconvenience caused
in the use of this software or any modification thereof.
You use it at your own risk.