Input Formats¶
GraSPI
accepts two input formats for structured and unstructured data.
The structured data assumes that size of discrete points in each dimension is known.
The dimensionality is provided in the first line of the input file: \(n_x, n_y, n_z\).
The reminder of the input file contains the array (row-wise representation of the corresponding matrix) with the corresponding phases from the set of available labels. It is a single contiguous block in row-major order (sometimes called “C order”).
Since the data is structured, the local neighborhood can be constructed as the data is read by GraSPI
.
The input file for the above figure
1 2 3 4 5 | 4 4 1
1 1 0 0
0 1 1 0
0 1 1 0
0 0 1 0
|
Note that the first row is considered to be adjacent to the cathode (BLUE meta-vertex), while the last row is considered to be adjacent to anode (RED meta vertex).
The second format corresponds to unstructured data, where information about
phases needs to provided along with the neighborhood.
Here, we use the adjacency matrix to inform GraSPI
on the neigborhood.
The input file start with the total number of vertices in the data set.
Next each line provides the information about each vortex.
First the index of the vertex is provided followed by the color of the vertex.
The reminder of the line consist of triplets with information about the neighbors.
The triplet consists of the index of the neighbor, the distance from to the neighbor and type of the neighbor.
In this example, two types of neighbors are considered: f
, s
and t
that
corresponds to first-, second- and third-order neighbors, respectively.
The set of types may be redefined to encode additional information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 0 1 4 1 f 5 1.42 s 1 1 f -1 1 f
1 1 5 1 f 6 1.42 s 2 1 f -1 1 f 0 1 f 4 1.42 s
2 0 6 1 f 7 1.42 s 3 1 f -1 1 f 1 1 f 5 1.42 s
...
14 1 -2 1 f 15 1 f 11 1.42 s 10 1 f 9 1.42 s 13 1 f
15 0 -2 1 f 11 1 f 10 1.42 s 14 1 f
16 0 0 s 1 0 s 2 0 s 3 0 s
17 15 0 s 14 0 s 13 0 s 12 0 s
|