moab
Tag data.

Modules

 Tag type values (MOAB-specific)

Functions

hid_t mhdf_getNativeType (hid_t input_type, int size, mhdf_Status *status)
 Make type native-endian.
void mhdf_createTag (mhdf_FileHandle file_handle, const char *tag_name, enum mhdf_TagDataType tag_type, int size, int storage, const void *default_value, const void *global_value, hid_t hdf_type, hid_t mhdf_base_type, mhdf_Status *status)
 Add a tag to the file.
hid_t mhdf_getTagDataType (mhdf_FileHandle file_handle, const char *tag_name, mhdf_Status *status)
 Get handle to HDF5 type object for tag data.
void mhdf_createVarLenTag (mhdf_FileHandle file_handle, const char *tag_name, enum mhdf_TagDataType tag_type, int storage, const void *default_value, int default_value_length, const void *global_value, int global_value_length, hid_t hdf_type, hid_t hdf_base_type, mhdf_Status *status)
 Add variable-length tag to file.
int mhdf_getNumberTags (mhdf_FileHandle file_handle, mhdf_Status *status)
 Get the number of tags in the file.
char ** mhdf_getTagNames (mhdf_FileHandle file_handle, int *num_names_out, mhdf_Status *status)
 Get the name for each tag defined in the file.
void mhdf_getTagInfo (mhdf_FileHandle file_handle, const char *tag_name, enum mhdf_TagDataType *class_out, int *size_out, int *tstt_storage_out, int *have_default_out, int *have_global_out, int *have_sparse_out, mhdf_Status *status)
 Get the description of a specified tag.
void mhdf_getTagValues (mhdf_FileHandle file_handle, const char *tag_name, hid_t output_data_type, void *default_value, void *global_value, mhdf_Status *status)
 Get the default and global values of the tag.
int mhdf_haveDenseTag (mhdf_FileHandle file_handle, const char *tag_name, const char *elem_group, mhdf_Status *status)
 Check if the file contains dense tag data for the specified tag and element group.
hid_t mhdf_createDenseTagData (mhdf_FileHandle file_handle, const char *tag_name, const char *elem_group, long num_values, mhdf_Status *status)
 Create an object to hold dense tag values for a given element group.
hid_t mhdf_openDenseTagData (mhdf_FileHandle file_handle, const char *tag_name, const char *elem_group, long *num_values_out, mhdf_Status *status)
 Open the object containing dense tag values for a given element group.
void mhdf_createSparseTagData (mhdf_FileHandle file_handle, const char *tag_name, long num_values, hid_t entities_and_values_out[2], mhdf_Status *status)
 Create file objects to store sparse tag data.
void mhdf_createVarLenTagData (mhdf_FileHandle file_handle, const char *tag_name, long num_entities, long num_values, hid_t entities_and_values_out[3], mhdf_Status *status)
 Create file objects to store (sparse) variable-length tag data.
void mhdf_openSparseTagData (mhdf_FileHandle file_handle, const char *tag_name, long *num_entity_out, long *num_values_out, hid_t entities_and_values_out[3], mhdf_Status *status)
 Create file objects to read sparse tag data.
void mhdf_writeSparseTagEntities (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, const void *id_list, mhdf_Status *status)
 Write Global ID list for sparse tag data.
void mhdf_writeSparseTagEntitiesWithOpt (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, const void *id_list, hid_t write_prop, mhdf_Status *status)
void mhdf_writeTagValues (hid_t value_handle, long offset, long count, hid_t hdf_tag_data_type, const void *tag_data, mhdf_Status *status)
 Write tag values.
void mhdf_writeTagValuesWithOpt (hid_t value_handle, long offset, long count, hid_t hdf_tag_data_type, const void *tag_data, hid_t write_prop, mhdf_Status *status)
void mhdf_writeSparseTagIndices (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, const void *end_indices, mhdf_Status *status)
 Write sparse tag end indices for variable-length tag data.
