Sample 2D Meshes

TEST_MESH is a FORTRAN90 library which defines a few simple triangular meshes of 2D regions.

Alan George and Joseph Liu generated the original set of 9 meshes. They used them to generate refined meshes, made by subdividing every triangle the same number of times. Then the node-connectivity matrix of the refined mesh was used to define a positive definite symmetric sparse matrix problem.

Of course, the meshes can be of interest for other reasons. For instance, it is possible to output the mesh information as a poly file. This format can be input to the SHOWME program for display, or to TRIANGLE.

The program is set up to allow a user to easily access a particular mesh by specifying its number, or to access all the examples, by going through the master routines whose names begin with the prefix MESH00_.

The user can easily handle problems of various size by first calling the routines that give the sizes of various arrays, then using the FORTRAN90 ALLOCATE command to set up enough space for the array, and then calling the library routine that fills up the array with information.

The meshes include:

  1. the Square, 4 nodes, 2 elements.
  2. The Graded L, 22 nodes, 30 elements.
  3. The Plus-Shaped Domain, 28 nodes, 26 elements.
  4. The H-Shaped Domain, 40 nodes, 38 elements.
  5. The Hollow Square (Small Hole), 12 nodes, 12 elements.
  6. The Hollow Square (Large Hole), 32 nodes, 32 elements.
  7. The 3-Hole Problem, 44 nodes, 56 elements.
  8. The 6-Hole Problem, 46 nodes, 56 elements.
  9. The Pinched Hole Problem, 8 nodes, 7 elements.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


TEST_MESH is available in a FORTRAN90 version.

Related Data and Programs:

HBSMC, a dataset directory which contains the Harwell-Boeing Sparse Matrix Collection. The meshes described here naturally give rise to adjacency matrices. These matrices are typically sparse (mostly zero) and irregular. Versions of these matrices, derived from the meshes in this collection are available in HBSMC.

MESH_BANDWIDTH, a FORTRAN90 program which returns the geometric bandwidth associated with a mesh of elements of any order and in a space of arbitrary dimension.

SPARSEPAK, a FORTRAN90 library which contains a version of a direct solver for sparse systems, developed by George and Liu.

TEST_TRIANGULATION, a FORTRAN90 library which defines a set of test regions for triangulation.

TRIANGLE, a C program which can be used to operate on meshes in the TEST_MESH library, producing the Voronoi diagram, or determining a refined Delaunay triangulation, constrained to include the original edges of the mesh.


  1. Alan George, Joseph Liu,
    Computer Solution of Large Sparse Positive Definite Matrices,
    Prentice Hall, 1981,
    ISBN: 0131652745,
    LC: QA188.G46.

Source Code:

Examples and Tests:

TEST_MESH includes a routine, MESH00_EPS, which can create an EPS file containing an image of the mesh. EPS files you may copy include:

TEST_MESH includes a routine, MESH00_POLY, which can create a POLY file containing the mesh information, suitable for display by SHOWME, or for processing by TRIANGLE. POLY files you may copy include:

Versions of these meshes have also been stored in the Harwell Boeing Sparse Matrix Collection:

List of Routines:

You can go up one level to the FORTRAN90 source codes.

Last revised on 20 May 2006.