# test_triangulation

test_triangulation, an Octave code which sets up a number of triangulation test problems.

As far as possible, a uniform and abstract approach has been used. For each test region, a number of routines are provided, via which it is possible for the user to determine many things about the region. Often, just one or two routines would be needed for a particular purpose. The names of the routines, and their purposes are:

• BOUNDARY_NEAREST: returns the nearest point on the boundary of the region to a given point or set of points;
• BOUNDARY_PROJECT: replaces an exterior point by the nearest point on the boundary;
• BOUNDARY_SEGMENT: returns a sequence of roughly equally spaced points that lie on one particular boundary segment;
• BOUNDARY_SEGMENT_LENGTH: returns the "length" (number of nodes) of a particular boundary segment. This simply counts the number of points needed to trace or approximate the boundary segment;
• BOUNDARY_SEGMENT_NUM: returns the number of boundary segments. Simple regions have one boundary segment. A region with one hole has two, and so on;
• BOX: returns a bounding box for the region. All points in the region are within this box;
• DENSITY: the value of the mesh density function at any point in the region. If this is not constant, then high values correspond to places where many more mesh points should be placed;
• ELEMENT_SIZE: returns a requested typical element size. This refers to the average size of the triangles formed by a triangulation of the points;
• FIXED_NUM: returns the number of points which must be included as nodes of the mesh (which may be zero);
• FIXED_POINTS: returns the coordinates of the points which must be included as nodes of the mesh;
• HEADER: prints a brief description of the problem;
• HOLE_NUM: returns the number of "holes" in the region;
• HOLE_POINT: returns the coordinates of one point in a hole (useful when TRIANGLE is to be invoked);
• INSIDE: reports which of a given set of points are inside the regioin.
• SAMPLE: returns a set of sample points from the region, chosen with uniform probability;
• SAMPLE_H1: returns a set of sample points from the region after it has been enlarged by an amount H1;
• SDIST: returns the signed distance to the boundary of the region for each of a set of input points. (a positive distance means the point is outside the region, a negative distance means it is inside); (Not ready for problems 4, 5, 6, 7, 8, 9 )
• TITLE: a title for the problem;

The test problems include:

1. The unit circle;
2. The unit circle with a circular hole;
3. A square with a circular hole;
4. A hexagon with a hexagonal hole;
5. The horn;
6. The superellipse with a superelliptical hole;
7. The bicycle seat;
8. The slice of pie with a circular hole and triangular notch;
9. Jeff Borggaard's square with two hexagonal holes;
10. The unit square;
11. The L-shaped region;
13. The Sandia fork;
14. Marcus Garvie's Lake Alpha, with Beta Island;
15. Sangbum Kim's forward step;

### Languages:

test_triangulation is available in a Fortran90 version and a MATLAB version and an Octave version.

### Related Data and Programs:

distmesh, an Octave code which can work from a simple description of the boundary of a region to produce a triangulation of that region.

mesh2d, an Octave code which can automatically create a triangular mesh for a given polygonal region, by darren engwirda.

test_triangulation, an Octave code which defines a number of test regions to be triangulated.

triangulation, an Octave code which carries out various operations on order 3 ("linear") or order 6 ("quadratic") triangulations.

triangulation_order3, a data directory which describes the format for triangulations of order 3.

triangulation_order6, a data directory which describes the format for triangulations of order 6.

### Reference:

1. Per-Olof Persson and Gilbert Strang,
A Simple Mesh Generator in MATLAB,
SIAM Review,
Volume 46, Number 2, June 2004, pages 329-345.

### Source Code:

Last revised on 07 June 2023.