void mhdf_writeSparseTagIndicesWithOpt (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, const void *end_indices, hid_t write_prop, mhdf_Status *status)
void mhdf_readSparseTagEntities (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, void *id_list, mhdf_Status *status)
 Read Global ID list for sparse tag data.
void mhdf_readSparseTagEntitiesWithOpt (hid_t id_handle, long offset, long count, hid_t hdf_integer_type, void *id_list, hid_t read_prop, mhdf_Status *status)
void mhdf_readTagValues (hid_t value_handle, long offset, long count, hid_t hdf_type, void *memory, mhdf_Status *status)
 Read tag values.
void mhdf_readTagValuesWithOpt (hid_t value_handle, long offset, long count, hid_t hdf_type, void *memory, hid_t read_prop, mhdf_Status *status)
void mhdf_readSparseTagIndices (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, void *end_indices, mhdf_Status *status)
 Read sparse tag end indices for variable-length tag data.
void mhdf_readSparseTagIndicesWithOpt (hid_t tag_handle, long offset, long count, hid_t hdf_integer_type, void *end_indices, hid_t read_prop, mhdf_Status *status)

Detailed Description

The data for each tag can be stored in two places/formats: sparse and/or dense. The data may be stored in both, but there should not be redundant values for the same entity.

Dense tag data is stored as multiple tables of tag values, one for each element group. (Note: special mhdf_ElemHandle values are available for accessing dense tag data on nodes or meshsets via the mhdf_node_type_handle and mhdf_set_type_handle functions.) Each dense tag table should contain the same number of entries as the element connectivity table. The tag values are associated with the corresponding element in the connectivity table.

Sparse tag data is stored as a global table pair for each tag type. The first if the pair of tables is a list of Global IDs. The second is the corresponding tag value for each entity in the ID list.


Function Documentation

hid_t mhdf_createDenseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
const char *  elem_group,
long  num_values,
mhdf_Status status 
)

Create an object to hold dense tag values for a given element group.

Parameters:
file_handleThe file.
tag_nameThe tag.
elem_groupThe element group handle, or the return value of mhdf_node_type_handle or mhdf_set_type_handle for nodes or sets respectively.
num_valuesThe number of tag values to be written. Must be The same as the number of elements in the group. Specified here to allow tag values to be written before node coordinates, element connectivity or meshsets.
statusPassed back status of API call.
Returns:
Handle to data object in file.
void mhdf_createSparseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
long  num_values,
hid_t  entities_and_values_out[2],
mhdf_Status status 
)

Create file objects to store sparse tag data.

Create the file objects to store all sparse data for a given tag in. The sparse data is stored in a pair of objects. The first is a vector of global IDs. The second is a vector of tag values for each entity specified in the list of global IDs.

Parameters:
file_handleThe file.
tag_nameThe tag.
num_valuesThe number of tag values to be written.
entities_and_values_outThe handles to the file objects. The first is the vector of global IDs. The second is the list of corresponding tag values.
statusPassed back status of API call.
void mhdf_createTag ( mhdf_FileHandle  file_handle,
const char *  tag_name,
enum mhdf_TagDataType  tag_type,
int  size,
int  storage,
const void *  default_value,
const void *  global_value,
hid_t  hdf_type,
hid_t  mhdf_base_type,
mhdf_Status status 
)

Add a tag to the file.

Add a new tag to the file. This function must be called to define the tag characteristics before values for the tag can be written.

