XMDF  2.2
Modules
4.6. XMDF Groups

Modules

 4.6.2. Determining all entities in a file
 

Detailed Description

As mentioned above, the file structure for HDF5 files consists of a hierarchical tree of groups. Each group may contain variables or other groups. This section defines the variables that a group must include for a particular type of data (2D mesh geometry, Grid geometry, data sets, etc.) We do not specify a particular path that these items must be stored in (like /Meshes/2D/MeshA) since these locations may change in the future (in order to include multiple scenarios, etc.). Instead we have created functions inside the API to determine paths for a group. Every group includes a "Grouptype string" that identifies the type of information contained in the group. The grouptypes and their meanings are given in Table 1.

Table 1 Group types defined as part of XMDF.

MESH
Any mesh type including 0D, 1D, 2D, and 3D elements. Meshes are allowed to contain mixtures of elements of different dimensions.
GRID
Any grid including Cartesian, curvilinear, and composites of the two.
XSECS
Cross-section information.
PROPERTIES
Properties belonging to meshes, grids, elements, nodes, etc.
GENERIC
A group used for organization. Is not tied to a particular type of data.

All functions that read from or write to a group use an identifier to the group. This identifier is of type xid and is obtained by creating or opening a group.

The following API functions are used to create groups for meshes, grids, and cross-sections. Creating data set and attribute groups will be discussed later because they are associated with a specific grid or mesh. The path is a string with slashes ‘/’ to specify the groups. The identifier is the file identifier received from the open file or close file command. The create group operation for data sets should only be used when writing data sets for a mesh, grid, or cross-sections that are not defined in the file.

C/C++
int xfCreateGroupForMesh(xid FileId, const char *Path, xid *GroupId);
int xfCreateGroupForGrid(xid FileId, const char *Path, xid *GroupId);
int xfCreateGroupForXsec(xid FileId, const char *Path, xid *GroupId);
int xfCreateGenericGroup(xid FileId, const char *Path, xid *GroupId);
FORTRAN
SUBROUTINE XF_CREATE_GROUP_FOR_MESH(FileId, Path, GroupId, Error)
INTEGER(XID), INTENT(IN) :: FileId
CHARACTER(LEN=*), INTENT(IN):: Path
INTEGER(XID), INTENT(OUT) :: GroupId
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_CREATE_GROUP_FOR_GRID (FileId, Path, GroupId, Error)
INTEGER(XID), INTENT(IN) :: FileId
CHARACTER(LEN=*), INTENT(IN) :: Path
INTEGER(XID), INTENT(OUT) :: GroupId
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_CREATE_GROUP_FOR_XSECS (FileId, Path, GroupId, Error)
INTEGER(XID), INTENT(IN) :: FileId
CHARACTER(LEN=*), INTENT(IN):: Path
INTEGER(XID), INTENT(OUT) :: GroupId
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_CREATE_GENERIC_GROUP (FileId, Path, GroupId, Error)
INTEGER(XID), INTENT(IN) :: FileId
CHARACTER(LEN=*), INTENT(IN):: Path
INTEGER(XID), INTENT(OUT) :: GroupId
INTEGER, INTENT(OUT) :: Error

The following API function is used to open existing groups for reading/writing.

C/C++
int xfOpenGroup(xid FileId, const char *path, xid *GroupId);
FORTRAN
SUBROUTINE XF_OPEN_GROUP(FileId, Path, GroupId, Error)
INTEGER(XID), INTENT(IN) :: FileId
CHARACTER(LEN=*), INTENT(IN) :: Path
INTEGER(XID), INTENT(OUT) :: GroupId
INTEGER, INTENT(OUT) :: Error

When the group is no longer needed the following call must be made to close the group:

C/C++
int xfCloseGroup(xid GroupId);
FORTRAN
SUBROUTINE XF_CLOSE_GROUP(GroupId, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: Error