triangulation_l2q, a FORTRAN90 code which reads information describing a triangulation of a set of points using 3-node ("linear") triangles, and creates a 6-node ("quadratic") triangulation.
The same number of triangles are used, but each triangle is given three extra midside nodes. The coordinates of these nodes are determined by averaging the coordinates of pairs of 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_l2q_nodes.txt contains the node information for the 6-node triangulation. It begins with the node information from nodes.txt, followed by the coordinates of the new nodes.
The output file prefix_l2q_elements.txt contains the triangle information for the 6-node triangulation. There are exactly as many triangles as before, but now each triangle uses six nodes. Each line of the file contains the indices of 6 nodes that form the triangle, listed in a particular order. The first three indices are the vertices, in counterclockwise order. The fourth index is the midside node between vertices 1 and 2, the fifth the midside between vertices 2 and 3, and the sixth the midside between vertices 3 and 1. It should be the case that the first three columns of prefix_l2q_elements.txt are the same as the three columns of prefixelements.txt.
triangulation_l2q prefixwhere prefix is the common filename prefix:
The computer code and data files described and made available on this web page are distributed under the MIT license
triangulation_l2q is available in a C++ version and a FORTRAN90 version and a MATLAB version.
MESH_TO_XML, a FORTRAN90 code 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.
TRIANGULATION, a FORTRAN90 code which carries out various operations on order 3 ("linear") or order 6 ("quadratic") triangulations.
TRIANGULATION_BOUNDARY_NODES, a FORTRAN90 code which reads data defining a triangulation, determines which nodes lie on the boundary, and writes their coordinates to a file.
TRIANGULATION_PLOT, a FORTRAN90 code which reads data defining a triangulation and creates a PostScript image of the nodes and triangles.
TRIANGULATION_Q2L, a FORTRAN90 code which reads data defining a 6-node triangulation, and subdivides each triangle into 4 3-node triangles, writing the resulting triangulation to a file.
TRIANGULATION_QUAD, a FORTRAN90 code which estimates the integral of a function over a triangulated region.
TRIANGULATION_QUALITY, a FORTRAN90 code which reads data defining a triangulation and computes a number of quality measures.