Parameters:
file_handleThe file
tag_nameThe tag name
tag_typeThe tag type.
sizeIf tag_type == mhdf_BITFIELD, the number of bits. If tag_type == mhdf_OPAQUE, the size of the opaque type in bytes. Otherwise the length of the array of tag_type entities associated with each mesh entity, or 1 for a scalar value.
storageMOAB storage type (dense, sparse, etc.)
default_valueDefault value for tag, or NULL if none.
global_valueGlobal value for tag, or NULL if none.
hdf_typeIf non-zero, assumed to be a user-specified type for opaque data. Ignored if tag_type is not mhdf_OPAQUE.
hdf_base_typeIgnored if hdf_type is non-zero. If hdf_type is zero and this type is non-zero, it is used either as the type or as the base type for an array type for default_value and global_value, respectively. Typically used to specify the input data type for mhdf_ENTITY_ID tags.
void mhdf_createVarLenTag ( mhdf_FileHandle  file_handle,
const char *  tag_name,
enum mhdf_TagDataType  tag_type,
int  storage,
const void *  default_value,
int  default_value_length,
const void *  global_value,
int  global_value_length,
hid_t  hdf_type,
hid_t  hdf_base_type,
mhdf_Status status 
)

Add variable-length tag to file.

Add a new tag to the file. This function must be called to define the tag characteristics before values for the tag can be written. Use this function if the tag values are not fixed-length.

Parameters:
file_handleThe file
tag_nameThe tag name
tag_typeThe tag type.
storageMOAB storage type (dense, sparse, etc.)
default_valueDefault value for tag, or NULL if none.
default_value_lengthLength of default value.
global_valueGlobal value for tag, or NULL if none.
global_value_lengthLength of global value.
hdf_typeIf non-zero, assumed to be a user-specified type for opaque data. Ignored if tag_type is not mhdf_OPAQUE.
hdf_base_typeIgnored if hdf_type is non-zero. If hdf_type is zero and this type is non-zero, it is used either as the type or as the base type for an array type for default_value and global_value, respectively. Typically used to specify the input data type for mhdf_ENTITY_ID tags.
void mhdf_createVarLenTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
long  num_entities,
long  num_values,
hid_t  entities_and_values_out[3],
mhdf_Status status 
)

Create file objects to store (sparse) variable-length tag data.

Create the file objects to store all sparse data for a given tag in. The sparse data is stored in a pair of objects. The first is a vector of global IDs. The second is a vector of tag values for each entity specified in the list of global IDs.

Parameters:
file_handleThe file.
tag_nameThe tag.
num_entitiesThe number of entities for which tag values are to be stored
num_valuesThe total number of scalar values to be written (the total number of bytes of data for all tags for opaque data.)
entities_and_values_outThe handles to the file objects. The first is the vector of global IDs. The second is the list of corresponding tag values. The third is the handle to the index table.
statusPassed back status of API call.
hid_t mhdf_getNativeType ( hid_t  input_type,
int  size,
mhdf_Status status 
)

Make type native-endian.

Given an atomic HDF5 data type, return the built-in type that matches the class of the passed type and is the specified size.

This function is provided to allow converting the stored tag type in a file to the preferred type for it's representation in memory when reading tag values.

This function works only for atomic types. The returned type will be a pre-defined HDF5 object and does not need to be closed/released.

Parameters:
input_typeThe type to convert.
sizeThe desired size in bytes.
statusPassed back status of API call.
Returns:
The converted type.
int mhdf_getNumberTags ( mhdf_FileHandle  file_handle,
mhdf_Status status 
)

Get the number of tags in the file.

Parameters:
file_handleThe file.
statusPassed back status of API call.
Returns:
The number of tags.
hid_t mhdf_getTagDataType ( mhdf_FileHandle  file_handle,
const char *  tag_name,
mhdf_Status status 
)

Get handle to HDF5 type object for tag data.

void mhdf_getTagInfo ( mhdf_FileHandle  file_handle,
const char *  tag_name,
enum mhdf_TagDataType class_out,
int *  size_out,
int *  tstt_storage_out,
int *  have_default_out,
int *  have_global_out,
int *  have_sparse_out,
mhdf_Status status 
)

Get the description of a specified tag.

Get everything about a tag except the actual values.

