#include <H5Tpublic.h>
Go to the source code of this file.
Classes | |
struct | struct_mhdf_Status |
Struct used to return error status. More... | |
struct | mhdf_EntDesc |
struct | mhdf_TagDesc |
struct | mhdf_ElemDesc |
struct | mhdf_FileDesc |
Macros | |
#define | MHDF_MESSAGE_BUFFER_LEN 160 |
#define | mhdf_EDGE_TYPE_NAME "Edge" |
Name to use for edge element. More... | |
#define | mhdf_TRI_TYPE_NAME "Tri" |
Name to use for triangle element. More... | |
#define | mhdf_QUAD_TYPE_NAME "Quad" |
Name to use for quadrilateral element. More... | |
#define | mhdf_POLYGON_TYPE_NAME "Polygon" |
Name to use for general polygon element. More... | |
#define | mhdf_TET_TYPE_NAME "Tet" |
Name to use for tetrahedral element. More... | |
#define | mhdf_PYRAMID_TYPE_NAME "Pyramid" |
Name to use for quad-based pyramid element. More... | |
#define | mhdf_PRISM_TYPE_NAME "Prism" |
Name to use for triangular prism element. More... | |
#define | mdhf_KNIFE_TYPE_NAME "Knife" |
Name to use for knife element. More... | |
#define | mdhf_HEX_TYPE_NAME "Hex" |
Name to use for quad-sided hexahedral element. More... | |
#define | mhdf_POLYHEDRON_TYPE_NAME "Polyhedron" |
Name to use for general polyhedron specified as a arbitrary-length list of faces. More... | |
#define | mhdf_SEPTAHEDRON_TYPE_NAME "Septahedron" |
Name to use for hexagonal-based pyramid. More... | |
Typedefs | |
typedef struct struct_mhdf_Status | mhdf_Status |
Struct used to return error status. More... | |
typedef mhdf_Status | MHDF_Status |
typedef enum mhdf_TagDataType | MHDF_TagDataType |
Enum for tag data type class. More... | |
typedef long | mhdf_index_t |
Type used when creating index tables. More... | |
typedef void * | mhdf_FileHandle |
Opaque handle to an open file. More... | |
typedef mhdf_FileHandle | MHDF_FileHandle |
typedef struct mhdf_EntDesc | MHDF_EntDesc |
typedef struct mhdf_TagDesc | MHDF_TagDesc |
typedef struct mhdf_ElemDesc | MHDF_ElemDesc |
typedef struct mhdf_FileDesc | MHDF_FileDesc |
Enumerations | |
enum | mhdf_TagDataType { mhdf_OPAQUE = 0 , mhdf_INTEGER , mhdf_FLOAT , mhdf_BITFIELD , mhdf_BOOLEAN , mhdf_ENTITY_ID } |
Enum for tag data type class. More... | |
Functions | |
int | mhdf_isError (mhdf_Status const *) |
Return 1 if passed status object indicates an error. Zero otherwise. More... | |
const char * | mhdf_message (mhdf_Status const *) |
Get the error message given a status object. More... | |
mhdf_FileHandle | mhdf_createFile (const char *filename, int overwrite, const char **elem_type_list, size_t elem_type_list_len, hid_t id_type, mhdf_Status *status) |
Create a new file. More... | |
mhdf_FileHandle | mhdf_openFile (const char *filename, int writable, unsigned long *max_id, hid_t id_type, mhdf_Status *status) |
Open an existing file. More... | |
mhdf_FileHandle | mhdf_openFileWithOpt (const char *filename, int writable, unsigned long *max_id, hid_t id_type, hid_t options, mhdf_Status *status) |
Open an existing file with options. More... | |
int | mhdf_countOpenHandles (mhdf_FileHandle h) |
Get number of open HDF5 objects from file. More... | |
MHDF_FileDesc * | mhdf_getFileSummary (mhdf_FileHandle file_handle, hid_t file_id_type, mhdf_Status *status, int extraSetInfo) |
Get summary of data tables contained within file. More... | |
void | mhdf_fixFileDesc (struct mhdf_FileDesc *copy_ptr, const struct mhdf_FileDesc *orig_addr) |
Fix nested pointers for copied/moved FileDesc struct. More... | |
void | mhdf_closeFile (mhdf_FileHandle handle, mhdf_Status *status) |
Close the file. More... | |
#define mdhf_HEX_TYPE_NAME "Hex" |
Name to use for quad-sided hexahedral element.
Definition at line 44 of file mhdf_public.h.
#define mdhf_KNIFE_TYPE_NAME "Knife" |
Name to use for knife element.
Definition at line 42 of file mhdf_public.h.
#define mhdf_EDGE_TYPE_NAME "Edge" |
Name to use for edge element.
Definition at line 28 of file mhdf_public.h.
#define MHDF_MESSAGE_BUFFER_LEN 160 |
Definition at line 10 of file mhdf_public.h.
#define mhdf_POLYGON_TYPE_NAME "Polygon" |
Name to use for general polygon element.
Definition at line 34 of file mhdf_public.h.
#define mhdf_POLYHEDRON_TYPE_NAME "Polyhedron" |
Name to use for general polyhedron specified as a arbitrary-length list of faces.
Definition at line 46 of file mhdf_public.h.
#define mhdf_PRISM_TYPE_NAME "Prism" |
Name to use for triangular prism element.
Definition at line 40 of file mhdf_public.h.
#define mhdf_PYRAMID_TYPE_NAME "Pyramid" |
Name to use for quad-based pyramid element.
Definition at line 38 of file mhdf_public.h.
#define mhdf_QUAD_TYPE_NAME "Quad" |
Name to use for quadrilateral element.
Definition at line 32 of file mhdf_public.h.
#define mhdf_SEPTAHEDRON_TYPE_NAME "Septahedron" |
Name to use for hexagonal-based pyramid.
Definition at line 48 of file mhdf_public.h.
#define mhdf_TET_TYPE_NAME "Tet" |
Name to use for tetrahedral element.
Definition at line 36 of file mhdf_public.h.
#define mhdf_TRI_TYPE_NAME "Tri" |
Name to use for triangle element.
Definition at line 30 of file mhdf_public.h.
typedef struct mhdf_ElemDesc MHDF_ElemDesc |
typedef struct mhdf_EntDesc MHDF_EntDesc |
Data common to sets, nodes, and each element type
typedef struct mhdf_FileDesc MHDF_FileDesc |
typedef void* mhdf_FileHandle |
Opaque handle to an open file.
Definition at line 73 of file mhdf_public.h.
typedef mhdf_FileHandle MHDF_FileHandle |
Definition at line 75 of file mhdf_public.h.
typedef long mhdf_index_t |
Type used when creating index tables.
The data type used by mhdf_create* functions that create tables if indices (e.g. mhdf_createSetMeta, mhdf_createVarLenTag, etc.).
Definition at line 70 of file mhdf_public.h.
typedef struct struct_mhdf_Status mhdf_Status |
Struct used to return error status.
typedef mhdf_Status MHDF_Status |
Definition at line 18 of file mhdf_public.h.
typedef enum mhdf_TagDataType MHDF_TagDataType |
Enum for tag data type class.
Enumerates known types for tag data
typedef struct mhdf_TagDesc MHDF_TagDesc |
Struct describing a tag
enum mhdf_TagDataType |
Enum for tag data type class.
Enumerates known types for tag data
Definition at line 55 of file mhdf_public.h.
void mhdf_closeFile | ( | mhdf_FileHandle | handle, |
mhdf_Status * | status | ||
) |
Close the file.
handle | The file to close. |
status | Passed back status of API call. |
Definition at line 438 of file file.c.
References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_checkOpenHandles(), mhdf_setFail(), and mhdf_setOkay().
Referenced by moab::ReadHDF5::clean_up_read(), iMOAB_ReadHeaderInfo(), main(), moab::WriteHDF5Parallel::parallel_create_file(), moab::ReadHDF5::set_up_read(), and moab::WriteHDF5::write_file().
int mhdf_countOpenHandles | ( | mhdf_FileHandle | h | ) |
Get number of open HDF5 objects from file.
Definition at line 150 of file file.c.
Referenced by moab::CheckOpenReadHDF5Handles::~CheckOpenReadHDF5Handles(), and moab::CheckOpenWriteHDF5Handles::~CheckOpenWriteHDF5Handles().
mhdf_FileHandle mhdf_createFile | ( | const char * | filename, |
int | overwrite, | ||
const char ** | elem_type_list, | ||
size_t | elem_type_list_len, | ||
hid_t | id_type, | ||
mhdf_Status * | status | ||
) |
Create a new file.
Create a new HDF mesh file. This handle must be closed with mhdf_closeFile
to avoid resource loss.
filename | The path and name of the file to create |
overwrite | If zero, will fail if the specified file already exists. If non-zero, will overwrite an existing file. |
elem_type_list | The list of element types that will be stored in the file. If the element name exits as a pre- defined constant (mhdf_type), that constant should be used. If a constant does not exist for the type, a similar naming pattern should be used (accepted name for type, first character uppercase, subsequent characters lowercase.) The element type index passed to mhdf_addElement is then an index into this list. The array may contain null entries to allow the caller some control over the assigned indices without creating dummy types which may confuse readers. |
elem_type_list_len | The length of elem_type_list . |
id_type | Type to use when creating datasets containing file IDs |
status | Passed back status of API call. |
Definition at line 37 of file file.c.
References API_BEGIN, API_END_H, ELEMENT_GROUP, struct_FileHandle::hdf_handle, make_hdf_group(), struct_FileHandle::max_id, MAX_ID_ATTRIB, mhdf_alloc_FileHandle(), mhdf_create_scalar_attrib(), mhdf_setFail(), mhdf_setOkay(), NODE_GROUP, NODE_TAG_GROUP, ROOT_GROUP, SET_GROUP, SET_TAG_GROUP, TAG_GROUP, and TYPE_ENUM_PATH.
Referenced by moab::WriteHDF5Parallel::parallel_create_file(), and moab::WriteHDF5::serial_create_file().
void mhdf_fixFileDesc | ( | struct mhdf_FileDesc * | copy_ptr, |
const struct mhdf_FileDesc * | orig_addr | ||
) |
Fix nested pointers for copied/moved FileDesc struct.
This is a utility method to facility copying/moving/communicating struct FileDesc instances. The structure and all data it references are allocated in a single contiguous block of memory of size FileDesc::total_size. As such, the struct can be copied with a single memcpy, packed into a single network packet, communicated with a single MPI call, etc. However, the pointers contained within the struct will not be valid in the copied instance (they will still point into the original instance.) Given a pointer to the copied struct and the address of the original struct, this function will updated all contained pointers.
Definition at line 77 of file file-desc.c.
References API_BEGIN, API_END, mhdf_FileDesc::defTagsEntSets, mhdf_FileDesc::defTagsVals, mhdf_EntDesc::dense_tag_indices, mhdf_FileDesc::elems, FIX_OFFSET, mhdf_FileDesc::nodes, mhdf_FileDesc::num_elem_desc, mhdf_FileDesc::num_tag_desc, mhdf_FileDesc::numEntSets, mhdf_FileDesc::sets, and mhdf_FileDesc::tags.
Referenced by realloc_data(), and moab::ReadHDF5::set_up_read().
MHDF_FileDesc* mhdf_getFileSummary | ( | mhdf_FileHandle | file_handle, |
hid_t | file_id_type, | ||
mhdf_Status * | status, | ||
int | extraSetInfo | ||
) |
Get summary of data tables contained within file.
Returned struct, including all pointed-to data, is allocated in a single contiguous block of memory with a size equal to 'total_size'. Caller is responsible for freeing the returned struct FileDesc pointer (and only that pointer, not pointers nexted within the struct!). Caller may copy (e.g. MPI_BCast) entire struct as one contiguous block, assuming all nested pointers in the copy are updated to the correct relative offset from the beginning of the struct.
Definition at line 385 of file file-desc.c.
References alloc_file_desc(), API_BEGIN, API_END, mhdf_EntDesc::count, mhdf_FileDesc::defTagsEntSets, mhdf_FileDesc::defTagsVals, mhdf_TagDesc::dense_elem_indices, mhdf_EntDesc::dense_tag_indices, mhdf_ElemDesc::desc, mhdf_FileDesc::elems, free_string_list(), get_elem_desc(), get_tag_desc(), mhdf_FileDesc::have_set_children, mhdf_FileDesc::have_set_contents, mhdf_FileDesc::have_set_parents, mhdf_TagDesc::have_sparse, mhdf_closeData(), mhdf_getElemHandles(), mhdf_getTagNames(), mhdf_haveDenseTag(), mhdf_haveNodes(), mhdf_haveSets(), mhdf_isError(), mhdf_malloc(), mhdf_node_type_handle(), mhdf_openDenseTagData(), mhdf_openNodeCoords(), mhdf_openSetMeta(), mhdf_openSparseTagData(), mhdf_read_data(), mhdf_readTagValues(), mhdf_set_type_handle(), mhdf_setOkay(), mhdf_TagDesc::name, mhdf_FileDesc::nodes, mhdf_TagDesc::num_dense_indices, mhdf_EntDesc::num_dense_tags, mhdf_FileDesc::num_elem_desc, mhdf_FileDesc::num_tag_desc, mhdf_FileDesc::numEntSets, mhdf_FileDesc::offset, realloc_data(), mhdf_FileDesc::sets, size, mhdf_EntDesc::start_id, mhdf_FileDesc::tags, mhdf_FileDesc::total_size, and mhdf_EntDesc::vals_per_ent.
Referenced by iMOAB_ReadHeaderInfo(), main(), and moab::ReadHDF5::set_up_read().
int mhdf_isError | ( | mhdf_Status const * | status | ) |
Return 1 if passed status object indicates an error. Zero otherwise.
MOAB, a Mesh-Oriented datABase, is a software component for creating, storing and accessing finite element mesh data.
Copyright 2004 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
Definition at line 26 of file status.c.
References struct_mhdf_Status::message.
Referenced by alloc_file_desc(), check_valid_adjacencies(), check_valid_elem_conn(), check_valid_parents_children(), check_valid_poly_conn(), check_valid_set_contents(), check_valid_sets(), check_valid_tag(), check_valid_var_len_tag(), moab::ReadHDF5::create_tag(), get_elem_desc(), get_tag_desc(), iMOAB_ReadHeaderInfo(), moab::ReadHDF5::is_error(), main(), mhdf_getFileSummary(), moab::ReadHDF5::read_qa(), moab::ReadHDF5::read_tag_values_all(), moab::ReadHDF5::read_tag_values_partial(), realloc_data(), moab::ReadHDF5::set_up_read(), and moab::WriteHDF5::write_file().
const char* mhdf_message | ( | mhdf_Status const * | status | ) |
Get the error message given a status object.
Definition at line 31 of file status.c.
References struct_mhdf_Status::message.
Referenced by check_valid_adjacencies(), check_valid_elem_conn(), check_valid_parents_children(), check_valid_poly_conn(), check_valid_set_contents(), check_valid_sets(), check_valid_tag(), check_valid_var_len_tag(), moab::ReadHDF5::create_tag(), iMOAB_ReadHeaderInfo(), moab::ReadHDF5::is_error(), main(), moab::WriteHDF5Parallel::parallel_create_file(), moab::ReadHDF5::read_qa(), moab::ReadHDF5::read_tag_values_all(), moab::ReadHDF5::read_tag_values_partial(), moab::ReadHDF5::set_up_read(), and moab::WriteHDF5::write_file().
mhdf_FileHandle mhdf_openFile | ( | const char * | filename, |
int | writable, | ||
unsigned long * | max_id, | ||
hid_t | id_type, | ||
mhdf_Status * | status | ||
) |
Open an existing file.
Open an existing HDF mesh file. This handle must be closed with mhdf_closeFile
to avoid resource loss.
filename | The path and name of the file to open |
writable | If non-zero, open read-write. Otherwise read-only. |
status | Passed back status of API call. |
max_id | Used to pass back the maximum global ID used in the file. Provided as an indication to the caller of the size of the mesh. This parameter is optional. NULL may be passed. |
id_type | Type to use when creating datasets containing file IDs |
Definition at line 141 of file file.c.
References mhdf_openFileWithOpt().
Referenced by iMOAB_ReadHeaderInfo(), main(), and moab::ReadHDF5::set_up_read().
mhdf_FileHandle mhdf_openFileWithOpt | ( | const char * | filename, |
int | writable, | ||
unsigned long * | max_id, | ||
hid_t | id_type, | ||
hid_t | options, | ||
mhdf_Status * | status | ||
) |
Open an existing file with options.
Open an existing HDF mesh file. This handle must be closed with mhdf_closeFile
to avoid resource loss. This function allows the calling application to specify the HDF5 access property list that is passed to the HDF5 H5Fopen API. If this is passed as H5P_DEFAULT, the behavior is the same as mhdf_openFile . This argument is typically used to specify a parallel context for for writing the file in parallel.
filename | The path and name of the file to open |
writable | If non-zero, open read-write. Otherwise read-only. |
status | Passed back status of API call. |
max_id | Used to pass back the maximum global ID used in the file. Provided as an indication to the caller of the size of the mesh. This parameter is optional. NULL may be passed. |
options | The HDF5 access property list to use when opening the file. See the HDF5 documentation for H5Fopen. |
id_type | Type to use when creating datasets containing file IDs |
Definition at line 277 of file file.c.
References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, struct_FileHandle::max_id, mhdf_alloc_FileHandle(), mhdf_setFail(), mhdf_setOkay(), ROOT_GROUP, and scan_for_max_id().
Referenced by mhdf_openFile(), moab::WriteHDF5Parallel::parallel_create_file(), and moab::ReadHDF5::set_up_read().