TRIANGULATION_CORNER
Handle triangulation corners. {#triangulation_corner-handle-triangulation-corners. align="center"}
TRIANGULATION_CORNER is a C++ program which tries to correct situations in which a triangulation includes corner triangles, that is, triangles which have two sides on boundary.
Especially in finite element settings, such a triangle is considered undesirable. Especially in the case when a linear (order 3) finite element is involved, the function approximation in the interior of the triangle will be entirely determined by boundary data. If, for instance, the solution is constrained to be zero on the boundary, then the finite element function will be zero throughout the interior of the corner triangle.
Presumably, the triangle has a neighbor triangle on the one non-boundary side. It is generally possible and reasonable to replace these two triangles but another two which fill the same quadrilateral, but which are separated by the other diagonal of the quadrilateral.
The initial situation at the corner is suggest by the following diagram:
|/ |/
A---C--
|\ |\
| \ |
| \|
B---D--
By rearranging the corner triangle and its neighbor, we have the more satisfactory triangulation:
|/ |/
A---C--
| /|\
| / |
|/ |
B---D--
triangulation_corner prefix
where prefix is the common filename prefix:
- prefix_nodes.txt contains the node coordinates,
- prefix_elements.txt contains the element definitions.
- prefix_corner_nodes.txt will contain the revised node coordinates,
- prefix_corner_elements.txt will contain the revised element definitions.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
TRIANGULATION_CORNER is available in a C++ version and a FORTRAN90 version and a MATLAB version.
MESH_TO_XML, a C++ program which reads information defining a 1D, 2D or 3D mesh, namely a file of node coordinates and a file of elements defined by node indices, and creates a corresponding XML file for input to DOLFIN or FENICS.
TABLE_DELAUNAY, a C++ program which reads a file of point coordinates in the TABLE format and writes out the Delaunay triangulation.
TRIANGLE, a C program which computes a triangulation of a geometric region.
TRIANGULATION, a C++ library which performs various operations on order 3 ("linear") or order 6 ("quadratic") triangulations.
TRIANGULATION_BOUNDARY_NODES, a C++ program which reads data defining a triangulation, determines which nodes lie on the boundary, and writes their coordinates to a file.
TRIANGULATION_DELAUNAY_DISCREPANCY, a C++ program which measures the amount by which a triangulation fails the local Delaunay test;
TRIANGULATION_DISPLAY_OPENGL, a C++ program which reads files defining a triangulation and displays an image using Open GL.
TRIANGULATION_HISTOGRAM, a C++ program which computes histograms of data over a triangulation.
TRIANGULATION_L2Q, a C++ program which reads information about a 3-node (linear) triangulation and creates data defining a corresponding 6-node (quadratic) triangulation;
TRIANGULATION_MASK, a C++ program which reads a triangulation and calls a user-supplied routine to consider each triangle for deletion;
TRIANGULATION_NODE_TO_ELEMENT, a C++ program which reads files describing a set of nodes, their triangulation, and the value of one or more quantities at each node, and outputs a file that averages the quantities for each element. This operation in effect creates an "order1" finite element model of the data.
TRIANGULATION_ORDER3, a data directory which contains examples of TRIANGULATION_ORDER3 files, description of a linear triangulation of a set of 2D points, using a pair of files to list the node coordinates and the 3 nodes that make up each triangle;
TRIANGULATION_ORDER6, a data directory which contains examples of TRIANGULATION_ORDER6 files, a description of a quadratic triangulation of a set of 2D points, using a pair of files to list the node coordinates and the 6 nodes that make up each triangle.
TRIANGULATION_ORIENT, a C++ program which ensures that the triangles in an order 3 or order 6 triangulation have positive orientation;
TRIANGULATION_PLOT, a C++ program which makes a PostScript image of a triangulation of points.
TRIANGULATION_QUAD, a C++ program which estimates the integral of a function over a triangulated region.
TRIANGULATION_REFINE, a C++ program which can refine a triangulation.
TRIANGULATION_TRIANGLE_NEIGHBORS, a C++ program which reads data defining a triangulation, determines the neighboring triangles of each triangle, and writes that information to a file.
- Joseph ORourke,
Computational Geometry,
Second Edition,
Cambridge, 1998,
ISBN: 0521649765,
LC: QA448.D38.
- triangulation_corner.cpp, the source code.
P03 is the square with a hole. The initial mesh has 1 corner triangle.
- p03_nodes.txt the mesh nodes of the problem.
- p03_elements.txt the mesh triangles of the problem.
- p03.png a PNG image of the initial mesh.
- p02_corner_elements.txt the triangle file after corner triangles have been repaired.
- p02_corner.png a PNG image of the repaired mesh.
P05 is the horn. The initial mesh has 4 corner triangles.
- p05_nodes.txt the mesh nodes of the problem.
- p05_elements.txt the mesh triangles of the problem.
- p05.png a PNG image of the initial mesh.
- p05_corner_elements.txt the triangle file after corner triangles have been repaired.
- p05_corner.png a PNG image of the repaired mesh.
P08 is the holey pie slice. The initial mesh has 2 corner triangles.
- p08_nodes.txt the mesh nodes of the problem.
- p08_elements.txt the mesh triangles of the problem.
- p08.png, a PNG image of the initial mesh.
- p08_corner_elements.txt the triangle file after corner triangles have been repaired.
- p08_corner.png a PNG image of the repaired mesh.
P09 is Jeff Borggaard's square with two hexagonal holes. The initial mesh has 3 corner triangles.
- p09_nodes.txt the mesh nodes of the problem.
- p09_elements.txt the mesh triangles of the problem.
- p09.png a PNG image of the initial mesh.
- p09_corner_elements.txt the triangle file after corner triangles have been repaired.
- p09_corner.png a PNG image of the repaired mesh.
P10 is the unit square. The initial mesh has 4 corner triangles.
- p10_nodes.txt the mesh nodes of the problem.
- p10_elements.txt the mesh triangles of the problem.
- p10.png a PNG image of the initial mesh.
- p10_corner_elements.txt the triangle file after corner triangles have been repaired.
- p10_corner.png a PNG image of the repaired mesh.
P11 is the L-shaped region. The initial mesh has 4 corner triangles.
- p11_nodes.txt the mesh nodes of the problem.
- p11_elements.txt the mesh triangles of the problem.
- p11.png a PNG image of the initial mesh.
- p11_corner_elements.txt the triangle file after corner triangles have been repaired.
- p11_corner.png a PNG image of the repaired mesh.
Q11 is the L-shaped region, but with quadratric (6 node) triangles. The initial mesh has 4 corner triangles. Because we are using quadratic triangles, when we merge two triangles and swap the diagonal, the midside node on the common diagonal will no longer lie on a line, midway between the two vertices. TRIANGULATION_CORNER assumes this is undesirable, and recomputes the coordinates of such midside nodes, and outputs a modified node coordinate file as well as the new triangle file.
- q11_nodes.txt the mesh nodes of the problem.
- q11_elements.txt the mesh triangles of the problem.
- q11.png a PNG image of the initial mesh.
- q11_nodes.corner.txt the node coordinate file after corner triangles have been repaired, which, for quadratric triangles, requires adjusting some midside nodes.
- q11_corner_elements.txt the triangle file after corner triangles have been repaired.
- q11_corner.png a PNG image of the repaired mesh.
P12 is the John Shadid's H-shaped region. The initial mesh has 7 corner triangles.
- p12_nodes.txt the mesh nodes of the problem.
- p12_elements.txt the mesh triangles of the problem.
- p12.png a PNG image of the initial mesh.
- p12_corner_elements.txt the triangle file after corner triangles have been repaired.
- p12_corner.png a PNG image of the repaired mesh.
P13 is the Sandia fork. The initial mesh has 6 corner triangles.
- p13_nodes.txt the mesh nodes of the problem.
- p13_elements.txt the mesh triangles of the problem.
- p13.png a PNG image of the initial mesh.
- p13_corner_elements.txt the triangle file after corner triangles have been repaired.
- p13_corner.png a PNG image of the repaired mesh.
P14 is Marcus Garvie's Lake Alpha, with Beta Island. The initial mesh has 5 corner triangles. (Must be small!)
- p14_nodes.txt the mesh nodes of the problem.
- p14_elements.txt the mesh triangles of the problem.
- p14.png a PNG image of the initial mesh.
- p14_corner_elements.txt the triangle file after corner triangles have been repaired.
- p14_corner.png a PNG image of the repaired mesh.
P15 is Sangbum Kim's forward step region. The initial mesh has 6 corner triangles.
- p15_nodes.txt the mesh nodes of the problem.
- p15_elements.txt the mesh triangles of the problem.
- p15.png a PNG image of the initial mesh.
- p15_corner_elements.txt the triangle file after corner triangles have been repaired.
- p15_corner.png a PNG image of the repaired mesh.
P16 is Kevin Pond's elbow, a quarter of a circular annulus. The initial mesh has 1 corner triangle.
- p16_nodes.txt the mesh nodes of the problem.
- p16_elements.txt the mesh triangles of the problem.
- p16.png a PNG image of the initial mesh.
- p16_corner_elements.txt the triangle file after corner triangles have been repaired.
- p16_corner.png a PNG image of the repaired mesh.
P17 is the rectangular channel with a Reuleaux triangle obstacle. The initial mesh has 4 corner triangles.
- p17_nodes.txt the mesh nodes of the problem.
- p17_elements.txt the mesh triangles of the problem.
- p17.png a PNG image of the initial mesh.
- p17_corner_elements.txt the triangle file after corner triangles have been repaired.
- p17_corner.png a PNG image of the repaired mesh.
- MAIN is the main program for TRIANGULATION_CORNER.
- 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.
- FILE_COLUMN_COUNT counts the columns in the first line of a file.
- FILE_EXIST reports whether a file exists.
- 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.
- I4MAT_DATA_READ reads data from an I4MAT file.
- I4MAT_HEADER_READ reads the header from an I4MAT file.
- 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_ZERO zeroes an I4VEC.
- R8MAT_DATA_READ reads the data from an R8MAT file.
- R8MAT_HEADER_READ reads the header from an R8MAT file.
- R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
- R8MAT_WRITE writes an R8MAT file with no header.
- 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.
- SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
- TIMESTAMP prints the current YMDHMS date as a time stamp.
- TRIANGLE_AREA_2D computes the area of a triangle in 2D.
- TRIANGULATION_ORDER3_NEIGHBOR_TRIANGLES determines triangle neighbors.
- TRIANGULATION_ORDER6_NEIGHBOR_TRIANGLES determines triangle neighbors.
You can go up one level to the C++ source codes.
Last revised on 22 August 2009.