Data Files for FAST consists of a grid file, containing the coordinates of the points on the grid and, if unstructured, connectivity information. Additional files - solution and function files - provide vectors, scalars and other information. The data format that FAST uses is called Plot3d. The grids may be structured or unstructured , which is sometimes called finite element data or triangulated data.
Data files may contain more than one "zone".The files can be binary, produced either by C or`q FORTRAN programs, or text files. Here we will discuss only single zone text files. Multiple zone files are similar. Contact the graphics support coordinator, or the FAST User Guide for more information.
It doesn't matter how many entries there are per line.
Here is a simple example.
4 3 2
0.0 3.0 6.0 9.0
1.0 4.0 7.0 10.0
2.0 5.0 8.0 11.0
0.5 3.5 6.5 9.5
1.5 4.5 7.5 10.5
2.5 5.5 8.5 11.5
10.0 10.0 10.0 10.0
11.0 11.0 11.0 11.0
12.0 12.0 12.0 12.0
10.5 10.5 10.5 10.5
11.5 11.5 11.5 11.5
12.5 12.5 12.5 12.5
20.0 20.0 20.0 20.0
20.0 20.0 20.0 20.0
20.0 20.0 20.0 20.0
25.5 25.5 25.5 25.5
25.5 25.5 25.5 25.5
25.5 25.5 25.5 25.5
This means that the size of the grid is 4 x 3 x 2. The next 24 entries are
the x-coordinates. After that come the 24 y-coordinates followed by the 24
z-coordinates.
The points of the grid are at (0.0, 10.0, 20.0), (3.0, 10.0, 20.0) ...
4 3 2 1
0.1 0.2 0.3 0.4 0.5 0.6
0.7 0.8 0.9 1.0 1.1 1.2
2.1 2.2 2.3 2.4 2.5 2.6
2.7 2.8 2.9 3.0 3.1 3.2
The 1 on the first line states that there is one data value per point.
4 3 2 3
1.0 1.1 1.2 1.3 1.4 1.5
1.6 1.7 1.8 1.9 2.0 2.1
-1.0 -1.1 -1.2 -1.3 -1.4 -1.5
-1.6 -1.7 -1.8 -1.9 -2.0 -2.1
5.0 5.1 5.2 5.3 5.4 5.5
5.6 5.7 5.8 5.9 6.0 6.1
-5.0 -5.1 -5.2 -5.3 -5.4 -5.5
-5.6 -5.7 -5.8 -5.9 -6.0 -6.1
0.0 0.0 0.1 0.1 0.2 0.2
0.3 0.3 0.4 0.4 0.5 0.5
0.0 0.0 -0.1 -0.1 -0.2 -0.2
-0.3 -0.3 -0.4 -0.4 -0.5 -0.5
The last 3 on the first line states that there are 3 data value
per point. In this example, The vectors are (1.0, 5.0, 0.0), (1.1, 5.1,0.0),
(1.2, 5.2, 0.1) ... (-2.1, -6.1, -0.5).
The scalar files for 2D data consists of three integers, the dimensions and the number 1, followed by the scalars
The scalar files for 2D data consists of three integers, the dimensions and the number 2, followed by all the x-coordinates then the y-coordinates.
Be sure to select 2D in the "File IO" module
Here is a simple 2D grid file.
3 2
1 2 3 2 3 4
5 6 7 7 8 9
The coordinates are (1,5), (2,6), ... (4,9).
A corresponding vector function file.
3 2 2
1.0 1.5 2.0 1.0 1.5 2.0
1.0 1.0 1.0 1.5 1.5 1.5
The vectors are (1.0,1.0), (1.5,1.0), ... (2.0,1.5)
Essentally, FAST reads in only 3D files. The 3D file includes the number of points, triangles, tetrahedra and the coordinates of the points. 2D data can be used by setting the number of tetrahedra to 0 and each of the z-coordinates to 0.0.
The grid file must contain 3 integers (the number of points, the number of triangles, the number of tetrahedra), followed by all the x-coordinates, all the y-coordinates, all the z coordinates, followed by a list of the vertices of each of the triangles, followed by an integer flag for each of the triangles, then a list of the verticies of each of the tetrahedra. For example, here is the data file for triangles of a square. The first column is the actual file, the second, not part of the file, contains a description of the file line.
| Grid File | Meaning |
|---|---|
| 4 2 0 | 4 points, 2 triangles, no tetrahedra |
| 0.0 1.0 1.0 0.0 | The x-coordinates |
| 0.0 0.0 1.0 1.0 | The y-coordinates |
| 0.0 0.0 0.0 0.0 | The z-coordinates |
| 1 2 3 | Indices of the vertices of the 1st triangle |
| 1 3 4 | Indices of the vertices of the 2nd triangle |
| 2 2 | Display each triangle (2 triangles, so two 2's.) |
Note: For each triangle, there is the integer 2. The 2 tells FAST to draw the triangle. There are other flags and they are described in the manual, but I cannot seem to find again, now that I need to.
When you read in the file, be sure to select "Unstructured". You do not want to select "2D". Unstructured files are all 3D, here all z-coordinates are in the plane z = 0.
Here is the data file for a cube cut into 6 tetrahedra.
| Grid File | Meaning |
|---|---|
| 8 18 6 | 8 points, 18 triangles and 6 tetrahedra | 0 1 1 0 0 1 1 0 | The x-coordinates | 0 0 1 1 0 0 1 1 | The y-coordinates | 0 0 0 0 1 1 1 1 | The z-coordinates | 1 2 3 | The 18 triangles | 1 2 5 | 1 3 5 | 2 3 5 | 2 3 6 | 2 5 6 | 3 5 6 | 3 5 7 | 3 6 7 | 5 6 7 | 1 3 4 | 1 4 5 | 3 4 5 | 3 4 7 | 4 5 7 | 4 5 8 | 4 7 8 | 5 7 8 | 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 | A 2 for each triangle | 1 2 3 5 | The 6 tetrahedra | 2 3 5 6 | 3 5 6 7 | 1 3 4 5 | 3 4 5 7 | 4 5 7 8 |
Likewise, function files consists of 4 integers (the number of points, the number 1, the number 1, and the number 3) followed by all the x-components, then the y-components and lastly, all the z-components. There must be one vector for each point. Again, there are no 2D vector functions files, but each of the z-components may be zero.