Project

General

Profile

Meshes » History » Version 3

John Cary, 10/14/2020 08:28 AM

1 1 Ted Sume
# Meshes
2
3
# Meshes and their metadata
4
5
[Variables](https://ice.txcorp.com/vizschema/wiki/Variables) live on meshes. Here we define the attributes of meshes. 
6
Since most of viz tools treat plots with time on axis as regular plots, time sequences are treated as data on 1D meshes. Such meshes use vsTemporalDimension attribute. They make sense only for structured meshes (defined axis). 
7
Below, Att signifies an attribute. 
8
9
**Jump to**
10
11 2 Ted Sume
* [Variables and their metadata](https://ice.txcorp.com/projects/vizschema/wiki/Variables) 
12
* [Variables that are combined with their meshes](https://ice.txcorp.com/projects/vizschema/wiki/VariablesWithMesh)
13
* [Data ordering](https://ice.txcorp.com/projects/vizschema/wiki/DataOrdering)
14
* [Variables defined in terms of other variables](https://ice.txcorp.com/projects/vizschema/wiki/DerivedVariables) 
15
* [Multidomain metadata](https://ice.txcorp.com/projects/vizschema/wiki/MultiDomainMetaData)
16
* [Other metadata](https://ice.txcorp.com/projects/vizschema/wiki/OtherMetaData)
17 1 Ted Sume
18
**Uniform cartesian meshes**
19
20
are meshes with cell lengths constant in each direction. They are represented by an HDF5 group. The data in that group is 
21
```
22
Group "mycartgrid" {
23
  Att vsType = "mesh"                         // Required string
24
  Att vsKind = "uniform"                      // Required string
25 3 John Cary
  Att vsAxis0 = "axis0"                       // Axis name (optional, default = "axis0") gives to the name of the 
26
                                              // array containing the points of the first axis.  Must be at this level.
27
  Att vsAxis1 = "axis1"                       // Axis name (optional, default = "axis1") gives to the name of the 
28
                                              // array containing the points of the second axis.  Must be at this level.
29
  Att vsAxis2 = "axis2"                       // Axis name (optional, default = "axis2") gives to the name of the 
30
                                              // array containing the points of the third axis.  Must be at this level.
31 1 Ted Sume
  Att vsStartCell = [0, 0, 0]                 // Required integer array if part of a larger mesh
32
  Att vsNumCells = [200, 200, 104]            // Required integer array giving the number of cells in the x, y, and z directions, respectively
33
  Att vsIndexOrder = "compMinorC"             // Default value is "compMinorC", with the other choice being "compMinorF".
34
                                              // ("compMajorC" and "compMajorF" have the same result as the minor variants). 
35
  Att vsLowerBounds = [-2.5, -2.5, -1.3]      // Required float array
36
  Att vsUpperBounds = [2.5, 2.5, 1.3]         // Required float array
37
  Att vsTemporalDimension = 0                 // Optional unsigned integer denoting which axis is time.
38
                                              // No temporal axis if this attribute is not present.
39
}
40
```
41
* vsType allows the schema to identify this group as a VizSchema mesh. 
42
* vsKind indicates the kind of mesh, in this case a uniform cartesian mesh. 
43
* vsStartCell gives the start location of this mesh in some larger mesh contained in many files. 
44
* vsNumCells gives the number of cells for the mesh (in this file). There is one more node than number of cells in each direction. 
45
* vsIndexOrder indicates the interpretation of the indices for the data set. See [Data Ordering](https://ice.txcorp.com/vizschema/wiki/DataOrdering). E.g., for "compMinorC", the first index is the x index, the second index is the y index, and the last index is the z index. 
46
* vsLowerBounds gives the cartesian coordinate of smallest values of the coordinates. 
47
* vsUpperBounds gives the cartesian coordinate of largest values of the coordinates. 
48
49
The optional variables (not implemented in VizSchema 3.0.0), 
50
51
* vsTransform allows for the definition of a second mesh that is found from this mesh as a transformation. For example, this mesh could be (r, phi, z) coordinates, and the transformation could be to (x, y, z) coordinates. 
52
* vsTransformedMesh gives the name of the transformed mesh. 
53
54
are also possible. They are shown below. 
55
56
**Rectilinear meshes**
57
58
are meshes that can be described by a set of 3 1D arrays. The arrays do not need to have uniform variable spacing, which distinguishes this type of mesh from a uniform mesh. 
59
```
60
Group "myrectgrid" {
61
  Att vsType = "mesh"                         // Required string
62
  Att vsKind = "rectilinear"                  // Required string
63
  Att vsAxis0 = "axis0"                       // Axis name (optional, default = "axis0") gives to the name of the 
64
                                              // array containing the points of the first axis.  Must be at this level.
65
  Att vsAxis1 = "axis1"                       // Axis name (optional, default = "axis1") gives to the name of the 
66
                                              // array containing the points of the second axis.  Must be at this level.
67
  Att vsAxis2 = "axis2"                       // Axis name (optional, default = "axis2") gives to the name of the 
68
                                              // array containing the points of the third axis.  Must be at this level.
69
  Dataset axis0[n0]                           // Axis data, name must be value of vsAxis0 attribute
70
  Dataset axis1[n1]                           // Axis data, name must be value of vsAxis1 attribute
71
                                              // (present for 2-D and 3-D meshes)
72
  Dataset axis2[n2]                           // Axis data, name must be value of vsAxis2 attribute (present for 3-D meshes)
73
  Att vsTransform = "cylindricalZRPhi"        // Optional. Declares that this mesh is in cylindricalZRPhi format
74
  Att vsTransformedMesh = "resultCartGrid"    // Optional name of the transformed (cartesian) mesh.
75
  Att vsLimits = "mylimits"                   // Optional string
76
  Att vsTemporalDimension = 0                 // Optional unsigned integer denoting which axis is time.
77
                                              // No temporal axis if this attribute is not present.
78
}
79
```
80
* vsType allows the schema to identify this group as a VizSchema mesh. 
81
* vsKind indicates the kind of mesh, in this case a rectilinear mesh. 
82
* vsLimits points to a [visualization region](https://ice.txcorp.com/vizschema/wiki/OtherMetaData) 
83
* vsTransform defines a second mesh that is created from this mesh as a transformation. In this example, the mesh is in (z, r, phi) coordinates, and the transformation will be to (x, y, z) coordinates. 
84
* vsTranformedMesh gives the name of the transformed mesh. If not present, it is given by the name of the group with transformed appended. 
85
86
The concept of a transformed mesh (implemented using "vsTransform" attribute) allows one to have the compactness of the rectilinear or uniform mesh description while actually creating a curvilinear mesh. Note that the transforms are implemented only for rectilinear 3D meshes and the only type of the transform is "cylindricalZRPhi" ("Cylindrical" is deprecated but is supported for backward compatibility and means the same as cylindricalZRPhi). Additional or other than 3D transforms will be added as necessary. Many more transformations can be imagined, such as "spherical", "cylindrical(phi,z,r)", "cylindrical(r,-phi,z)", "cartesian(z,x,y)", "ellipsoidal", "WGS84", "equatorial", etc. Also, in BOR (body-of-revolution) situations, the transformation is into the cartesian-like Z-R plane, rather than to cartesian per se. 
87
88
**Example** : A 3-D z-r-phi grid could be described by: 
89
```
90
Group "myCylindricalGrid" {
91
  Att vsType = "mesh"            
92
  Att vsKind = "rectilinear"     
93
  Att vsAxis0 = "z"                           // The name of the dataset containing values for axis 0
94
  Att vsAxis1 = "r"                           // The name of the dataset containing values for axis 1
95
  Att vsAxis2 = "phi"                         // The name of the dataset containing values for axis 2
96
  Dataset z[n2]                               // Axis data corresponding to vsAxis0
97
  Dataset r[n0]                               // Axis data corresponding to vsAxis1
98
  Dataset phi[n1]                             // Axis data corresponding to vsAxis2
99
  Att vsLimits = "mylimits"                   // Optional string specifying a "limits" group
100
}
101
```
102
**Structured meshes**
103
104
Allow each point in the mesh to be specified individually, but the connectivity is fixed. 
105
106
Generally speaking, a structured mesh is described by a single dataset. The size of this dataset depends on the spatial dimensionality of the mesh.
107
108
A 3-Dimensional mesh will have a dataset with 4 dimensions. The x location of point (i, j, k) is stored in dataset[i][j][k][0], the y location is in dataset[i][j][k][1], and the z location is in dataset[i][j][k][2]. (Assuming Component-Minor ordering).
109
A 2-Dimensional mesh will have a dataset with 3 dimensions. The x location of point (i, j) is stored in dataset[i][j][0], and the y location is in dataset[i][j][1].
110
A 1-Dimensional mesh may be formed in two different ways. The first way is a 2-dimensional dataset, where the x location of point (i) is stored in dataset[i][0]. The second way is a 1-d dataset, where the x location of point (i) is stored in dataset[i].
111
112
*3D Structured Mesh*
113
```
114
Dataset "mesh3dstruct" {
115
  Att vsType = "mesh"                         // Required string
116
  Att vsKind = "structured"                   // Required string
117
  DATASPACE [n0][n1][n2][n3]                  // Required float array
118
  Att vsIndexOrder = "compMinorC"             // Default value is "compMinorC", with the other choices being 
119
                                              // "compMinorF", "compMajorC", or "compMajorF". 
120
  Att vsLimits = "mylimits"                   // Optional string
121
  Att vsTemporalDimension = 0                 // Optional unsigned integer denoting which axis is time.
122
                                              // No temporal axis if this attribute is not present.
123
}
124
```
125
* vsKind indicates the kind of mesh 
126
* vsIndexOrder indicates the interpretation of the indices for the data set. See [Data Ordering](https://ice.txcorp.com/vizschema/wiki/DataOrdering). E.g., for "compMinorC", the first index is the x index, the second index is the y index, the third index is the z index, and the last index is the coordinate index, which therefore must have a value of 3 (i.e. the spatial dimension). 
127
* vsLimits points to a [visualization region](https://ice.txcorp.com/vizschema/wiki/OtherMetaData) 
128
129
*2D Structured Mesh*
130
```
131
Dataset "mesh2dstruct" {
132
  Att vsType = "mesh"                         // Required string
133
  Att vsKind = "structured"                   // Required string
134
  DATASPACE [n0][n1][n2]                      // Required float array
135
  Att vsIndexOrder = "compMinorC"             // Default value is "compMinorC", with the other choices being 
136
                                              // "compMinorF", "compMajorC", or "compMajorF".
137
  Att vsLimits = "mylimits"                   // Optional string
138
  Att vsTemporalDimension = 0                 // Optional unsigned integer denoting which axis is time.
139
                                              // No temporal axis if this attribute is not present.
140
}
141
```
142
* vsKind indicates the kind of mesh 
143
* vsIndexOrder indicates the interpretation of the indices for the data set. See [Data Ordering](https://ice.txcorp.com/vizschema/wiki/DataOrdering). E.g., for "compMinorC", the first index is the x index, the second index is the y index, and the last index is the coordinate index, which therefore must have a value of 2 or 3 (i.e. the spatial dimension). 
144
* vsLimits points to a [visualization region](https://ice.txcorp.com/vizschema/wiki/OtherMetaData) 
145
146
*1D Structured Mesh*
147
148
Can have either the form, 
149
```
150
Dataset "mesh1dstructa" {
151
  Att vsType = "mesh"                         // Required string
152
  Att vsKind = "structured"                   // Required string
153
  Att vsTemporalDimension = 0                 // Optional unsigned integer denoting which axis is time.  No temporal axis if
154
                                              // this attribute is not present.
155
  DATASPACE [n0][n1]                          // Required float array
156
  Att vsIndexOrder = "compMinorC"             // Optional string defaulting to "compMinorC", with the other choice being "compMajorC"
157
                                              // ("compMinorF" and "compMajorF" have the same result as the C variants). 
158
}
159
```
160
or the form,
161
``` 
162
Dataset "mesh1dstructb" {
163
  Att vsType = "mesh"                         // Required string
164
  Att vsKind = "structured"                   // Required string
165
  Att vsTemporalDimension = 0                 // Optional unsigned integer denoting which axis is time.  No temporal axis if
166
                                              // this attribute is not present.
167
  DATASPACE [n0]                              // Required float array
168
}
169
```
170
which have equivalent data. This mesh has n0 points, each described by one value. 
171
172
* vsKind indicates the kind of mesh 
173
* vsIndexOrder indicates the interpretation of the indices for the data set. See [Data Ordering](https://ice.txcorp.com/vizschema/wiki/DataOrdering). E.g., for "compMinorC", the first index is the x index, and the second index is the coordinate index, which therefore must have a value of 1, 2, or 3 (i.e. the spatial dimension). If the second index is not present the coordinate index is assumed to be 1 (i.e. the spatial dimension). 
174
175
1D meshes have no need for a visualization region. 
176
177
**Blanking nodes and/or cells in a structured grid**
178
179
Node and cell blanking is a mesh property which allows one to turn off (mask) nodes or cells. An example would be an ocean model with grid nodes located on land or a model using cut cells where the cells outside the domain are tagged as invalid. Zonal/nodal blanking can also be used to turn off ghost cells/nodes. Blanking is achieved by providing nodal/zonal mask arrays (mynmask and myzmask in the example below). The mesh refers to the mask array using the vsNodalMask/vsZonalMask attribute. The mask, whether zonal or nodal, must be a Dataset and have vsType either "zonalMask" or "nodalMask". The values of the mask array are 0 where the mesh nodes/zones are valid, any other value indicating that the node/zone is masked. We recommend using unsigned char as the type of the masked array. The vsIndexOrder can be either "F" for column major indexing (Fortran) or "C" for row major indexing. 
180
```
181
GROUP "/" {
182
  Group "A" {
183
    Dataset "myzmask" {
184
      Att vsType = "zonalMask"                    // Required string
185
      DATASPACE [200, 300, 104] 
186
      Att vsIndexOrder = "F"                      // "F" for "Fortran", optional string defaulting to "C"
187
    }
188
    Dataset "mynmask" {
189
      Att vsType = "nodalMask"                    // Required string
190
      DATASPACE [201, 301, 105] 
191
      Att vsIndexOrder = "F"                      // Optional string with default value "C"
192
    }
193
    Group mycartgrid {
194
      Att vsZonalMask = "myzmask"                 // Optional string
195
      Att vsNodalMask = "mynmask"                 // Optional string
196
      Att vsType = "mesh"                         // Required string
197
      Att vsKind = "uniform"                      // Required string
198
      Att vsStartCell = [0, 0, 0]                 // Required integer array
199
      Att vsNumCells = [200, 300, 104]            // Required integer array
200
      Att vsLowerBounds = [-2.5, -2.5, -1.3]      // Required float array
201
      Att vsUpperBounds = [2.5, 2.5, 1.3]         // Required float array
202
    }
203
  }
204
```
205
206
**Unstructured meshes**
207
208
allows each point in the mesh to be specified individually, and also allows connectivity to be specified. 
209
```
210
Group "mypolymesh" {
211
  Att vsType = “mesh”                         // Required string
212
  Att vsKind = “unstructured”                 // Required string
213
  Att vsPoints = "points"                     // Optional string for dataset containing the point coordinates
214
  Att vsEdges = "edges"                       // Optional string for dataset containing the edge connectivity in terms of point indices (version 4.0)
215
  Att vsFaces = "faces"                       // Optional string for dataset containing the face connectivity in terms of point indices (version 4.0)
216
  Att vsPolygons = "polygons"                 // Optional string for dataset containing the polygons
217
  Dataset points [n0_points][n1_points]       // Float or double array of the points referenced by vsPoints
218
  Dataset edges [n0_edges][n1_edges]          // INTEGER edge to point connectivity array
219
  Dataset faces [n0_faces][n1_faces]          // INTEGER face to point connectivity array
220
  Dataset polygons [n0_polys][n1_polys]       // INTEGER array of the polygons referenced by vsPolygons
221
  Att vsIndexOrder = "compMinorC"             // Optional string defaulting to "compMinorC", with the other choice being "compMajorC"
222
                                              // ("compMinorF" and "compMajorF" have the same result as the C variants). 
223
  Att vsLimits = "mylimits"                   // Optional string
224
                                      
225
}
226
```
227
* vsKind indicates the kind of mesh 
228
* vsPoints is a string that points to the data set containing the points. The dataset is in the same group if the name does not begin with '/". If the string is not given, it defaults to "points". 
229
* vsEdges is an optional string that points to the data set containing the connectivity of edges in terms of point indices. 
230
* vsFaces is an optional string that points to the data set containing the connectivity of faces in terms of point indices. 
231
* vsPolygons is a string that points to the data set containing the vertex indices that make up the polygon elements. The dataset is in the same group if the name does not begin with '/". There may be other element connections, such as tetrahedra or cubes (see below). If the string is not given, it defaults to "polygons". 
232
* points is a dataset of points. This is an example where the points are in the same group. 
233
* edges is a dataset of edges. Each row denotes the indices of the points contributing to the edge. Note that edges have a direction. 
234
* faces is a dataset of faces. Each row denotes the indices of the points contributing to the face. Note that the ordering defines the direction of the face based on the cross product rule. 
235
* polygons is a dataset of connections that describe polygon elements. This is an example where the connections are in the same group. 
236
* vsIndexOrder is either "compMinor" (default) or "compMajor". See [Data Ordering](https://ice.txcorp.com/vizschema/wiki/DataOrdering). For "compMinor" the first index is the number of elements while the second index number connections. 
237
* vsLimits points to a [visualization region](https://ice.txcorp.com/vizschema/wiki/OtherMetaData) 
238
239
**The dataset containing the connection information must be INTEGER data**
240
241
* vsPolygon and vsPolyhedra datasets 
242
243
In compMinor, this dataset has size Nx(M+1), where N is the number of elements and M is the number of connections needed to describe the element. The +1 is necessary because the first value in each row is the number of connections in that row. In this way, the user may have different element types in the same dataset. Each value in a row is interpreted as an index into the points dataset. If the dataset contains connections point, edge, and/or face elements use vsPolygon, if the dataset contains a mixture of solid elements use vsPolyhedra. (For a datasets containing a single element type it is preferable to specify the exact type thus removing the need to specify the number of connections). 
244
For example, a dataset containing 2 triangles would be of size 2x4.
245
This example declares that there is a triangle formed by points 1, 2, 3, and another triangle formed by points 2, 3, 4:
246
```
247
( (3, 1, 2, 3),
248
  (3, 2, 3, 4) )
249
```
250
A dataset containing 2 triangles and 2 quadrilaterals (quads) would be of size 4x5.
251
Note that the last value of each row containing a triangle, here shown as '0', is ignored because only the first three points are needed to make a triangle.
252
This example declares a triangle formed by connecting points 1, 2, 3, another triangle formed by points 2, 3, 4, a quad formed by points 1, 3, 5, 6, and a quad formed by points 3, 5, 6, 7.
253
```
254
( (3, 1, 2, 3, 0),
255
  (3, 2, 3, 4, 0),
256
  (4, 1, 3, 5, 6),
257
  (4, 3, 5, 6, 7) )
258
```
259
Optionally, instead of using vsPolygon or vsPolyhedra one may specify the exact element type: 
260
261
* vsLines = "lines" // "lines" must be an "int32" dataset of size [n0_polys][2] 
262
* vsTriangles = "triangles" // "triangles" must be an "int32" dataset of size [n0_polys][3] 
263
* vsQuadrilaterals = "quadrilaterals" // "quadrilaterals" must be an "int32" dataset of size [n0_polys][4] 
264
* vsTetrahedrals = "tetrahedrals" // "tetrahedrals" must be an "int32" dataset of size [n0_polys][4] 
265
* vsPyramids = "pyramids" // "pyramids" must be an "int32" dataset of size [n0_polys][5] 
266
* NOT IMPLEMENTED vsWedge = "wedges" // "wedges" must be an "int32" dataset of size [n0_polys][6] 
267
* vsHexahedrals = "hexahedrals" // "hexahedrals" must be an "int32" dataset of size [n0_polys][8] 
268
269
**Meshes for high order fields**
270
271
Describes meshes used by the discontinuous Galerkin method and other higher order discretization schemes. These meshes consist of a coarse mesh, which contains a sub-mesh. The coarse mesh can be of any supported type (unstructured, structured, etc.). Each coarse cell is expected to contain a number of field values, which are located at barycentric coordinate points in the range of 0 to 1. Note that sub-nodes located at coarse cell vertices, edges or faces may share the same physical location as other sub-nodes belonging to a neighbouring coarse cell. In other words, the field can be discontinuous across cell boundaries. 
272
Meshes for high order fields follow the same structure as their underlying coarse meshes with one difference: there is an additional attribute, vsSubCellLocations, which points to a dataset that contains the barycentric coordinates of the field. All coarse cells share the same barycentric coordinates. The order of the barycentric coordinates is arbitrary. 
273
```
274
Group "mypolymesh" {
275
  Att vsType = “mesh”                                // Required string
276
  Att vsKind = “unstructured”                        // Can be also be structured, uniform, ...
277
  Att vsSubCellLocations = "mySubCellLocations"      // Required string 
278
  ...                                                // Other unstructured grid attributes
279
  Dataset mySubCellLocations[n_subCell][n_topoDims]  // Barycentric coordinates
280
}
281
```
282
The first dimension of dataset mySubCellLocations, n_subCell, refers to the number of sub-cell grid points and n_topoDims to the number of topological dimensions. 
283
284
**Split Datasets**
285
286
For Vizschema users needing to store their coordinate data in separate data sets, this feature allows pulling coordinate data from those different data sets and combining them into a single mesh. In particular this feature is targeted at users who also require fast-bit indexing in their data files, which requires storing each coordinate in a separate dataset. 
287
288
To use split datasets, the user will not use the standard attribute vsPoints. Instead, the user will use at least one of vsPoints0, vsPoints1, vsPoints2. These attributes must contain a string with the name of the dataset to use for that coordinate. This dataset may be anywhere in the data file, and need not be in the same group. In the event that an unstructured mesh has both the standard attribute vsPoints as well as the split attributes, the standard attribute will be used. 
289
290
Note that the following must be true:
291
1. Each coordinate dataset must be of identical size.
292
2. Each coordinate dataset must be of the same data type (float, double). 
293
294
Here is an example of an unstructured mesh formed by coordinates stored in three separate datasets:
295
```
296
Group "mySplitMesh" {
297
  Att vsType = “mesh”                         // Required string
298
  Att vsKind = “unstructured”                 // Required string
299
  Att vsPoints0 = "/x_values"                 // Required string for dataset containing the first coordinate of the points
300
  Att vsPoints1 = "/y_values"                 // Optional string for dataset containing the second coordinate of the points
301
  Att vsPoints2 = "/randomGroup/z_values"     // Optional string for dataset containing the third coordinate of the points
302
  Dataset polygons [n0_polys][n1_polys]       // Integer array of the polygons referenced by vsPolygons
303
}
304
Dataset "x_values" [n0_points]                // Dataset containing values of x coordinates
305
Dataset "y_values" [n0_points]                // Dataset containing values of y coordinates
306
Group "randomGroup" {
307
  Dataset "z_values" [n0_points]              // Dataset containing values of z coordinates
308
```