Inputs

py-graspi supports two input formats: one for structured data and one for unstructured data. For structured data, the dimensions of discrete points along each axis \(n_x, n_y, n_z\) must be specified in the first line of the input file. The rest of the file contains a row-wise representation of the corresponding matrix, listing the phases using labels from the available set. This data is organized as a single, contiguous block in row-major order (also known as “C order”). Because the data is structured, graspi can build the local neighborhood as it processes the input.

_images/structuredGraph.png

The input file for the above figure

14 4 1
21 1 0 0
30 1 1 0
40 1 1 0
50 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. 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  0 1    4 1 f  5 1.42 s   1 1 f   -1 1 f
 2
 3  1 1    5 1 f  6 1.42 s   2 1 f   -1 1 f   0 1 f  4 1.42 s
 4
 5  2 0    6 1 f  7 1.42 s   3 1 f   -1 1 f   1 1 f  5 1.42 s
 6
 7  ...
 8
 9  14 1   -2 1 f   15 1 f  11 1.42 s  10 1 f   9 1.42 s  13 1 f
10
11  15 0   -2 1 f   11 1 f  10 1.42 s  14 1 f
12
13  16  0 0 s  1 0 s    2 0 s   3 0 s
14
15  17  15 0 s      14 0 s      13 0 s      12 0 s