Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
b_iometadata.h
Go to the documentation of this file.
1 /*! \page metadata I/O and Meta-Data Storage Conventions in MOAB
2 
3  \tableofcontents
4 
5  \section meta-introduction Introduction
6 
7 The Mesh-Oriented datABase (MOAB) is a library for representing finite element and other types of mesh data [1]. Various types of meta-data are often used in conjunction with a mesh. Examples include boundary condition groupings, material types, and provenance information for the mesh. Because the data model used in MOAB is so abstract, conventions are useful for describing how meta-data is stored into that data model. This document describes those conventions for several types of data commonly found in meshes stored in MOAB. Because the data models used by MOAB and iMesh, the ITAPS mesh interface [2], are so similar, the conventions described here apply almost unmodified to iMesh as well as to MOAB.
8 
9 The meshes represented in MOAB originate in a variety of forms, including mesh read from files of various formats (e.g. CUBIT “.cub” file, VTK, etc.) as well as mesh written into MOAB directly by various software libraries (e.g. MeshKit). Although there is no standard for naming or storing meta-data with a mesh, there is a great deal of commonality in the types of meta-data typically found with mesh data. This document describes conventions that have been established for commonly encountered meta-data. Various mesh readers implemented in MOAB attempt to read meta-data from a file and write it into the MOAB data model using these conventions. Although there is no requirement to store a given type of meta-data in the form described here, a number of services have been written to handle meta-data using these conventions, no matter the source of the meta-data being processed.
10 
11 Several specific tools are often used in concert with MOAB and bear special mention here. The CUBIT toolkit generates finite element meshes, and saves them to a native save file (referred to as a “.cub” file) which MOAB is able to read. Reading CUBIT meshes into MOAB through the .cub file format is preferred over other formats, since most other mesh formats written by CUBIT do not save most meta-data. The MeshKit library also generates mesh using CGM and MOAB, and uses the same conventions for storing meshes into MOAB. Finally, MOAB includes a CGM reader which can read a geometric model into a faceted representation in MOAB. Meta-data from all these tools are stored in MOAB using the conventions described here.
12 
13 The MOAB data model consists of the following basic types:
14 - <B>Entity</B>: The basic elements of topology, e.g. vertex, edge, triangle, tetrahedron, etc. MOAB represents all types in the finite element zoo, plus polygons and polyhedra.
15 - <B>Entity %Set</B>: An arbitrary collection of entities and other sets. Sets can have parent/child relations with other sets, and these relations are distinct from “contains” relations.
16 - <B>Interface</B>: The interface object through which other entities are accessed, in the sense of object-oriented-programming. iMesh refers to the interface as the “root” set.
17 - <B>Tag</B>: A piece of data that can be assigned a distinct value to each entity and entity set, and to the interface itself. Tags have a prescribed name, size in bytes, and data type; allowed data types are integer, double, entity handle, and byte or opaque.
18 .
19 
20 The following section describes each meta-data tag convention in detail; these conventions are also summarized in Table 1.
21 
22 
23  \section meta-conventions Meta-Data Conventions
24 
25 Meta-data is stored in MOAB and iMesh in the form of tags applied to either entities or entity sets. For meta-data represented as entity sets, the contents of those sets are determined by the convention, with tags on those sets identifying them with the convention and adding any other semantic data.
26 
27 Each meta-data convention is described in a subsection below. Each convention begins with a short description of:
28 
29 - Whether tags associated with the convention are assigned to entities or entity sets
30 - The tag(s) associated with the convention; information for each tag includes the name, the data type (I=integer, D=double, C=character, H=handle), and the tag length. Tag lengths are specified after an asterisk (*); for example, C*32 implies a tag with character type and length 32. Unspecified lengths correspond to length one.
31 .
32 
33 <H3>Name</H3>
34 (Data: Entity sets, entities; Tag(s): NAME/C*32)
35 
36 Character strings are used in many different contexts in applications. MOAB uses the “NAME” tag to store character strings used to name entities. This tag is of byte-type and is of length 32 bytes. Note that the string stored in this tag may or may not be terminated with a NULL character. It is always prudent account for missing NULL terminator, to avoid buffer overflow errors in the application. Applications are free to define their own version of the NAME tag with a longer length, though this definition may conflict with other services attempting to use this tag with the conventional size. Applications needing a string tag with a longer or variable length can also use MOAB’s variable-length tag type, though this will not be compatible with iMesh.
37 
38 <H3>Title </H3>
39 (Data: Entity sets (file or instance); Tag(s): TITLE/C*strlen)
40 
41 The title tag is meant to hold the overall identifier of a mesh, written at generation time or read from a file generated with a non-MOAB tool. The tag length is variable, and is set by the application directly (by calling the tag_create function) or indirectly (by embedding the title in a file read by MOAB).
42 
43 <H3> Global Identifier </H3>
44 (Data: Entity sets, entities; Tag(s): GLOBAL_ID/I)
45 
46 Global identifiers are used in many different contexts in applications. Geometric model entities are identified by dimension and id, e.g. “Volume 1”. Mesh vertices and elements are identified similarly in mesh generation codes. Boundary conditions and material types are identified similarly. This tag is used to store such information. This tag is currently stored in a 32-byte integer, though this may change in the future.
47 
48 <H3> Geometric Model Information </H3>
49 (Data: Entity sets; Tag(s): GEOM_DIMENSION/I, GLOBAL_ID/I, NAME/C*32, CATEGORY/C*32, GEOM_SENSE_2(EH[2]), GEOM_SENSE_N_ENTS(EH*N), GEOM_SENSE_N_SENSES(I*N))
50 
51 Mesh generation is often performed starting from a geometric model, represented in some form of CAD engine. Many of the meshes used by MOAB are generated based on the CGM library. Geometric models contain both topological information (the topological entities in the geometric model) and shape information (the geometric shape of those entities), as well as other meta-data written to the entities in a model. When a mesh is read from a CUBIT .cub file, meta-data from the geometric model is read and represented in the MOAB data model, as described below. <B> Note that although MOAB reads and represents meta-data associated with the geometric model, it does not represent the geometric model itself.</B> Therefore, shape-related information, e.g. the arc length of an edge or surface normal at a given point, can be retrieved only from the model represented in CGM or another geometric modeling engine.
52 
53 The information contained in a geometric model, read into and represented in MOAB, consists of:
54 - Model entities (vertex, edge, face, volume)
55 - Topological relationships between model entities
56 - Groups of model entities
57 - Model entity/group ids
58 - Model entity/group names
59 .
60 
61 The storage of this information into MOAB's data model is described for each type is described below.
62 
63 - <B>Entities </B>
64 
65  in the geometric model (VERTEX, EDGE, FACE, VOLUME) are each represented by an entity set<sup>1</sup>. These sets are tagged with the “GEOM_DIMENSION” tag, with integer value equal to the topological dimension of the entity (VERTEX = 0, EDGE = 1, etc.) These sets contain the mesh owned by the corresponding entity in the geometric model. Note this does not include mesh owned by bounding entities; thus, the set for a FACE will not contain the mesh vertices owned by bounding EDGEs in the geometric model. These sets may or may not contain mesh entities of intermediate dimension, e.g. mesh edges owned by a FACE or faces owned by a VOLUME, depending on the application generating the mesh or the file from which the mesh was read. These sets are all set-types, i.e. the order of entities in the sets is not significant, except in the case of EDGE sets, where order of the mesh vertices and edges corresponds to the relative order of vertices and edges at the time of mesh generation. In MOAB, these sets are non-tracking by default, i.e. entities do not have knowledge of which geometry sets they are members of.
66 
67 <sup>1</sup>Body-type entities from CUBIT are not explicitly represented in MOAB.
68 
69 - <B> Topological Relationships </B>
70 
71 In the geometric model, each FACE is bounded by zero or more EDGEs; other topological relationships between geometric entities exist in a similar manner. These relationships are embedded in the data model using parent/child relations between entity sets. For example, the entity set corresponding to a FACE will have child sets, each corresponding to a bounding EDGE, and parent sets, each corresponding to a VOLUME bounded by that FACE. The relative order of sets in those parent/child lists is not significant, thus, “loops” bounding a FACE cannot reliably be inferred from this data.
72 
73 - <B> Groups </B>
74 
75 Geometric entities are sometimes assigned to application-specific groups. These groups are represented using entity sets, tagged with a “GROUP” tag whose value equals the group id. Group sets are “set”-type, and are not tracking sets. These sets contain the sets corresponding to geometric entities contained in the groups in the geometric model, as well as any mesh entities assigned to the group.
76 
77 - <B> Sense </B>
78 
79 A geometric face has a natural orientation, indicated by the direction of the normal to the face; similarly, edges have a natural orientation determined by the direction of the tangent. When faces bound regions, or edges bound faces, they do so with a sense; if a region includes a face with forward sense, that means the face's natural normal direction points out of the volume. If a face includes an edge with forward sense, that means that if one moves along the edge in the direction of its tangent, the material of the face is on the left hand side. The sense of a face (edge) with respect to a region (face) it bounds is stored using tags on the face (edge).
80 
81 Most models allow a face to be part of only two regions. Therefore, to store the sense of a face with respect to regions including it, a tag with two values is used. This tag is named GEOM_SENSE_2, and has 2 EntityHandle values. The first value corresponds to the entity set for the region for which that face has a forward sense, and the second to the region for which that face has a reverse sense.
82 
83 Edges can bound more than two faces. Therefore, two variable-length tags are used, one to store the EntityHandles of the faces the edge bounds, and the other to store the sense with which the edge bounds the corresponding face. These tags are named GEOM_SENSE_N_ENTS and GEOM_SENSE_N_SENSES, respectively. These are stored as variable-length tags; see the MOAB user's guide for information on how to work with tags of this type.
84 
85 The following sense values are used:
86 - 0: forward
87 - 1: reverse
88 - -1: unnknown
89 .
90 
91 <H3> Material Type </H3>
92 (Data: Entity sets; Tag(s): MATERIAL_SET/I)
93 
94 Most finite element and other PDE-based analysis codes require a material type for each cell or element in the simulation. MOAB uses entity sets to store this information, in the form of entity sets. The MATERIAL_SET tag is used to identify these sets. The value of this tag is conventionally an integer; in most cases this stores a user-assigned identifier associated with that material.
95 
96 CUBIT assigns material types using what it calls “element blocks”, with each element block given a user-assigned id number and optionally a name. The CUBIT and Exodus file readers in MOAB read element blocks into MATERIAL_SET sets.
97 
98 In CUBIT, materials are typically assigned by assigning geometric volumes to element blocks. Therefore, material sets often contain entity sets corresponding to those volumes. Thus, a materrial set in MOAB is unlikely to contain mesh entities directly; rather, that set contains other sets which contain mesh entities. In these cases, mesh entities can be retrieved by passing a “recursive” flag to the appropriate function (MOAB), or by calling the getEntitiesRec extension function (iMesh) provided by MOAB.
99 
100 <H3> Boundary Conditions (Dirichlet, Neumann)</H3>
101 Data: Entity sets; Tag(s): DIRICHLET_SET/I, NEUMANN_SET/I)
102 
103 Boundary conditions are often specified in terms of geometric model entities, similar to material types. MOAB uses entity sets to store this information as well. The DIRICHLET_SET and NEUMANN_SET tags are used to represent Dirichlet- and Neumann-type boundary condition sets, resp. By convention, Neumann sets usually contain (indirectly) intermediate-dimension entities like edges in a 2D mesh or faces in a 3D mesh, while Dirichlet sets usually contain vertices. In addition, Neumann sets are represented as sets of faces, rather than as sides of elements. Faces can be ordered “forward” or “reverse” with respect to one of the bounding elements, depending on whether the right-hand normal points into or out of the element. Forward-sense faces are added to the Neumann set. Reverse-sense faces are put into a separate set; that set is tagged with the NEUSET_SENSE tag, with value = -1; and that reverse set is added to the Neummann set.
104 
105 <H3> Parallel Mesh Constructs </H3>
106 (Data: Entity sets, entities; Tag(s): PARALLEL_PARTITION/I, PSTATUS/C*1, PARALLEL_SHARED_PROC/I, PARALLEL/SHARED_HANDLE/H, PARALLEL_SHARED_PROCS/I*NP, PARALLEL_SHARED_HANDLES/H*NP)
107 
108 On a parallel computer, MOAB can represent the mesh on each processor as well as information about entities shared with neighboring processors. Some of this information is also relevant even when the mesh is represented on a serial machine. MOAB uses several tag and set conventions to describe the parallel nature of a mesh. This information is summarized here; for a more complete description of MOAB’s parallel mesh representation and functionality, see [3].
109 
110 - <B> Parallel partition, parts </B>
111 
112 Most parallel mesh applications use a domain decomposition approach, where each processor solves for a subset of the domain. The set of entities solved by a given processor is referred to as a part, and the collection of parts together is called the partition. MOAB stores each part in an entity set, marked with the PARALLEL_PARTITION tag, whose value is the rank of the processor assigned that part; an entity set which contains all part sets is given the PARALLEL_PARTITIONING_TAG_NAME tag, whose value is currently meaningless. The MBZoltan tool included as a tool in MOAB can partition a mesh for parallel solution, and writes the partition to the mesh in the form of parts and partitions. Both these types of sets can be accessed in a serial mesh, e.g. for visualization.
113 
114 - <B> Part interfaces </B>
115 
116 When a partitioned mesh has been loaded on a parallel computer, the part on a given processor may share portions of its boundary with parts on other processors. These shared regions are called part interfaces, and are also represented using entity sets. These sets are marked with the PARALLEL_INTERFACE tag, whose value is currently meaningless.
117 
118 - <B> Shared processor and handle </B>
119 
120 For entities shared between processors, it is helpful to know locally which other processor shares an entity, and what the entity’s handle is on the remote processor. There are two cases which are useful to distinguish, first where an entity is shared with only one other processor (referred to as shared), and second when a processor is shared by more than one other processor (referred to as multi-shared). Shared entities are given the PARALLEL_SHARED_PROC and PARALLEL_SHARED_HANDLE tags, which store the rank of the sharing processor and the handle of the entity on that processor, respectively. Multi-shared entities are marked with the PARALLEL_SHARED_PROCS and PARALLEL_SHARED_HANDLES tags; these tags have a length NP assigned at compile time in MOAB, with default values of -1 for processor rank and zero for handle (which are each invalid values for the corresponding data). The processors/handles sharing a given entity are then written on the front of the arrays. So, for example, an entity on processor rank 0, shared by processors 1 and 2, would have a PARALLEL_SHARED_PROCS tag whose values would be [1, 2, -1, -1, …], with PARALLEL_SHARED_HANDLES values of [m, n, 0, 0, …], where m and n would be the handles of that entity on processors 1 and 2. The shared versions of these tags are “dense”, with default values which denote unshared entities. The multi-shared tags are sparse tags in MOAB, with no default value.
121 
122 - <B> Parallel status </B>
123 
124 In addition to the tags above, MOAB also defines the PSTATUS tag, whose bits contain information about the parallel status of a given entity. Starting with least significant bit, these bits represent whether an entity is 1) not owned, 2) shared, 3) multi-shared, 4) interface, 5) a ghost entity. The first bit being set indicates “not owned” so that the default value for this tag, of zero, corresponds to an owned, unshared entity, which will be the state of most entities on a given processor.
125 
126 <H3>Structured Mesh Parameters </H3>
127 
128 MOAB has a structured mesh interface for creating structured mesh (see “ScdInterface.hpp” header file in MOAB source code). Along with an internal representation that is more memory-efficient (since it does not need to store connectivity), MOAB also creates and tags entity sets with structured mesh parameters, which can be accessed through the normal tag and set interface. The following tags are used:
129 
130 - <B>BOX_DIMS</B>: This tag stores the ijk coordinates of the lower and upper corner of the structured mesh box(es).
131 - <B>GLOBAL_BOX_DIMS</B>: If specified when the structured mesh is created, a tag with this name stores the global box dimensions (which may be different than the local box dimensions).
132 - <B>BOX_PERIODIC</B>: Stores whether the box is periodic in the i (BOX_PERIODIC[0]) and j (BOX_PERIODIC[1]) directions.
133 - <B>__BOX_SET</B>: Pointer to the ScdBox instance corresponding to this entity set.<sup>2</sup>
134 .
135 Although the structured mesh is not saved as such in HDF5-format files, the entity sets and corresponding tags will be saved and restored.
136 
137 <sup>2</sup>The double-underscore in the tag name implies that this tag will not be saved in a file, in this case because the ScdBox instances are not preserved in a file.
138 
139 <H3>Spectral Mesh Constructs </H3>
140 
141 The Spectral Element Method (SEM) is a high-order method, using a polynomial Legendre interpolation basis with Gauss-Lobatto quadrature points, in contrast to the Lagrange basis used in (linear) finite elements. A spectral mesh with order O contains quadrilateral or hexahedral elements comprised of (O+1)d vertices. Spectral meshes are usually represented in one of two ways, either as coarse elements which point to an array of higher-order vertices (and with corner vertices represented in the normal manner), or as linear quads/hexes formed from the higher-order vertices, with each original coarse quad/hex represented by Od fine quads/hexes. Similarly, the spectral variables, which are normally computed at fine vertex positions, are stored either on those vertices, or in lexicographically-ordered arrays on elements (with tag values repeated on neighboring elements). MOAB can read spectral meshes from a variety of formats (at this time, including CAM-SE, HOMME, and Nek5000). Which of the above two representations are controlled by read options and are indicated by certain tags:
142 
143 - SPECTRAL_MESH: read option indicating that spectral elements should be represented as coarse linear quads/hexes and each element containing an array of lexicographically-ordered vertex handles
144 
145 - TAG_SPECTRAL_ELEMENTS: read option; if given, spectral variables are represented as lexicographically-ordered arrays on elements
146 
147 - TAG_SPECTRAL_VERTICES: read option; if given, spectral variables are represented as tags on vertices
148 
149 - CONN=<filename>: in CAM-SE, the connectivity of the spectral mesh is stored by default in a file named “HommeMapping.nc”; this option can be given to read the connectivity from a different file
150 
151 - SPECTRAL_VERTICES: tag name for array of vertex handles
152 
153 - SPECTRAL_ORDER: tag name for spectral order, written to file set or (if no file set given) to interface after a spectral mesh is read
154 
155 .
156 
157 
158  \section meta-options Reader/Writer Options
159 
160 All mesh file readers and writers in MOAB take an option string as an argument. By default, the semicolon (“;”) delimits individual options in the option string. Options used in multiple readers are described in this section; the options enabled in specific readers/writers are described in the corresponding appendix at the end of this document.
161 
162 <H3>variable=<var_name>[,...]</H3>
163 
164 By default, all field data stored with the mesh is read with the mesh, and stored as tags on the associated mesh entities. This option lists specific variables that should be read along with the mesh (note also the “nomesh” option, described elsewhere in this document). The variable name listed will be read into a tag with the same name. For time-dependent variables, the time step number will be appended to the variable name to form the tag name. If no “timestep” or “timeval” option is given, all time steps will be read, resulting in several tags being created. If the “nomesh” option is given, the application must pass the entity set resulting from the original mesh read in to the function, that this set must contain the mesh read only from that file. The mesh in the file is checked against the mesh in the set to verify that the two correspond. The special name “MOAB_ALL_VARIABLES” can be used to indicate that all variables should be read. Multiple variable names can be specified, separated from each other by commas.
165 
166 <H3>nomesh </H3>
167 
168 Indicates that no mesh should be read from the file. This option is used in conjunction with the “variable=” option, to read variables and assign them as tags to a previously-read mesh. If this option is used, applications should pass an entity set to the read function, which should contain the mesh previously read from the file.
169 
170 <H3>timestep=<step_number>[, ...] </H3>
171 
172 Read the time step number whose time value is equal to or greater than the specified time value, for the specified variable(s). Tag names for the variable(s) will be formed by appending the time step number to the variable name. Multiple time step values can be specified, separated from each other by commas.
173 
174 <H3>timeval=<time_value>[, ...]</H3>
175 
176 Read the time step number whose time value is equal to or greater than the specified time value, for the
177 specified variable(s). Tag names for the variable(s) will be formed by appending the time step number
178 to the variable name. Multiple time step values can be specified, separated from each other by commas.
179 
180 <H3>gather_set[=<rank>] </H3>
181 
182 Create a gather set (associated with tag GATHER_SET) on one processor with the specified rank, to duplicate entities on other processors. If the rank is not specified, it will be rank 0 by default. If an invalid rank is passed, no gather set will be created. Gather set is specially used by HOMME, MPAS, and any other unstructured grid.
183 
184 <H3>no_mixed_elements </H3>
185 
186 Indicates that no mixed elements (e.g. pentagons and hexagons) should be created by the MPAS reader. If this option is used, a common parameter maxEdgesPerCell will be computed to be used across all processors (instead of the one reported in the MPAS file header, which is usually 10), and each cell is created with maxEdgesPerCell edges. Any cell that has less actual edges will be padded by duplicating the last vertex in the connectivity array. As a result, all created cells will be in one contiguous chunk.
187 
188 <H3>no_edges </H3>
189 
190 Indicates that no edges should be created and no edge variables will be read. This option can be used when there is no need to read variables on edges. For a huge MPAS file with 65M cells, it can save more than 3GB MOAB internal storage for edge connectivity.
191 
192 
193  \section meta-references References
194 
195 [1] T.J. Tautges, R. Meyers, K. Merkley, C. Stimpson, and C. Ernst, MOAB: A Mesh-Oriented Database, Sandia National Laboratories, 2004.
196 
197 [2] L. Diachin, A. Bauer, B. Fix, J. Kraftcheck, K. Jansen, X. Luo, M. Miller, C. Ollivier-Gooch, M.S. Shephard, T. Tautges, and H. Trease, “Interoperable mesh and geometry tools for advanced petascale simulations,” Journal of Physics: Conference Series, vol. 78, 2007, p. 012015.
198 [3] T.J. Tautges, J.A. Kraftcheck, N. Bertram, V. Sachdeva, and J. Magerlein, "Mesh Interface Resolution and Ghost Exchange in a Parallel Mesh Representation", In Proceedings of the 2012 IEEE 26th International Parallel and Distributed Processing Symposium Workshops & PhD Forum (IPDPSW '12), 2012.
199 
200 
201  \section appendixA Appendix A: Summary
202 
203 \subsection table1 Table 1: Summary of MOAB meta-data conventions.
204 
205 <table border="1">
206 <tr>
207 <th>Convention</th>
208 <th>Applies to (E=ent, S=set)</th>
209 <th>Tag(s) (type/length)</th>
210 <th>Description</th>
211 </tr>
212 <tr>
213 <td>Name</td>
214 <td>E, S</td>
215 <td>NAME/C*32</td>
216 <td></td>
217 </tr>
218 <tr>
219 <td>Title</td>
220 <td>S</td>
221 <td>TITLE/C*strlen</td>
222 <td>Title of mesh</td>
223 </tr>
224 <tr>
225 <td>Global identifier</td>
226 <td>E, S</td>
227 <td>GLOBAL_ID/I</td>
228 <td></td>
229 </tr>
230 <tr>
231 <td>Geometric topology</td>
232 <td>S</td>
233 <td>GEOM_DIMENSION/I, GLOBAL_ID/I,^
234 NAME/C*32,
235 CATEGORY/C*32.
236 GEOM_SENSE_2/EH[2],
237 GEOM_SENSE_N_ENTS/EH*N,
238 GEOM_SENSE_N_SENSES/I*N</td>
239 <td>%Sets contain mesh owned by that entity; parent/child links to bounded/bounding entities in geometric model</td>
240 </tr>
241 <tr>
242 <td>Material type</td>
243 <td>S</td>
244 <td>MATERIAL_SET/I</td>
245 <td>%Set contains entities or sets assigned a common material type</td>
246 </tr>
247 <tr>
248 <td>Boundary condition</td>
249 <td>S</td>
250 <td>DIRICHLET_SET/I, NEUMANN_SET/I</td>
251 <td>%Set contains entities or sets assigned a particular boundary condition; neumann sets usually contain edges (2D) or faces (3D)</td>
252 </tr>
253 <tr>
254 <td>Parallel mesh constructs</td>
255 <td>E, S</td>
256 <td>PARALLEL_MESH_PARTITIONING/I, PARALLEL_PARTITION/I, PSTATUS/C*1, PARALLEL_SHARED_PROC/I, PARALLEL/SHARED_HANDLE/H, PARALLEL_SHARED_PROCS/I*NP, PARALLEL_SHARED_HANDLES/H*NP</td>
257 <td> Data which describes parallel mesh</td>
258 </tr>
259 <tr>
260 <td>Structured mesh constructs</td>
261 <td>S</td>
262 <td>BOX_DIMS/I*6, GLOBAL_BOX_DIMS/I*6, BOX_PERIODIC/2*I, __BOX_SET/O</td>
263 <td>Data describing structured mesh </td>
264 </tr>
265 <tr>
266 <td>Spectral mesh constructs </td>
267 <td>E, S</td>
268 <td>SPECTRAL_ORDER/I, SPECTRAL_VERTICES/I*(O+1)^2</td>
269 <td>Data marking spectral mesh constructs</td>
270 </tr>
271 </table>
272 
273  \ref meta-introduction "Back to Introduction"
274 
275  \subsection table2 Table 2: Summary of MOAB conventional tag names, types, and purposes. Data types are I=integer, D=double, C=character, H=entity handle,O=opaque. Data type with *x denote length of x elements of that data type.
276 
277 <Table border="1">
278 <tr>
279 <th>Tag name</th>
280 <th>Data type</th>
281 <th>Applies to (E=entity, S=set)</th>
282 <th>Purpose</th>
283 </tr>
284 <tr>
285 <td>BOX_DIMS</td>
286 <td>I*6</td>
287 <td>S</td>
288 <td>Lower and upper ijk dimensions of box, ordered (ilo, jlo, klo, ihi, jhi, khi)</td>
289 </tr>
290 <tr>
291 <td>BOX_PERIODIC</td>
292 <td>I*2</td>
293 <td>S</td>
294 <td>Indicates whether box is periodic in i (BOX_PERIODIC[0]) or j (BOX_PERIODIC[1])</td>
295 </tr>
296 <tr>
297 <td>__BOX_SET</td>
298 <td>O</td>
299 <td>S</td>
300 <td>Pointer to corresponding ScdBox instance</td>
301 </tr>
302 <tr>
303 <td>CATEGORY</td>
304 <td>C*32</td>
305 <td>S</td>
306 <td>String describing purpose of set; examples include “group”, “vertex”, “edge”, “surface”, “volume”</td>
307 </tr>
308 <tr>
309 <td>DIRICHLET_SET </td>
310 <td>I</td>
311 <td>SO</td>
312 <td>Entities or sets with common boundary condition</td>
313 </tr>
314 <tr>
315 <td>GEOM_DIMENSION</td>
316 <td>I</td>
317 <td>S</td>
318 <td>Identifies mesh entities resolving a given geometric model entity</td>
319 </tr>
320 <tr>
321 <td>GEOM_SENSE_2</td>
322 <td>EH*2</td>
323 <td>S</td>
324 <td> Stored on face-type geometric topology sets, values store regions having forward and reverse sense</td>
325 </tr>
326 <tr>
327 <td>GEOM_SENSE_N_ENTS</td>
328 <td>EH*N</td>
329 <td>S</td>
330 <td>Stored on edge-type geometric topology sets, values store faces whose senses are stored in GEOM_SENSE_N_SENSES.</td>
331 </tr>
332 <tr>
333 <td>GEOM_SENSE_N_SENSES</td>
334 <td>I*N</td>
335 <td>S</td>
336 <td>Stored on edge-type geometric topology sets, values store senses of the edge with respect to faces stored in GEOM_SENSE_N_ENTS.</td>
337 </tr>
338 <tr>
339 <td>GLOBAL_ID</td>
340 <td>I</td>
341 <td>E,S</td>
342 <td>Application-specific entity id</td>
343 </tr>
344 <tr>
345 <td>MATERIAL_SET</td>
346 <td>I</td>
347 <td>S</td>
348 <td>Entities or sets grouped by material type</td>
349 </tr>
350 <tr>
351 <td>NAME</td>
352 <td>C*32</td>
353 <td>E, S</td>
354 <td>User-assigned entity name(s); multiple names delimited with ?</td>
355 </tr>
356 <tr>
357 <td>NEUMANN_SET</td>
358 <td>I</td>
359 <td>S</td>
360 <td>Entities or sets with common boundary condition </td>
361 </tr>
362 <tr>
363 <td>PARALLEL_PARTITION </td>
364 <td>I</td>
365 <td>S</td>
366 <td>Represent a part in a partition</td>
367 </tr>
368 <tr>
369 <td>PARALLEL_MESH_PARTITIONING</td>
370 <td>I</td>
371 <td>S</td>
372 <td>Represents a partition of the mesh for parallel solution, which is a collection of parts</td>
373 </tr>
374 <tr>
375 <td>__PARALLEL_SHARED_HANDLE</td>
376 <td>H</td>
377 <td>E, S</td>
378 <td> Handle of this entity/set on sharing processor</td>
379 </tr>
380 <tr>
381 <td>__PARALLEL_SHARED_PROC</td>
382 <td>I</td>
383 <td>E,S</td>
384 <td>Rank of other processor sharing this entity/set </td>
385 </tr>
386 <tr>
387 <td>__PARALLEL_SHARED_HANDLES</td>
388 <td>H*NP</td>
389 <td>E,S</td>
390 <td>Handles of this entity/set on sharing processors </td>
391 </tr>
392 <tr>
393 <td>__PARALLEL_SHARED_PROCS</td>
394 <td>I*NP</td>
395 <td>E,S</td>
396 <td>Ranks of other processors sharing this entity/set </td>
397 </tr>
398 <tr>
399 <td>__PARALLEL_STATUS</td>
400 <td>C*1</td>
401 <td>E,S</td>
402 <td>Bit-field indicating various parallel information </td>
403 </tr>
404 <tr>
405 <td>SPECTRAL_ORDER</td>
406 <td>I</td>
407 <td>S</td>
408 <td> Order of a spectral mesh </td>
409 </tr>
410 <tr>
411 <td>SPECTRAL_VERTICES</td>
412 <td>H*(O+1)^d</td>
413 <td>E</td>
414 <td> Vertices comprising a spectral element, ordered lexicographically; here, O=value of SPECTRAL_ORDER tag. </td>
415 </tr>
416 </table>
417 
418 
419  \section appendixB Appendix B: CCMIO (Star-CD, Star-CCM+) Reader/Writer Conventions
420 
421  \subsection table3 Table 3: Translation between CCMIO options and MOAB tags.
422 <Table border="1">
423 <tr>
424 <th> %Set Type</th>
425 <th>CCMIO Construct</th>
426 <th>MOAB Tag Name, Type</th>
427 </tr>
428 <tr>
429 <td rowspan="2">File set / Interface</td>
430 <td>Title (option)</td>
431 <td>“Title” (C*32)</td>
432 </tr>
433 <tr>
434 <td>CreatingProgram</td>
435 <td>“CreatingProgram” (C*32)</td>
436 </tr>
437 <tr>
438 <td rowspan="13">Material sets</td>
439 <td>Index</td>
440 <td>MATERIAL_SET</td>
441 </tr>
442 <tr>
443 <td>Label<sup>1</sup></td>
444 <td>NAME</td>
445 </tr>
446 <tr>
447 <td>MaterialId</td>
448 <td>“MaterialId” (I)</td>
449 </tr>
450 <tr>
451 <td>Radiation</td>
452 <td>“Radiation” (I)</td>
453 </tr>
454 <tr>
455 <td>PorosityId</td>
456 <td>“PorosityId” (I)</td>
457 </tr>
458 <tr>
459 <td>SpinId</td>
460 <td>“SpinId” (I)</td>
461 </tr>
462 <tr>
463 <td>GroupId</td>
464 <td>“GroupId” (I)</td>
465 </tr>
466 <tr>
467 <td>ColorIdx</td>
468 <td>“ColorIdx” (I)</td>
469 </tr>
470 <tr>
471 <td>ProcessorId</td>
472 <td>“ProcessorId” (I)</td>
473 </tr>
474 <tr>
475 <td>LightMaterial</td>
476 <td>“LightMaterial” (I)</td>
477 </tr>
478 <tr>
479 <td>FreeSurfaceMaterial</td>
480 <td>“Thickness” (F)</td>
481 </tr>
482 <tr>
483 <td>Thickness</td>
484 <td>“Thickness” (F)</td>
485 </tr>
486 <tr>
487 <td>MaterialType</td>
488 <td>“MaterialType” (C*32)</td>
489 </tr>
490 <tr>
491 <td rowspan="5">Neumann sets</td>
492 <td>Index</td>
493 <td>NEUMANN_SET</td>
494 </tr>
495 <tr>
496 <td>Label</td>
497 <td>NEUMANN_SET</td>
498 </tr>
499 <tr>
500 <td>BoundaryName</td>
501 <td>NAME</td>
502 </tr>
503 <tr>
504 <td>BoundaryType</td>
505 <td>“BoundaryType” (C*32)</td>
506 </tr>
507 <tr>
508 <td>ProstarRegionNumber</td>
509 <td>“ProstarRegionNumber” (I)</td>
510 </tr>
511 </table>
512 
513 Notes:
514 1. If no name is present, labels the material group with “MaterialX”, where X is the index of that group.
515 
516 
517  \section appendixC Appendix C: ExodusII Reader/Writer Conventions
518 
519  \subsection table4 Table 4: Translation between ExodusII constructs and MOAB tags.
520 <Table border="1">
521 <tr>
522 <th> Data Type</th>
523 <th>ExodusII Construct</th>
524 <th>MOAB Tag Name, Type</th>
525 </tr>
526 <tr>
527 <td></td>
528 <td>QA records</td>
529 <td>“qaRecord” (C*(v))<sup>2</sup></td>
530 </tr>
531 <tr>
532 <td rowspan="2">Material sets</td>
533 <td>Block number</td>
534 <td>MATERIAL_SET</td>
535 </tr>
536 <tr>
537 <td>Block element type</td>
538 <td>Entity type, # vertices per entity</td>
539 </tr>
540 <tr>
541 <td rowspan="2">Dirichlet sets<sup>3</sup></td>
542 <td>Nodeset number</td>
543 <td>DIRICHLET_SET</td>
544 </tr>
545 <tr>
546 <td>Distribution factors</td>
547 <td>“distFactor” (D*(v))<sup>1</sup></td>
548 </tr>
549 <tr>
550 <td>Neumann sets</td>
551 <td>Sideset number</td>
552 <td>NEUMANN_SET</td>
553 </tr>
554 <tr>
555 <td rowspan="2">Neumann sets, reverse faces3<sup>3</sup></td>
556 <td>Distribution factors</td>
557 <td>“distFactor” (D*(v))<sup>1</sup></td>
558 </tr>
559 <tr>
560 <td>Sides</td>
561 <td>SENSE</td>
562 </tr>
563 <tr>
564 <td>Nodes, elements</td>
565 <td>node_num_map, elem_map</td>
566 <td>GLOBAL_ID on nodes/elements</td>
567 </tr>
568 </table>
569 
570 Notes:
571 -# Variable-length tag used for distribution factors; length for each set is the number of entities in
572 each set, such that there is one distribution factor for each entity in the set.
573 -# QA records are stored as variable-length tags on file set specified on read. Tag is a
574 concatenation of QA record strings into a single string, with '\0' used to delimit lines.
575 -# MOAB represents sidesets as sets of faces, rather than as sides of elements. Faces can be
576 ordered “forward” or “reverse” with respect to one of the bounding elements, depending on
577 whether the right-hand normal points into or out of the element. Forward-sense faces are added
578 to the Neumann set. Reverse-sense faces are put into a separate set; that set is tagged with the SENSE tag, with value = -1; and that reverse set is added to the Neummann set.
579 .
580 
581 
582  \section appendixD Appendix D: NC (Climate Data) Reader/Writer Conventions
583 
584 The climate data reader in MOAB reads files with the '.nc' filename extension. By default, this reader
585 reads the whole mesh in the file and creates it as structured mesh in MOAB, with the mesh accessible
586 through MOAB's structured mesh interface. By default, all variables and timesteps are read from the
587 file, and written as tags on the mesh vertices from that file. This behavior is controlled by the
588 “variable”, “nomesh”, “timestep”, and “timeval” options described earlier in this document. If MOAB
589 is compiled for parallel execution and configured with a pnetcdf reader, the mesh is read in parallel,
590 with a 1D or 2D decomposition designed to balance read performance and communication interface
591 size (for details on the partitioning method used, see the src/io/ReadNC.cpp source file).
592 
593 Mesh is put into the entity set provided to the load_file function. This entity set is also annotated with
594 various tags representing information read from the file. These tags are described in Table 5.
595 
596 Reading unstructured NC files in the HOMME format is also supported. Currently a trivial
597 element-based partition is the only option for parallel reading. As the data is unstructured, it is necessary to have a connectivity file to define the vertex adjacencies. The default convention is to have a file called HommeMapping.nc in the same directory as the the variable data file. If this convention is not followed, the connectivity file can be specified with the option -O CONN=”/path/to/connectivity.nc”. An example of mbconvert using the parallel read capability is shown below:
598 
599 <B> mpiexec -np 2 tools/mbconvert -O TRIVIAL -O DEBUG_IO=1 -o DEBUG_IO=9 -o PARALLEL=WRITE_PART /nfs2/hayes6/meshlab/homme_data/camrun.cam2.h0.0000-01-01-16200.nc output.h5m </B>
600 
601 Several other things to note about reading climate data files into MOAB:
602 - Time-dependent variables: MOAB currently has no mechanism for time-dependent tags. Therefore, time-dependent variables are represented using one tag per timestep, with the tag name set as the variable name plus the timestep index. Thus, the first few timesteps for the variable TEMPERATURE would be represented in tags named TEMPERATURE0, TEMPERATURE1, etc.
603 - Cell- and face-centered variables: The climate data reader currently does not do cell- and face-
604 centered variables correctly.
605 .
606  \subsection table5 Table 5: Summary of MOAB conventional tag names, types, and purposes. Data types are I=integer, D=double, C=character, H=entity handle. Data type with *x denote length of x elements of that data type; data type with *var denote variable-length tag. Tag names with two underscores prepended (“__”) denote tags not written to a file by MOAB.
607 
608 <Table border="1">
609 <tr>
610 <th> Tag name </th>
611 <th>Data type </th>
612 <th> Applies to (E=entity, S=set) </th>
613 <th>Purpose </th>
614 </tr>
615 <tr>
616 <td>__NUM_DIMS </td>
617 <td>I</td>
618 <td>S</td>
619 <td>The number of dimensions in the netcdf file.</td>
620 </tr>
621 <tr>
622 <td>__NUM_VARS</td>
623 <td>I</td>
624 <td>S</td>
625 <td>The number of variables in the netcdf file.</td>
626 </tr>
627 <tr>
628 <td>__DIM_NAMES </td>
629 <td>C*var</td>
630 <td>S</td>
631 <td>The dimension names, concatenated into a
632 character string, with '\0' terminating each name.
633 </td>
634 </tr>
635 <tr>
636 <td>__DIM_LENS </td>
637 <td>I*var</td>
638 <td>S</td>
639 <td>A vector of integers, storing the length of
640 each dimension.
641 </td>
642 </tr>
643 <tr>
644 <td>__VAR_NAMES
645 </td>
646 <td>C*var</td>
647 <td>S</td>
648 <td>The variable names, concatenated into a
649 character string, with '\0' terminating each name.
650 </td>
651 </tr>
652 <tr>
653 <td><dim_name>
654 </td>
655 <td>(I or D)*var</td>
656 <td>S</td>
657 <td>For each dimension, the values for the dimension.
658 The data type for this tag corresponds to that in the
659 netcdf file. The length of this tag is the number of
660 values stored for the dimension in the netcdf file.</td>
661 </tr>
662 <tr>
663 <td>__<dim_name>_LOC_MIN_MAX</td>
664 <td>(I or D)*2</td>
665 <td>S</td>
666 <td>The indices (0-based) of the local min and max
667 values of dimension stored locally. For spatial
668 dimensions like lon or lat, this will store the
669 minimum and maximum indices in the local partition
670 of the grid. For dimensions like time, where each
671 processor represents the entire dimension, this will
672 likely store 0 and the number of values for that
673 dimension. Only one of __<dim_name>_LOC_VALS and
674 __<dim_name>_LOC_MIN_MAX can be used for a given
675 dimension.</td>
676 </tr>
677 <tr>
678 <td>__<dim_name>_LOC_VAL </td>
679 <td>(I or D)*var</td>
680 <td>S</td>
681 <td>The indices (0-based) of the dimension stored
682 locally. This tag only makes sense for dimensions
683 that can be read in multiple pieces, such as time.
684 Only one of __<dim_name>_LOC_VALS and
685 __<dim_name>_LOC_MIN_MAX can be used for a given
686 dimension.</td>
687 </tr>
688 <tr>
689 <td>__<dim_name>_GLOBAL_MIN_MAX</td>
690 <td>(I or D)*2</td>
691 <td>S</td>
692 <td>The indices (0-based) of the global min and max
693 values of dimension.</td>
694 </tr>
695 <tr>
696 <td>__<var_name>_DIMS
697 </td>
698 <td>H*n
699 </td>
700 <td>S</td>
701 <td>For each variable, this tag stores the tag
702 handles for the n dimensions defining this variable,
703 in netcdf ordering (last dimension varying fastest).
704 The size of this tag is n * sizeof(TagHandle).
705 </td>
706 </tr>
707 <tr>
708 <td><var_name><timestep_ind>
709 </td>
710 <td>(data type)</td>
711 <td>E</td>
712 <td>Values of the variable for timestep <timestep_ind>
713 for vertices. The data type of this tag corresponds
714 to that of the variable from the netcdf file.
715 Timestep index is 0-based.
716 </td>
717 </tr>
718 <tr>
719 <td>__GLOBAL_ATTRIBS
720 </td>
721 <td>C*var
722 </td>
723 <td>S</td>
724 <td>The global attributes, concatenated into a character
725 string, with ‘\0’ terminating each attribute name, ‘;’
726  separating the data type and value, and ‘;’
727  separating one name/data type/value from the next.
728 </td>
729 </tr>
730 <tr>
731 <td>__GLOBAL_ATTRIBS_LEN
732 </td>
733 <td>I*var
734 </td>
735 <td>S</td>
736 <td>A vector of integers, marking the end position of
737 each attribute (name/data type/value) in __GLOBAL_ATTRIBS tag.
738 </td>
739 </tr>
740 <tr>
741 <td>__<var_name>_ATTRIBS
742 </td>
743 <td>C*var
744 </td>
745 <td>S</td>
746 <td>The variable attributes, concatenated into a
747 character string, with ‘\0’ terminating each attribute
748  name, ‘;’ separating the data type and value, and ‘;’
749  separating one name/data type/value from the next.
750 </td>
751 </tr>
752 <tr>
753 <td>__<var_name>_ATTRIBS_LEN
754 </td>
755 <td>I*var
756 </td>
757 <td>S</td>
758 <td>A vector of integers, marking the end position of
759 each attribute (name/data type/value) in
760 __<var_name>_ATTRIBS tags
761 </td>
762 </tr>
763 </table>
764 
765 
766  \section appendixE Appendix E: Nek5000 Reader/Writer Conventions
767 
768 Nek5000, or Nek, is a code that uses the spectral element method to model fluid, heat transfer,
769 electromagnetics, and other physics. Nek uses unstructured hexahedral meshes, with each hex element
770 resolved by a structured grid of “Gauss Lebato Legendre” (GLL) points. Nek can read meshes through
771 MOAB, and can output physics variables and GLL points through MOAB as well.
772 
773 Since fluid is a single material in Nek, no material sets are needed. Boundary conditions are mapped to
774 Nek's cbc array using Neumann sets and a user-provided “usr_moab2nek” subroutine (for an example
775 of this subroutine, see examples/moab/pipe.usr in the Nek source code). GLL point locations and fluid
776 variables on those points are stored in tags on the hex elements. All hex elements have the same
777 number of GLL points. The number of GLL points in each direction is stored in a tag on the mesh
778 instance. These tags are described in Table 6.
779 
780 GLL point locations and fluid variables are stored in lexicographic order, similar to their storage order
781 inside the Nek code.
782 
783  \subsection table6 Table 6: Summary of MOAB conventional tag names, types, and purposes for Nek. Data types are I=integer, D=double, C=character, H=entity handle. Data type with *x denote length of x elements of that data type; data type with *var denote variable-length tag. Tag names with two underscores prepended (“__”) denote tags not written to a file by MOAB.
784 <Table border="1">
785 <tr>
786 <th> Tag name </th>
787 <th> Data Type</th>
788 <th>Applies to (E=entity, S=set)</th>
789 <th>Purpose</th>
790 </tr>
791 <tr>
792 <td>SEM_DIMS</td>
793 <td>I*3</td>
794 <td>S</td>
795 <td>The dimensions of the GLL mesh in each hex
796 element.
797 </td>
798 </tr>
799 <tr>
800 <td>SEM_X</td>
801 <td>D*nx*ny*nz</td>
802 <td>E</td>
803 <td>X position of GLL points (having nx*ny*nz
804 values)
805 </td>
806 </tr>
807 <tr>
808 <td>SEM_Y</td>
809 <td>D*nx*ny*nz</td>
810 <td>E</td>
811 <td>Y position of GLL points (having nx*ny*nz values)</td>
812 </tr>
813 <tr>
814 <td>SEM_Z</td>
815 <td>D*nx*ny*nz</td>
816 <td>E</td>
817 <td>Z position of GLL points (having nx*ny*nz values)</td>
818 </tr>
819 <tr>
820 <td>VEL_X</td>
821 <td>D*nx*ny*nz</td>
822 <td>E</td>
823 <td>Fluid velocities in the x direction for GLL point
824 array (having nx*ny*nz values)</td>
825 </tr>
826 <tr>
827 <td>VEL_Y</td>
828 <td>D*nx*ny*nz</td>
829 <td>E</td>
830 <td>Fluid velocities in the y direction for GLL point
831 array (having nx*ny*nz values)</td>
832 </tr>
833 <tr>
834 <td>VEL_Z</td>
835 <td>D*nx*ny*nz</td>
836 <td>E</td>
837 <td>Fluid velocities in the z direction for GLL point
838 array (having nx*ny*nz values)</td>
839 </tr>
840 <tr>
841 <td>TEMP</td>
842 <td>D*nx*ny*nz</td>
843 <td>E</td>
844 <td>Fluid temperature for GLL point array (having
845 nx*ny*nz values)
846 </td>
847 </tr>
848 <tr>
849 <td>PRESS</td>
850 <td>D*nx*ny*nz</td>
851 <td>E</td>
852 <td>Fluid pressure for GLL point array (having
853 nx*ny*nz values)
854 </td>
855 </tr>
856 </table>
857  */
858