Parameters:
file_handleThe file.
tag_nameThe name of the tag to retrieve the data for.
class_outThe TSTT class of the tag data.
size_outDepends on value of class_out:
  • mhdf_OPAQUE - size of opaque data in bytes
  • mhdf_BITFIELD - number of bits
  • if data is fixed-length array, length of array
  • if data is single value, 1
  • if data is a variable-length array, -1
tstt_storage_outThe value of the TSTT enum for storage (dense, sparse, etc.)
have_default_outNon-zero if file contains a default value for the tag. Length of default value if variable-lenth tag.
have_global_outNon-zero if the file contains a global/mesh value for the tag.
have_sparse_outNon-zero if the file contains a sparse data table for this tag.
char** mhdf_getTagNames ( mhdf_FileHandle  file_handle,
int *  num_names_out,
mhdf_Status status 
)

Get the name for each tag defined in the file.

Parameters:
file_handleThe file.
num_names_outThe length of the returned array of strings.
statusPassed back status of API call.
Returns:
An array of null-terminated strings. The array and each string is allocated with malloc. The caller should release this memory by calling free for each string and the array.
void mhdf_getTagValues ( mhdf_FileHandle  file_handle,
const char *  tag_name,
hid_t  output_data_type,
void *  default_value,
void *  global_value,
mhdf_Status status 
)

Get the default and global values of the tag.

Parameters:
file_handleThe file.
tag_nameThe tag name.
output_data_typeThe HDF5 type for the memory into which the tag data is to be written. If zero, then the value(s) will be read as opaque data.
default_valueMemory location at which to write the default value of the tag.
global_valueIf the tag has a global value, the memory location at which to write that value.
statusPassed back status of API call.
int mhdf_haveDenseTag ( mhdf_FileHandle  file_handle,
const char *  tag_name,
const char *  elem_group,
mhdf_Status status 
)

Check if the file contains dense tag data for the specified tag and element group.

Check if there is dense tag data for a given element type for the specified tag.

Parameters:
file_handleThe file.
tag_nameThe tag.
elem_groupThe element group handle, or the return value of mhdf_node_type_handle or mhdf_set_type_handle for nodes or sets respectively.
statusPassed back status of API call.
Returns:
Non-zero if file contains specified data. Zero otherwise.
hid_t mhdf_openDenseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
const char *  elem_group,
long *  num_values_out,
mhdf_Status status 
)

Open the object containing dense tag values for a given element group.

Parameters:
file_handleThe file.
tag_nameThe tag.
elem_groupThe element group handle, or the return value of mhdf_node_type_handle or mhdf_set_type_handle for nodes or sets respectively.
num_values_outThe number of tag values to be written. Must be The same as the number of elements in the group.
statusPassed back status of API call.
Returns:
Handle to data object in file.
void mhdf_openSparseTagData ( mhdf_FileHandle  file_handle,
const char *  tag_name,
long *  num_entity_out,
long *  num_values_out,
hid_t  entities_and_values_out[3],
mhdf_Status status 
)

Create file objects to read sparse tag data.

Open the file objects containing all sparse data for a given tag in. The sparse data is stored in a pair of objects. The first is a vector of global IDs. The second is a vector of tag values for each entity specified in the list of global IDs. For variable-length tags, a third table containing end offsets for each tag value is returned in the third position of the output hid_t array (see mhdf_readSparseTagIndices.)

Parameters:
file_handleThe file.
tag_nameThe tag.
num_entity_outThe number of entities for which there are tag values.
num_values_outThe number of data values. For fixed-length tags, this is the same as num_entity_out. For variable-length tags, it is the total number of values in the data table.
entities_and_values_outThe handles to the pair of file objects. The first is the vector of global IDs. The second is the list of corresponding tag values. The third is the handle to the index table, iff the tag is variable-length. If the tag is fixed-length, this value is not set.
statusPassed back status of API call.
void mhdf_readSparseTagEntities ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  id_list,
mhdf_Status status 
)

