QUAD_MESH
Quadrilateral Meshes
QUAD_MESH
is a FORTRAN90 library which
carries out operations involving meshes of quadrilaterals.
The mesh is the collection of quadrilaterals. Each quadrilateral
is termed an "element". The points used to define the shape of the
quadrilateral (the corners, and sometimes a few more points) are called
the "nodes".
Routines are available to:

evaluate "quality measures" for the mesh;

create a "node neighbor array" for each node;

create an "element neighbor array" for each element;

estimate the integral of a function over the region covered by the mesh;

plot the nodes and elements of a mesh;

determine the parts of the mesh that lie on the boundary;

sample points at random from the region covered by the mesh;

search a mesh to determine which element contains a point.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
QUAD_MESH is available in
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
FEM2D,
a data directory which
contains a description and examples of files that describe a 2D finite element model.
FEM_IO,
a FORTRAN90 library which
reads or writes node, element and data files defining a finite element model.
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.
MESH_DISPLAY,
a MATLAB program which
reads data defining a polygonal mesh and displays it, with optional numbering.
MESH_DISPLAY_OPENGL,
a C++ program which
reads files defining a polygonal mesh and displays an image using OpenGL.
QUAD_MESH,
a data directory which
defines a format for storing meshes of quadrilaterals over a 2D region.
QUAD_MESH_RCM,
a FORTRAN90 program which
computes the reverse CuthillMcKee (RCM) reordering for nodes in a mesh
of 4node quadrilaterals.
TRIANGULATION,
a FORTRAN90 library which
carries out operations involving meshes of triangular elements.
Reference:

Hans Rudolf Schwarz,
Methode der Finiten Elemente,
Teubner Studienbuecher, 1980,
ISBN: 3519023490.

Gilbert Strang, George Fix,
An Analysis of the Finite Element Method,
Cambridge, 1973,
ISBN: 096140888X,
LC: TA335.S77.

Olgierd Zienkiewicz,
The Finite Element Method,
Sixth Edition,
ButterworthHeinemann, 2005,
ISBN: 0750663200,
TA640.2.Z54
Source Code:
Examples and Tests:
EXAMPLE1 is a mesh made up of squares of uniform size. The squares
are arranged in a grid with a few irregularities, however. In particular,
there is an interior hole.
EXAMPLE2 is a mesh made up of quadrilaterals that are "trying" to tile a
semicircle. The row of elements that touches the origin is degenerate, and
are essentially triangles. The elements vary in area.
SAMPLE_QUAD demonstrates how a single quadrilateral can be randomly sampled.

sample_quad.txt,
node coordinates for random sample points in a quadrilateral.

sample_quad.png,
a PNG image of the random sample points in a quadrilateral.
List of Routines:

ADJ_SET_Q4_MESH sets adjacencies in a Q4 mesh.

ADJ_SIZE_Q4_MESH counts adjacencies in a Q4 mesh.

AREA_Q4_MESH computes areas of elements in a Q4 mesh.

AREA_QUAD returns the area of a quadrilateral.

BANDWIDTH determines the bandwidth associated with a finite element mesh.

BOUNDARY_EDGE_COUNT_Q4_MESH counts the boundary edges.

BOUNDARY_EDGE_COUNT_EULER_Q4_MESH counts boundary edges by Euler's formula.

CH_CAP capitalizes a single character.

CH_EQI is a case insensitive comparison of two characters for equality.

CH_TO_DIGIT returns the integer value of a base 10 digit.

EXAMPLE1_Q4_MESH sets up example #1 Q4 mesh.

EXAMPLE1_Q4_MESH_SIZE sets sizes for example #1 Q4 mesh.

EXAMPLE2_Q4_MESH sets up example #2 Q4 mesh.

EXAMPLE2_Q4_MESH_SIZE sets sizes for example #2 Q4 mesh.

FILE_COLUMN_COUNT counts the number of columns in the first line of a file.

FILE_ROW_COUNT counts the number of row records in a file.

GET_UNIT returns a free FORTRAN unit number.

I4_MODP returns the nonnegative remainder of I4 division.

I4_WRAP forces an I4 to lie between given limits by wrapping.

I4COL_COMPARE compares columns I and J of an I4COL.

I4COL_SORT_A ascending sorts an I4COL.

I4COL_SORTED_UNIQUE_COUNT counts unique elements in an I4COL.

I4COL_SWAP swaps columns I and J of an I4COL.

I4MAT_DATA_READ reads data from an I4MAT file.

I4MAT_HEADER_READ reads the header from an I4MAT.

I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.

I4MAT_TRANSPOSE_PRINT_SOME prints some of the transpose of an I4MAT.

I4MAT_WRITE writes an I4MAT file.

I4VEC_PRINT prints an I4VEC.

MESH_BASE_ONE ensures that the element definition is onebased.

NEIGHBOR_ELEMENTS_Q4_MESH determines element neighbors in a Q4 mesh.

NODE_ORDER_Q4_MESH determines the order of nodes in a Q4 mesh.

PLOT_Q4_MESH plots a Q4 mesh.

R8_UNIFORM_01 returns a unit pseudorandom R8.

R8MAT_DATA_READ reads data from an R8MAT file.

R8MAT_HEADER_READ reads the header from an R8MAT file.

R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.

R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.

R8MAT_WRITE writes an R8MAT file.

R8VEC_BRACKET searches a sorted R8VEC for successive brackets of a value.

R8VEC_PRINT prints an R8VEC.

R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.

REFERENCE_TO_PHYSICAL_Q4 maps Q4 reference points to physical points.

S_BLANK_DELETE removes blanks from a string, left justifying the remainder.

S_TO_I4 reads an I4 from a string.

S_TO_I4VEC reads an I4VEC from a string.

S_TO_R8 reads an R8 from a string.

S_TO_R8VEC reads an R8VEC from a string.

S_WORD_COUNT counts the number of "words" in a string.

SAMPLE_Q4_MESH returns random points in a Q4 mesh.

SAMPLE_QUAD returns random points in a quadrilateral.

SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.

TIMESTAMP prints the current YMDHMS date as a time stamp.

TRIANGLE_AREA computes the area of a triangle.

TRIANGLE_SAMPLE returns random points in a triangle.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 29 September 2009.