Project

General

Profile

Actions

DataOrdering » History » Revision 1

Revision 1/2 | Next »
Ted Sume, 11/13/2019 03:19 PM


DataOrdering

Data Ordering

Jump to

Background

VizSchema has to take into account four different kinds of data ordering.
These variations come from the fact that the components of a field can be either the first or last index, and then either the first (Fortran) or last index (C) can be most slowly or rapidly varying, depending on the language.
In the following examples, index i0 varies most slowly, while index i2 varies fastest.

Index order

In component minor, the component index, ic, appears last.
The C reference would be array[i0][i1][i2][ic], while the Fortran reference would be array(i2, i1, i0, ic).

In component major, the component index, ic, appears first.
The C reference would be array[ic][i0][i1][i2], while the Fortran reference would be array(ic, i2, i1, i0).

Index rapidity
When addressing the array in memory, two adjacent memory locations can differ by unity in either the first index (Fortran) or the last index (C). Since data is generally written to HDF5 files without changing the order, the index rapidity must be specified.

Index order types

Hence, for structured data and irregular structured meshes (for which the component is the coordinate) in 2D or 3D, there are four possible data orderings, itemized below as to how the data would be in memory with C ordering:

 [ix][iy][iz][ic] compMinorC
 [iz][iy][ix][ic] compMinorF (same as compMinorC for 1D)
 [ic][ix][iy][iz] compMajorC 
 [ic][iz][iy][ix] compMajorF (same as compMajorC for 1D)

Thus, structured data and irregular structured meshes have the option attribute vsIndexOrder:

  vsIndexOrder = "compMajorF"       // Default value is "compMinorC", with other possibilities being
                                    // "compMinorF", "compMajorC", and "compMajorF"

Data follows the mesh. So data that is on a compMinorC mesh is assumed to have compMinorC ordering. Uniform and rectilinear meshes do not have a vsIndexOrder attribute, so data on such meshes can have a vsIndexOrder attribute that is compMinorC by default, but could be specified as any of compMajorC, compMinorF, or compMajorF.
For unstructured meshes, the data is of rank 2, i.e., it is just a list of the (x, y, z) values. In this case, we have the simpler attribute,

  vsIndexOrder = "compMajor"       // Default value is "compMinor".  These are 
                                   // the only possibilities.

Updated by Ted Sume about 5 years ago · 1 revisions