Read Global ID list for sparse tag data.

Parameters:
id_handleThe first handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData.
offsetThe offset at which to begin reading.
countThe number of global IDs to read.
hdf_integer_typeThe type of the integer data in id_list. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
id_listThe memory location at which to store the global IDs.
statusPassed back status of API call.
void mhdf_readSparseTagEntitiesWithOpt ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  id_list,
hid_t  read_prop,
mhdf_Status status 
)
void mhdf_readSparseTagIndices ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  end_indices,
mhdf_Status status 
)

Read sparse tag end indices for variable-length tag data.

Read sparse tag end indices for variable-length tag data. Each value in the list is the *last* index (zero-based) into the tag data for the corresponding entity.

Parameters:
tag_handlehandle to the data object to read from.
offsetThe offset into the table at which to begin reading
countThe number of values to read.
hdf_integer_typeThe type of the values pointed to by end_indices (must be an integer type).
end_indicesMemory in which to store the data read from the table.
statusOutput: API result.
void mhdf_readSparseTagIndicesWithOpt ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  end_indices,
hid_t  read_prop,
mhdf_Status status 
)
void mhdf_readTagValues ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_type,
void *  memory,
mhdf_Status status 
)

Read tag values.

Parameters:
value_handleThe second handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData; or the handle returned by mhdf_createDenseTagData or mhdf_openDenseTagData.
offsetThe offset at which to begin reading.
countThe number of tag values to read.
hdf_typeThe type of the data in memory. If this is specified, it must be possible for the HDF library to convert between this type and the type the tag data is stored as. If zero, the values will be read as opaque data.
memoryMemory location at which to store tag values.
statusPassed back status of API call.
void mhdf_readTagValuesWithOpt ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_type,
void *  memory,
hid_t  read_prop,
mhdf_Status status 
)
void mhdf_writeSparseTagEntities ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  id_list,
mhdf_Status status 
)

Write Global ID list for sparse tag data.

Parameters:
id_handleThe first handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData.
offsetThe offset at which to begin writing.
countThe number of global IDs to write.
hdf_integer_typeThe type of the integer data in id_list. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
id_listThe list of global IDs to write.
statusPassed back status of API call.
void mhdf_writeSparseTagEntitiesWithOpt ( hid_t  id_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  id_list,
hid_t  write_prop,
mhdf_Status status 
)
void mhdf_writeSparseTagIndices ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  end_indices,
mhdf_Status status 
)

Write sparse tag end indices for variable-length tag data.

Write sparse tag end indices for variable-length tag data. Each value in the list is the *last* index (zero-based) into the tag data for the corresponding entity.

Parameters:
tag_handlehandle to the data object to write to.
offsetThe offset into the table at which to begin writting
countThe number of values to write.
hdf_integer_typeThe type of the values pointed to by end_indices (must be an integer type).
end_indicesThe values to store in the table.
statusOutput: API result.
void mhdf_writeSparseTagIndicesWithOpt ( hid_t  tag_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  end_indices,
hid_t  write_prop,
mhdf_Status status 
)
void mhdf_writeTagValues ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_tag_data_type,
const void *  tag_data,
mhdf_Status status 
)

Write tag values.

Parameters:
value_handleThe second handle passed back from either mhdf_createSparseTagData or mhdf_openSparseTagData; or the handle returned by mhdf_createDenseTagData or mhdf_openDenseTagData.
offsetThe offset at which to begin writing.
countThe number of tag values to write.
hdf_tag_data_typeThe type of the data in memory. It must be possible for the HDF library to convert between this type and the type the tag data is stored as.
tag_dataThe list of tag values to write.
statusPassed back status of API call.
void mhdf_writeTagValuesWithOpt ( hid_t  value_handle,
long  offset,
long  count,
hid_t  hdf_tag_data_type,
const void *  tag_data,
hid_t  write_prop,
mhdf_Status status 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines