next up previous contents
Next: Specifying initial and boundary Up: Creating or Reading in Previous: Using the triangle libraries   Contents


Reading triangular grids from a file

Use of the -t flag creates three files specified in suntans.dat: points, cells, and edges. By default, these are specified to be

points    points.dat
edges     edges.dat
cells     cells.dat
The points file contains a listing of the x-y coordinates of the Delaunay points in the full triangulation before being subdivided among different processors. This file contains three columns although the last column is never used. The total number of lines in this file is $N_p$, the number of triangle vertics in the triangulation. The edges file contains $N_e$ rows each of which defines an edge in the triangulation, and five columns in the following format:
Point1 Point2 Marker Voronoi1 Voronoi2
Point1 and Point2 contain indices to points in the points file and make up the end points of the Delaunay edges. Because SUNTANS uses C-style indexing, then $0\le$Point1,Point2$<N_p$. Marker specifies the type of edge. If Marker=0, then it is a computational edge, otherwise, it is a boundary edge, and the boundary condition is specified in Section 4.2. The last two entries, Voronoi1 and Voronoi2, are the indices to the Voronoi points which make up the end points of the Voronoi edge which intersects this Delaunay edge. As such, we must have $0\le$Voronoi1,Voronoi2$<N_c$. These Voronoi points correspond to triangles defined in the file cells. Voronoi points which are ghost points are indicated by a $-1$. The cells file contains $N_c$ rows each of which corresponds to a triangle in the triangulation, and 8 columns in the following format:
xv yv Point1 Point2 Point3 Neigh1 Neigh2 Neigh3
The xv and yv points correspond to the x-y coordinates of the Voronoi points of each triangle and Point1, Point2, and Point3 correspond to indices to points in the points file which make up the vertices of the triangle. These indices must satisfy
$0\le$Point1,Point2,Point3$<N_p$.
Neigh1, Neigh2, and Neigh3 correspond to indices to neighboring triangles. Neighboring triangles which correspond to ghost points are represented by a $-1$. For neighbors not lying outside boundaries, we must have
$0\le$Neigh1,Neigh2,Neigh3$<N_c$.
Because SUNTANS determines the number of triangle vertices $N_p$, edges $N_e$, and cells $N_c$ by the number of rows in the points, cells, and edges files, respectively, it is important not to have extra carriage returns at the end of these files.

These three files are generated each time the -t flag is used with SUNTANS. If the -t flag is not used, then when called with $\verb+-g+$, SUNTANS reads these three files and computes grid geometry and, if desired, partitions it among several processors. The -g flag outputs the following data files, which are specified in suntans.dat. One file associated with each of these descriptors is created for each processor in a partitioned grid. For example, if the file name specified after cells in suntans.dat is given by cells.dat, then when called with 2 processors, the -g flag would output two files names cells.dat.0 and cells.dat.1, each corresponding to the cells file of each processor.


next up previous contents
Next: Specifying initial and boundary Up: Creating or Reading in Previous: Using the triangle libraries   Contents
2014-08-06