QUAD_MESH
Quadrilateral Meshes
QUAD_MESH
is a C++ 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 C++ library which
reads or writes node, element and data files defining a finite element model.
FEM2D_PACK,
a C++ library which
handles various tasks associated with finite element meshes.
MESH_BANDWIDTH,
a C++ 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 C++ program which
computes the reverse CuthillMcKee (RCM) reordering for nodes in a mesh of 4node
quadrilaterals.
TRIANGULATION,
a C++ 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 triangulation.

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 the finite element mesh.

BOUNDARY_EDGE_COUNT_Q4_MESH counts the boundary edges.

BOUNDARY_EDGE_COUNT_EULER_Q4_MESH counts boundary edges.

CH_CAP capitalizes a single character.

CH_EQI is true if two characters are equal, disregarding case.

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.

I4_MAX returns the maximum of two I4's.

I4_MIN returns the minimum of two I4's.

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 the columns of an I4COL.

I4COL_SORTED_UNIQUE_COUNT counts unique elements in an I4COL.

I4COL_SWAP swaps two columns of an I4COL.

I4MAT_COPY copies one I4MAT to another.

I4MAT_DATA_READ reads data from an I4MAT file.

I4MAT_HEADER_READ reads the header from an I4MAT file.

I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.

I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.

I4MAT_WRITE writes an I4MAT file with no header.

I4ROW_COMPARE compares two rows of a integer array.

I4ROW_SORT_A ascending sorts the rows of an I4ROW.

I4ROW_SWAP swaps two rows of an I4ROW.

I4VEC_HEAP_D reorders an I4VEC into a descending heap.

I4VEC_PRINT prints an I4VEC.

I4VEC_SORT_HEAP_A ascending sorts an I4VEC using heap sort.

I4VEC_ZERO_NEW creates and zeroes an I4VEC.

MESH_BASE_ZERO ensures that the element definition is zerobased.

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_ABS returns the absolute value of an R8.

R8_EPSILON returns the R8 roundoff unit.

R8_HUGE returns a "huge" R8.

R8_NINT returns the nearest integer to an R8.

R8_UNIFORM_01 returns a unit pseudorandom R8.

R8MAT_COPY copies one R8MAT to another.

R8MAT_DATA_READ reads the data from an R8MAT file.

R8MAT_HEADER_READ reads the header from an R8MAT file.

R8MAT_MM multiplies two matrices.

R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.

R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.

R8MAT_WRITE writes an R8MAT file with no header.

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

R8VEC_PRINT prints an R8VEC.

R8VEC_SUM returns the sum of an R8VEC.

REFERENCE_TO_PHYSICAL_Q4 maps Q4 reference points to physical points.

S_LEN_TRIM returns the length of a string to the last nonblank.

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.

SAMPLE_QUAD_NEW 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 in 2D.

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