You are on page 1of 4

TRIANGULATION_T3_TO_T4 - Convert T3 Mesh to T4 Mesh

http://people.sc.fsu.edu/~jburkardt/f_src/triangulation_t3_to_t4/triangulation_t3_to_t4.html[03/05/2014 21:47:58]
TRIANGULATION_T3_TO_T4
Convert T3 Mesh to T4 Mesh
TRIANGULATION_T3_TO_T4 is a FORTRAN90 program which reads information describing a triangulation
of a set of points using 3-node "T3" triangles, and creates a 4-node "T4" triangulation.
The same number of triangles are used, but each triangle is given one extra node at the centroid. The coordinates of
these nodes are determined by averaging the coordinates of the vertices of the triangles.
The input and output files use the simple TABLE format; comment lines begin with a "#" character. Otherwise,
each line of the file contains one set of information, either the coordinates of a node (for a node file), or the indices
of nodes that make up a triangle, (for a triangle file).
The input file prefix_nodes.txt contains the node information for the 3-node triangulation. Each data line contains
the X and Y coordinates of a single node.
The input file prefix_elements.txt contains the triangle information for the 3-node triangulation. Each line contains
the indices of three nodes that form a triangle, in counterclockwise order.
The output file prefix_t4_nodes.txt contains the node information for the 4-node triangulation. It begins with the
node information from prefix_nodes.txt, followed by the coordinates of the new nodes.
The output file prefix_t4_triangles.txt contains the triangle information for the 4-node triangulation. There are
exactly as many triangles as before, but now each triangle uses four nodes. Each line of the file contains the indices
of 4 nodes that form the triangle. The first three indices are the vertices, in counterclockwise order. The fourth
index is the centroid node..
Usage:
triangulation_t3_to_t4 prefix
where prefix is the common filename prefix:
prefix_nodes.txt contains the node coordinates,
prefix_elements.txt contains the element definitions.
prefix_t4_nodes.txt is the T4 node coordinates,
prefix_t4_elements.txt contains the T4 element definitions.
Licensing:
The computer code and data files described and made available on this web page are distributed under the GNU
LGPL license.
Languages:
TRIANGULATION_T3_TO_T4 is available in a C++version and a FORTRAN90 version and a MATLAB
version.
Related Data and Programs:
FEM_BASIS_T3_DISPLAY, a MATLAB program which displays a basis function associated with a 4-node
triangle "T3" mesh.
TRIANGULATION_T3_TO_T4 - Convert T3 Mesh to T4 Mesh
http://people.sc.fsu.edu/~jburkardt/f_src/triangulation_t3_to_t4/triangulation_t3_to_t4.html[03/05/2014 21:47:58]
FEM_BASIS_T4_DISPLAY, a MATLAB program which displays a basis function associated with a 4-node
triangle "T4" mesh.
TABLE_DELAUNAY, a FORTRAN90 program which computes the triangulation of a set of nodes whose
coordinates are stored in a file.
TRIANGLE, a C program which computes a triangulation of a geometric region.
TRIANGULATION, a FORTRAN90 library which carries out various operations on order 3 ("linear") or order 6
("quadratic") triangulations.
TRIANGULATION_BOUNDARY_NODES, a FORTRAN90 program which reads data defining a triangulation,
determines which nodes lie on the boundary, and writes their coordinates to a file.
TRIANGULATION_CORNER, a FORTRAN90 program which patches triangulations so that no triangle has two
sides on the boundary.
TRIANGULATION_DELAUNAY_DISCREPANCY, a FORTRAN90 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 FORTRAN90 program which computes histograms of data over a
triangulation.
TRIANGULATION_L2Q, a FORTRAN90 program which reads data defining a 3-node triangulation, and adds
midside nodes to create a 6-node triangulation.
TRIANGULATION_MASK, a FORTRAN90 program which takes an existing triangulation and deletes triangles
and their corresponding nodes as requested by the user.
TRIANGULATION_ORDER3, a directory which contains a description and examples of order 3 triangulations.
TRIANGULATION_ORDER4, a directory which contains a description and examples of order 4 triangulations.
TRIANGULATION_ORIENT, a FORTRAN90 program which reads data defining a triangulation, makes sure that
every triangle has positive orientation, and if not, writes a corrected triangle file.
TRIANGULATION_PLOT, a FORTRAN90 program which reads data defining a triangulation and creates a
PostScript image of the nodes and triangles.
TRIANGULATION_QUAD, a FORTRAN90 program which estimates the integral of a function over a
triangulated region.
TRIANGULATION_QUALITY, a FORTRAN90 program which reads data defining a triangulation and computes
a number of quality measures.
TRIANGULATION_RCM, a FORTRAN90 program which reads data defining a triangulation, determines an
ordering of the nodes that will reduce the bandwidth of the adjacency matrix, and writes the new triangulation
information to a file.
TRIANGULATION_REFINE, a FORTRAN90 program which reads data defining a triangulation, replaces each
triangle by four congruent smaller ones, and writes the new triangulation information to a file.
TRIANGULATION_TRIANGLE_NEIGHBORS, a FORTRAN90 program which reads data defining a
triangulation, determines the neighboring triangles of each triangle, and writes that information to a file.
Reference:
TRIANGULATION_T3_TO_T4 - Convert T3 Mesh to T4 Mesh
http://people.sc.fsu.edu/~jburkardt/f_src/triangulation_t3_to_t4/triangulation_t3_to_t4.html[03/05/2014 21:47:58]
1. Marc deBerg, Marc Krevald, Mark Overmars, Otfried Schwarzkopf,
Computational Geometry,
Springer, 2000,
ISBN: 3-540-65620-0.
2. J oseph ORourke,
Computational Geometry,
Second Edition,
Cambridge, 1998,
ISBN: 0521649765,
LC: QA448.D38.
Source Code:
triangulation_t3_to_t4.f90, the source code.
triangulation_t3_to_t4.sh, commands to compile the source code.
Examples and Tests:
EXAMPLE is a simple set of example data:
example_nodes.txt, the nodes for the 3-node triangulation.
example_nodes.png, a PNG image of the nodes.
example_elements.txt, the triangles for the 3-node triangulation.
example.png, a PNG image of the elements.
example_t4_nodes.txt, the nodes for the 4-node triangulation.
example_t4_noes.png, a PNG image of the nodes.
example_t4_elements.txt, the triangles for the 4-node triangulation.
examples_t4.png, a PNG image of the elements.
example_output.txt the output file.
List of Routines:
MAIN is the main program for TRIANGULATION_T3_TO_T4.
CH_CAP capitalizes a single character.
CH_EQI is a case insensitive comparison of two characters for equality.
CH_TO_DIGIT returns the integer ( kind = 4 ) value of a base 10 digit.
DTABLE_CLOSE_WRITE closes a file used to write a DTABLE.
DTABLE_DATA_READ reads data from a double precision table file.
DTABLE_DATA_WRITE writes data to a double precision table file.
DTABLE_HEADER_READ reads the header from a double precision table file.
DTABLE_HEADER_WRITE writes the header to a double precision table file.
DTABLE_OPEN_WRITE opens a file to write a DTABLE.
DTABLE_WRITE writes a DTABLE to a file.
FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
FILE_NAME_EXT_GET determines the "extension" of a file name.
FILE_NAME_EXT_SWAP replaces the current "extension" of a file name.
FILE_ROW_COUNT counts the number of row records in a file.
GET_UNIT returns a free FORTRAN unit number.
I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
I4MAT_TRANSPOSE_PRINT_SOME prints some of the transpose of an I4MAT.
ITABLE_CLOSE_WRITE closes a file used to write an ITABLE.
ITABLE_DATA_READ reads data from an integer ( kind = 4 ) table file.
ITABLE_DATA_WRITE writes data to an integer ( kind = 4 ) table file.
ITABLE_HEADER_READ reads the header from an integer ( kind = 4 ) table file.
ITABLE_HEADER_WRITE writes the header to an integer ( kind = 4 ) table file.
ITABLE_WRITE writes an ITABLE file.
TRIANGULATION_T3_TO_T4 - Convert T3 Mesh to T4 Mesh
http://people.sc.fsu.edu/~jburkardt/f_src/triangulation_t3_to_t4/triangulation_t3_to_t4.html[03/05/2014 21:47:58]
ITABLE_OPEN_WRITE opens a file to write ITABLE data.
R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
S_BLANK_DELETE removes blanks from a string, left justifying the remainder.
S_INDEX_LAST finds the LAST occurrence of a given substring.
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.
TIMESTAMP prints the current YMDHMS date as a time stamp.
TIMESTRING writes the current YMDHMS date into a string.
You can go up one level to the FORTRAN90 source codes.
Last revised on 14 March 2009.

You might also like