changesets -3740 merged from sandbox

This commit is contained in:
2011-08-18 16:19:28 +00:00
parent aacd90c1cc
commit 8860a72e65
100 changed files with 6302 additions and 6175 deletions
+36 -14
View File
@@ -34,44 +34,66 @@ extern "C" {
static inline h5_err_t
H5FedOpenTetrahedralMesh (
h5_file_t* const f,
const h5_id_t mesh_id
const char* name,
h5t_mesh_t** mesh
) {
H5_API_ENTER2 (h5_err_t, "f=0x%p, mesh_id=%lld", f, (long long)mesh_id);
H5_API_RETURN (h5t_open_tetrahedral_mesh (f, mesh_id));
H5_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", f, name, mesh);
H5_API_RETURN (h5t_open_tetrahedral_mesh (f, name, mesh));
}
static inline h5_err_t
H5FedOpenTetrahedralMeshByIndex (
h5_file_t* const f,
const h5_id_t idx,
h5t_mesh_t** mesh
) {
H5_API_ENTER (h5_err_t, "f=%p, idx=%lld, mesh=%p", f, (long long)idx, mesh);
H5_API_RETURN (h5t_open_tetrahedral_mesh_by_idx (f, idx, mesh));
}
static inline h5_err_t
H5FedOpenTriangleMesh (
h5_file_t* const f,
const h5_id_t mesh_id
const char* name,
h5t_mesh_t** mesh
) {
H5_API_ENTER2 (h5_err_t, "f=0x%p, mesh_id=%lld", f, (long long)mesh_id);
H5_API_RETURN (h5t_open_triangle_mesh (f, mesh_id));
H5_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", f, name, mesh);
H5_API_RETURN (h5t_open_triangle_mesh (f, name, mesh));
}
static inline h5_err_t
H5FedOpenTriangleMeshByIndex (
h5_file_t* const f,
const h5_id_t idx,
h5t_mesh_t** mesh
) {
H5_API_ENTER (h5_err_t, "f=%p, idx=%lld, mesh=%p", f, (long long)idx, mesh);
H5_API_RETURN (h5t_open_triangle_mesh_by_idx (f, idx, mesh));
}
static inline h5_err_t
H5FedCloseMesh (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
H5_API_RETURN (h5t_close_mesh (f));
H5_API_ENTER (h5_err_t, "m=%p", m);
H5_API_RETURN (h5t_close_mesh (m));
}
static inline h5_err_t
H5FedSetLevel (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5t_lvl_idx_t level_id
) {
H5_API_ENTER2 (h5_err_t, "f=0x%p, level_id=%d", f, level_id);
H5_API_RETURN (h5t_set_level (f, level_id));
H5_API_ENTER (h5_err_t, "m=%p, level_id=%d", m, level_id);
H5_API_RETURN (h5t_set_level (m, level_id));
}
static inline h5_err_t
H5FedLinkMeshToStep (
h5_file_t* const f,
h5_file_t* const m,
const h5_id_t mesh_id
) {
H5_API_ENTER2 (h5_err_t, "f=0x%p, mesh_id=%lld", f, (long long)mesh_id);
H5_API_ENTER (h5_err_t, "m=%p, mesh_id=%lld", m, (long long)mesh_id);
H5_API_RETURN (h5_error_not_implemented ());
}
+8 -10
View File
@@ -7,26 +7,24 @@ extern "C" {
static inline h5_err_t
H5FedGetAdjacencies (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
const h5_int32_t dim,
h5_loc_idlist_t** list
) {
H5_API_ENTER4 (h5_err_t,
"f=0x%p, entity_id=%lld, dim=%d, list=0x%p",
f, (long long)entity_id, dim, list);
H5_API_RETURN (h5t_get_adjacencies (f, entity_id, dim, list));
H5_API_ENTER (h5_err_t,
"m=%p, entity_id=%lld, dim=%d, list=%p",
m, (long long)entity_id, dim, list);
H5_API_RETURN (h5t_get_adjacencies (m, entity_id, dim, list));
}
static inline h5_err_t
H5FedReleaseListOfAdjacencies (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_idlist_t** list
) {
H5_API_ENTER2 (h5_err_t,
"f=0x%p, list=0x%p",
f, list);
H5_API_RETURN (h5t_release_list_of_adjacencies (f, list));
H5_API_ENTER (h5_err_t, "f=%p, list=%p", m, list);
H5_API_RETURN (h5t_release_list_of_adjacencies (m, list));
}
#ifdef __cplusplus
+26 -26
View File
@@ -34,7 +34,7 @@ static inline h5_ssize_t
H5FedGetNumTetrahedralMeshes (
h5_file_t* const f
) {
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
H5_API_ENTER (h5_err_t, "f=%p", f);
H5_API_RETURN (h5t_get_num_tetmeshes (f));
}
@@ -42,7 +42,7 @@ static inline h5_ssize_t
H5FedGetNumTriangleMeshes (
h5_file_t* const f
) {
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
H5_API_ENTER (h5_err_t, "f=%p", f);
H5_API_RETURN (h5t_get_num_trimeshes (f));
}
@@ -55,10 +55,10 @@ H5FedGetNumTriangleMeshes (
*/
static inline h5_ssize_t
H5FedGetNumLevels (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
H5_API_RETURN (h5t_get_num_leaf_levels (f));
H5_API_ENTER (h5_ssize_t, "m=%p", m);
H5_API_RETURN (h5t_get_num_leaf_levels (m));
}
/*!
@@ -70,10 +70,10 @@ H5FedGetNumLevels (
*/
static inline h5t_lvl_idx_t
H5FedGetLevel (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5t_lvl_idx_t, "f=0x%p", f);
H5_API_RETURN (h5t_get_level (f));
H5_API_ENTER (h5t_lvl_idx_t, "m=%p", m);
H5_API_RETURN (h5t_get_level (m));
}
/*!
@@ -86,10 +86,10 @@ H5FedGetLevel (
*/
static inline h5_ssize_t
H5FedGetNumVertices (
h5_file_t* const f /*!< file handle */
h5t_mesh_t* const m /*!< file handle */
) {
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
H5_API_RETURN (h5t_get_num_vertices (f, -1));
H5_API_ENTER (h5_ssize_t, "m=%p", m);
H5_API_RETURN (h5t_get_num_vertices (m, -1));
}
/*!
@@ -103,11 +103,11 @@ H5FedGetNumVertices (
*/
static inline h5_ssize_t
H5FedGetNumVerticesCnode (
h5_file_t* const f,
h5t_mesh_t* const m,
const int cnode
) {
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, cnode=%d", f, cnode);
H5_API_RETURN (h5t_get_num_vertices (f, cnode));
H5_API_ENTER (h5_ssize_t, "m=%p, cnode=%d", m, cnode);
H5_API_RETURN (h5t_get_num_vertices (m, cnode));
}
/*!
@@ -120,10 +120,10 @@ H5FedGetNumVerticesCnode (
*/
static inline h5_ssize_t
H5FedGetNumVerticesTotal (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
H5_API_RETURN (h5t_get_num_vertices (f, -1));
H5_API_ENTER (h5_ssize_t, "m=%p", m);
H5_API_RETURN (h5t_get_num_vertices (m, -1));
}
/*!
@@ -136,12 +136,12 @@ H5FedGetNumVerticesTotal (
*/
static inline h5_ssize_t
H5FedGetNumElements (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
H5_API_ENTER (h5_ssize_t, "m=%p", m);
// MLH: can't use field from opaque h5_file_t!
//h5_ssize_t num = h5t_get_num_elems (f, f->myproc);
H5_API_RETURN (h5t_get_num_elems (f, -1));
H5_API_RETURN (h5t_get_num_elems (m, -1));
}
/*!
@@ -155,11 +155,11 @@ H5FedGetNumElements (
*/
static inline h5_ssize_t
H5FedGetNumElementsCnode (
h5_file_t* const f,
h5t_mesh_t* const m,
const int cnode
) {
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, cnode=%d", f, cnode);
H5_API_RETURN (h5t_get_num_elems (f, cnode));
H5_API_ENTER (h5_ssize_t, "m=%p, cnode=%d", m, cnode);
H5_API_RETURN (h5t_get_num_elems (m, cnode));
}
/*!
@@ -172,10 +172,10 @@ H5FedGetNumElementsCnode (
*/
static inline h5_ssize_t
H5FedGetNumElementsTotal (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
H5_API_RETURN (h5t_get_num_elems (f, -1));
H5_API_ENTER (h5_ssize_t, "m=%p", m);
H5_API_RETURN (h5t_get_num_elems (m, -1));
}
#ifdef __cplusplus
+41 -44
View File
@@ -36,32 +36,31 @@ extern "C" {
static inline h5t_iterator_p
H5FedBeginTraverseEntities (
h5_file_t* const f,
h5t_mesh_t* const m,
const int codim
) {
H5_API_ENTER2 (h5t_iterator_p, "f=0x%p, codim=%d", f, codim);
H5_API_ENTER (h5t_iterator_p, "m=%p, codim=%d", m, codim);
h5t_iterator_p iter;
TRY3 (h5t_iterator_p, iter = (h5t_iterator_p)h5_calloc (1, sizeof (*iter)));
TRY3 (h5t_iterator_p, h5t_init_leaf_iterator (f, iter, codim));
TRY3 (h5t_iterator_p, h5t_init_leaf_iterator (iter, m, codim));
H5_API_RETURN (iter);
}
static inline h5t_iterator_p
H5FedBeginTraverseBoundaryFaces (
h5_file_t* const f,
h5t_mesh_t* const m,
const int codim
) {
H5_API_ENTER2 (h5t_iterator_p, "f=0x%p, codim=%d", f, codim);
H5_API_ENTER (h5t_iterator_p, "m=%p, codim=%d", m, codim);
h5t_iterator_p iter;
TRY3 (h5t_iterator_p, iter = (h5t_iterator_p)h5_calloc (1, sizeof (*iter)));
TRY3 (h5t_iterator_p, h5t_init_boundary_face_iterator (f, iter, codim));
TRY3 (h5t_iterator_p, h5t_init_boundary_face_iterator (iter, m, codim));
H5_API_RETURN (iter);
}
/*!
Get next local entity ID.
\param[in] f file handle
\param[in/out] iter iterator
\return Local entity ID
@@ -70,28 +69,26 @@ H5FedBeginTraverseBoundaryFaces (
*/
static inline h5_loc_id_t
H5FedTraverseEntities (
h5_file_t* const f,
h5t_iterator_t* iter
) {
H5_API_ENTER2 (h5_loc_id_t, "f=0x%p, iter=0x%p", f, iter);
H5_API_RETURN (h5t_iterate_entities (f, iter));
H5_API_ENTER (h5_loc_id_t, "iter=%p", iter);
H5_API_RETURN (h5t_iterate_entities (iter));
}
/*!
End of traversing. Release internal data structures.
\param[in] f File handle
\param[in/out] iter iterator
\return H5_SUCCESS or error code
*/
static inline h5_err_t
H5FedEndTraverseEntities (
h5_file_t* const f,
h5t_iterator_t* iter
) {
H5_API_ENTER2 (h5_err_t, "f=0x%p, iter=0x%p", f, iter);
H5_API_RETURN (h5t_release_entity_iterator (f, iter));
H5_API_ENTER (h5_err_t, "iter=%p", iter);
H5_API_RETURN (h5t_release_entity_iterator (iter));
}
@@ -106,74 +103,74 @@ H5FedEndTraverseEntities (
*/
static inline h5_err_t
H5FedGetVertexCoordsByIndex (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_idx_t vertex_index,
h5_float64_t P[3]
) {
H5_API_ENTER3 (h5_err_t,
"f=0x%p, vertex_index=%lld, P=0x%p",
f, (long long)vertex_index, P);
H5_API_RETURN (h5t_get_vertex_coords_by_index (f, vertex_index, P));
H5_API_ENTER (h5_err_t,
"m=%p, vertex_index=%lld, P=%p",
m, (long long)vertex_index, P);
H5_API_RETURN (h5t_get_vertex_coords_by_index (m, vertex_index, P));
}
static inline h5_err_t
H5FedGetVertexCoordsByID (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_id_t vertex_id,
h5_float64_t P[3]
) {
H5_API_ENTER3 (h5_err_t,
"f=0x%p, vertex_id=%lld, P=0x%p",
f, (long long)vertex_id, P);
H5_API_RETURN (h5t_get_vertex_coords_by_id (f, vertex_id, P));
H5_API_ENTER (h5_err_t,
"m=%p, vertex_id=%lld, P=%p",
m, (long long)vertex_id, P);
H5_API_RETURN (h5t_get_vertex_coords_by_id (m, vertex_id, P));
}
static inline h5_err_t
H5FedGetVertexIndicesOfEdge (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_indices
) {
H5_API_ENTER3 (h5_err_t,
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
f, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_edge (f, entity_id, vertex_indices));
H5_API_ENTER (h5_err_t,
"m=%p, entity_id=%lld, vertex_indices=%p",
m, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_edge (m, entity_id, vertex_indices));
}
static inline h5_err_t
H5FedGetVertexIndicesOfTriangle (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_indices
) {
H5_API_ENTER3 (h5_err_t,
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
f, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_triangle (f, entity_id, vertex_indices));
H5_API_ENTER (h5_err_t,
"m=%p, entity_id=%lld, vertex_indices=%p",
m, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_triangle (m, entity_id, vertex_indices));
}
static inline h5_err_t
H5FedGetVertexIndicesOfTet (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_indices
) {
H5_API_ENTER3 (h5_err_t,
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
f, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_tet (f, entity_id, vertex_indices));
H5_API_ENTER (h5_err_t,
"m=%p, entity_id=%lld, vertex_indices=%p",
m, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_tet (m, entity_id, vertex_indices));
}
static inline h5_err_t
H5FedGetVertexIndicesOfEntity (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_indices
) {
H5_API_ENTER3 (h5_err_t,
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
f, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_entity (f, entity_id, vertex_indices));
H5_API_ENTER (h5_err_t,
"m=%p, entity_id=%lld, vertex_indices=%p",
m, (long long)entity_id, vertex_indices);
H5_API_RETURN (h5t_get_vertex_indices_of_entity (m, entity_id, vertex_indices));
}
#ifdef __cplusplus
+52 -48
View File
@@ -23,20 +23,24 @@
extern "C" {
#endif
static inline h5_id_t
static inline h5_err_t
H5FedAddTetrahedralMesh (
h5_file_t* const f
h5_file_t* const f,
const char* name,
h5t_mesh_t** mesh
) {
H5_API_ENTER1 (h5_id_t, "f=0x%p", f);
H5_API_RETURN (h5t_add_tetrahedral_mesh (f));
H5_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", f, name, mesh);
H5_API_RETURN (h5t_add_tetrahedral_mesh (f, name, mesh));
}
static inline h5_id_t
static inline h5_err_t
H5FedAddTriangleMesh (
h5_file_t* const f
h5_file_t* const f,
const char* name,
h5t_mesh_t** mesh
) {
H5_API_ENTER1 (h5_id_t, "f=0x%p", f);
H5_API_RETURN (h5t_add_triangle_mesh (f));
H5_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", f, name, mesh);
H5_API_RETURN (h5t_add_triangle_mesh (f, name, mesh));
}
/*!
@@ -61,21 +65,21 @@ H5FedAddTriangleMesh (
*/
static inline h5t_lvl_idx_t
H5FedAddLevel (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5t_lvl_idx_t, "f=0x%p", f);
H5_API_RETURN (h5t_add_level (f));
H5_API_ENTER (h5t_lvl_idx_t, "m=%p", m);
H5_API_RETURN (h5t_add_level (m));
}
static inline h5_err_t
H5FedBeginStoreVertices (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_size_t num
) {
H5_API_ENTER2 (h5_err_t,
"f=0x%p, num=%llu",
f, (long long unsigned)num);
H5_API_RETURN (h5t_begin_store_vertices (f, num));
H5_API_ENTER (h5_err_t,
"m=%p, num=%llu",
m, (long long unsigned)num);
H5_API_RETURN (h5t_begin_store_vertices (m, num));
}
/*!
@@ -89,39 +93,39 @@ H5FedBeginStoreVertices (
*/
static inline h5_loc_idx_t
H5FedStoreVertex (
h5_file_t* const f, /*!< file handle */
h5t_mesh_t* const m, /*!< file handle */
const h5_glb_id_t vertex_id, /*!< id from mesher or -1 */
const h5_float64_t P[3] /*!< coordinates */
) {
H5_API_ENTER3 (h5_loc_idx_t,
"f=0x%p, vertex_id=%lld, P=0x%p",
f, (long long)vertex_id, P);
if (h5t_get_level (f) != 0) {
H5_API_ENTER (h5_loc_idx_t,
"m=%p, vertex_id=%lld, P=%p",
m, (long long)vertex_id, P);
if (h5t_get_level (m) != 0) {
H5_API_LEAVE (
h5_error (
H5_ERR_INVAL,
"Vertices can be added to level 0 only!"));
}
H5_API_RETURN (h5t_store_vertex (f, vertex_id, P));
H5_API_RETURN (h5t_store_vertex (m, vertex_id, P));
}
static inline h5_err_t
H5FedEndStoreVertices (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
H5_API_RETURN (h5t_end_store_vertices (f));
H5_API_ENTER (h5_err_t, "m=%p", m);
H5_API_RETURN (h5t_end_store_vertices (m));
}
static inline h5_err_t
H5FedBeginStoreElements (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_size_t num
) {
H5_API_ENTER2 (h5_err_t,
"f=0x%p, num=%llu",
f, (long long unsigned)num);
H5_API_RETURN (h5t_begin_store_elems (f, num));
H5_API_ENTER (h5_err_t,
"m=%p, num=%llu",
m, (long long unsigned)num);
H5_API_RETURN (h5t_begin_store_elems (m, num));
}
/*!
@@ -140,52 +144,52 @@ H5FedBeginStoreElements (
*/
static inline h5_loc_idx_t
H5FedStoreElement (
h5_file_t* const f, /*!< file handle */
h5t_mesh_t* const m, /*!< file handle */
const h5_loc_idx_t local_vids[] /*!< tuple with vertex id's */
) {
H5_API_ENTER2 (h5_loc_idx_t, "f=0x%p, local_vids=0x%p", f, local_vids);
if (h5t_get_level (f) != 0) {
H5_API_ENTER (h5_loc_idx_t, "m=%p, local_vids=%p", m, local_vids);
if (h5t_get_level (m) != 0) {
H5_API_LEAVE (
h5_error (
H5_ERR_INVAL,
"Elements can be added to level 0 only!"));
}
H5_API_RETURN (h5t_store_elem (f, -1, local_vids));
H5_API_RETURN (h5t_store_elem (m, -1, local_vids));
}
static inline h5_err_t
H5FedEndStoreElements (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
H5_API_RETURN (h5t_end_store_elems (f));
H5_API_ENTER (h5_err_t, "m=%p", m);
H5_API_RETURN (h5t_end_store_elems (m));
}
static inline h5_err_t
H5FedBeginRefineElements (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
H5_API_RETURN (h5t_begin_refine_elems (f));
H5_API_ENTER (h5_err_t, "m=%p", m);
H5_API_RETURN (h5t_begin_refine_elems (m));
}
static inline h5_loc_idx_t
H5FedRefineElement (
h5_file_t* const f, /*!< file handle */
h5t_mesh_t* const m, /*!< file handle */
const h5_loc_id_t local_eid /*!< local element id */
) {
H5_API_ENTER2 (h5_loc_idx_t,
"f=0x%p, local_eid=%lld",
f, (long long)local_eid);
H5_API_RETURN (h5t_mark_entity (f, local_eid));
H5_API_ENTER (h5_loc_idx_t,
"m=%p, local_eid=%lld",
m, (long long)local_eid);
H5_API_RETURN (h5t_mark_entity (m, local_eid));
}
static inline h5_err_t
H5FedEndRefineElements (
h5_file_t* const f
h5t_mesh_t* const m
) {
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
H5_API_RETURN (h5t_end_refine_elems (f));
H5_API_ENTER (h5_err_t, "m=%p", m);
H5_API_RETURN (h5t_end_refine_elems (m));
}
#ifdef __cplusplus
+147 -91
View File
@@ -5,143 +5,199 @@
extern "C" {
#endif
/*!
Get number of tagsets assocciated with the mesh.
\param[in] m mesh
*/
static inline h5_ssize_t
H5FedGetNumMTagsets (
h5t_mesh_t* const m
) {
H5_API_ENTER (h5_ssize_t, "m=%p", m);
H5_API_RETURN (h5t_get_num_mtagsets(m));
}
/*!
Get some information about the tagset \c name.
\param[in] m mesh
\param[in] idx index of tagset to query
\param[out] name name of tagset
\param[in] len_name len of buffer \c name
\param[out] type type of tagset
*/
static inline h5_err_t
H5FedGetMTagsetInfo (
h5t_mesh_t* const m,
const h5_size_t idx,
char name[],
const h5_size_t len_name,
h5_int64_t* const type
) {
H5_API_ENTER (h5_err_t,
"m=%p, idx=%llu, name=%p, len_name=%llu, type=%p",
m, (long long unsigned)idx, name,
(long long unsigned)len_name, type);
H5_API_RETURN (h5t_get_mtagset_info (m, idx, name, len_name, type));
}
/*!
Test whether tagset \c name exists.
\param[in] m mesh
\param[out] name name of tagset to test existance
*/
static inline h5_err_t
H5FedMTagsetExists (
h5t_mesh_t* const m,
const char name[]
) {
H5_API_ENTER (h5_err_t, "m=%p, name=%s", m, name);
H5_API_RETURN (h5t_mtagset_exists (m, name));
}
/*!
Add a tagset to the current mesh.
\param[in] f file handle
\param[in] name name of tagset
\param[in] type data type of tagset
\param[in] m mesh to add a tagset to
\param[in] name name of tagset
\param[in] type data type of tagset
\param[out] tagset new tagset
\return H5_SUCCESS or error code
*/
static inline h5_err_t
H5FedAddMTagset (
h5_file_t* const f,
char* name,
h5_id_t type
h5t_mesh_t* const m,
const char name[],
const h5_id_t type,
h5t_tagset_t** tagset
) {
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", type=%lld",
f, name, (long long)type);
H5_API_RETURN (h5t_add_mtagset (f, name, type));
H5_API_ENTER (h5_err_t,
"m=%p, name='%s', type=%lld tagset=%p",
m, name, (long long)type, tagset);
H5_API_RETURN (h5t_create_mtagset (m, name, type, tagset));
}
/*!
Remove a tagset from the current mesh.
Open tagset \c name.
\param[in] f file handle
\param[in] m mesh
\param[in] name name of tagset to open
\param[out] tagset open tagset
\return H5_SUCCESS or error code
*/
static inline h5_err_t
H5FedOpenMTagset (
h5t_mesh_t* const m,
const char name[],
h5t_tagset_t** tagset
) {
H5_API_ENTER (h5_err_t,
"m=%p, name='%s', tagset=%p",
m, name, tagset);
H5_API_RETURN (h5t_open_mtagset (m, name, tagset));
}
/*!
Close tagset.
\param[in] tagset open tagset
\return H5_SUCCESS or error code
*/
static inline h5_err_t
H5FedCloseMTagset (
h5t_tagset_t* tagset
) {
H5_API_ENTER (h5_err_t, "tagset=%p", tagset);
H5_API_RETURN (h5t_close_mtagset(tagset));
}
/*!
Remove tagset from mesh
\param[in] tagset tagset
\param[in] name name of tagset to remove
\return H5_SUCCESS or error code
*/
static inline h5_err_t
H5FedRemoveMTagset (
h5_file_t* const f,
char name[]
h5t_mesh_t* m,
const char name[]
) {
H5_API_ENTER2 (h5_err_t, "f=0x%p, name=\"%s\"", f, name);
H5_API_RETURN (h5t_remove_mtagset (f, name));
}
/*!
Get available tagsets in current mesh.
\param[in] f file handle
\param[out] names names of available tagsets
\return Number of tagsets or error code
*/
static inline h5_ssize_t
H5FedGetMTagsets (
h5_file_t* const f,
char** names[]
) {
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, names=0x%p", f, names);
H5_API_RETURN (h5t_get_mtagsets (f, names));
}
/*!
Get type of tagset in current mesh.
\param[in] f file handle
\param[in] name name of tagset
\return H5_SUCCESS or error code
*/
static inline h5_id_t
H5FedGetTypeOfMTagset (
h5_file_t* const f,
char name[]
) {
H5_API_ENTER2 (h5_err_t, "f=0x%p, name=\"%s\"", f, name);
H5_API_RETURN (h5t_get_mtagset_type_by_name (f, name));
H5_API_ENTER (h5_err_t, "m=%p, name='%s'", m, name);
H5_API_RETURN (h5t_remove_mtagset (m, name));
}
/*!
Set tag for entity in current mesh.
\param[in] f file handle
\param[in] name names of tagset
\param[in] id id of entity
\param[in] dim dimension of value
\param[in] val tag value
\param[in] tagset ptr tagset
\param[in] entity_id id of entity
\param[in] size size of value
\param[in] val tag value
\return H5_SUCCESS or error code
*/
static inline h5_err_t
H5FedSetMTag (
h5_file_t* const f,
char name[],
h5_loc_id_t id,
const size_t dim,
void* buffer
H5FedSetTag (
h5t_tagset_t* const tagset,
h5_loc_id_t entity_id,
const h5_size_t size,
void* val
) {
H5_API_ENTER5 (h5_err_t,
"f=0x%p, name=\"%s\", id=%lld, dim=%lld, val=0x%p",
f, name, (long long)id, (long long)dim, buffer);
H5_API_RETURN (h5t_set_mtag_by_name (f, name, id, dim, buffer));
H5_API_ENTER (h5_err_t,
"tagset=%p, entity_id=%lld, size=%lld, val=%p",
tagset, (long long)entity_id, (long long)size, val);
H5_API_RETURN (h5t_set_tag (tagset, entity_id, size, val));
}
/*!
Set tag for entity in current mesh.
Get tag for entity in current mesh. If entity is not tagged, return tag of
the next coarser tagged entity. The corresponding entity ID is returned.
\param[in] f file handle
\param[in] name names of tagset
\param[in] id id of entity
\param[out] dim dimension of value
\param[out] val tag value
\param[in] tagset ptr to tagset
\param[in] entity_id id of entity to tag
\param[out] size size of value
\param[out] val tag value
\return H5_SUCCESS or error code
\return entity id
\return H5_ERR on error
*/
static inline h5_err_t
H5FedGetMTag (
h5_file_t* const f,
const char name[],
const h5_loc_id_t id,
size_t* dim,
void* buffer
static inline h5_loc_id_t
H5FedGetTag (
h5t_tagset_t* const tagset,
const h5_loc_id_t entity_id,
h5_size_t* size,
void* val
) {
H5_API_ENTER5 (h5_err_t,
"f=0x%p, name=\"%s\", id=%lld, dim=0x%p, val=0x%p",
f, name, (long long)id, dim, buffer);
H5_API_RETURN (h5t_get_mtag_by_name (f, name, id, dim, buffer));
H5_API_ENTER (h5_err_t,
"tagset=%p, entity_id=%lld, size=%p, val=%p",
tagset, (long long)entity_id, size, val);
H5_API_RETURN (h5t_get_tag (tagset, entity_id, size, val));
}
/*!
Remove tag for entity in current mesh.
\param[in] f file handle
\param[in] name names of tagset
\param[in] id id of entity
\param[in] tagset ptr to tagset tagset
\param[in] entity_id id of entity from which the tag must be removed.
\return H5_SUCCESS or error code
*/
static inline h5_err_t
H5FedRemoveMTag (
h5_file_t* const f,
const char name[],
const h5_loc_id_t id
h5t_tagset_t* const tagset,
const h5_loc_id_t entity_id
) {
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", id=%lld",
f, name, (long long)id);
H5_API_RETURN (h5t_remove_mtag_by_name (f, name, id));
H5_API_ENTER (h5_err_t,
"tagset=%p, entity_id=%lld",
tagset, (long long)entity_id);
H5_API_RETURN (h5t_remove_tag (tagset, entity_id));
}
#ifdef __cplusplus
+74 -152
View File
@@ -21,181 +21,103 @@ extern "C" {
extern char* h5_rfmts[];
#define __FUNC_ENTER(type) \
h5_call_stack_push (__func__,e_##type); \
//////////////////////////////////////////////////////////////////////////////
// function enter macro
#if defined(NDEBUG)
#define __API_ENTER(type, mask, fmt, ...) \
h5_call_stack_init (__func__,e_##type); \
type ret_value = (type)H5_ERR;
#if defined(NDEBUG)
#define __FUNC_ARGS0(mask)
#define __FUNC_ARGS1(fmt, a1, mask)
#define __FUNC_ARGS2(fmt, a1, a2, mask)
#define __FUNC_ARGS3(fmt, a1, a2, a3, mask)
#define __FUNC_ARGS4(fmt, a1, a2, a3, a4, mask)
#define __FUNC_ARGS5(fmt, a1, a2, a3, a4, a5, mask)
#define __FUNC_ARGS6(fmt, a1, a2, a3, a4, a5, a6, mask)
#define __FUNC_ARGS7(fmt, a1, a2, a3, a4, a5, a6, a7, mask)
#define __FUNC_ARGS8(fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask)
#define __FUNC_ENTER(type, mask, fmt, ...) \
type ret_value = (type)H5_ERR;
#else
#define __FUNC_ARGS0(mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(void)"); \
#define __API_ENTER(type, mask, fmt, ...) \
h5_call_stack_push (__func__,e_##type); \
type ret_value = (type)H5_ERR; \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", __VA_ARGS__); \
}
#define __FUNC_ARGS1(fmt, a1, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1); \
}
#define __FUNC_ENTER(type, mask, fmt, ...) \
type ret_value = (type)H5_ERR; \
if (h5_debug_level & mask ) { \
h5_call_stack_push (__func__,e_##type); \
h5_debug ("(" fmt ")", __VA_ARGS__); \
} \
#define __FUNC_ARGS2(fmt, a1, a2, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1, a2); \
}
#define __FUNC_ARGS3(fmt, a1, a2, a3, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1, a2, a3); \
}
#define __FUNC_ARGS4(fmt, a1, a2, a3, a4, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1, a2, a3, a4); \
}
#define __FUNC_ARGS5(fmt, a1, a2, a3, a4, a5, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5); \
}
#define __FUNC_ARGS6(fmt, a1, a2, a3, a4, a5, a6, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5, a6); \
}
#define __FUNC_ARGS7(fmt, a1, a2, a3, a4, a5, a6, a7, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5, a6, a7); \
}
#define __FUNC_ARGS8(fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask) \
if (h5_debug_level & mask ) { \
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5, a6, a7, a8); \
}
#endif
//
//////////////////////////////////////////////////////////////////////////////
#define __FUNC_ENTER0(type, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS0(mask);
#define __API_LEAVE(expr) { \
ret_value = expr; \
goto done; \
}
#define __FUNC_ENTER1(type, fmt, a1, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS1(fmt, a1, mask);
#define __FUNC_ENTER2(type, fmt, a1, a2, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS2(fmt, a1, a2, mask);
#define __FUNC_ENTER3(type, fmt, a1, a2, a3, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS3(fmt, a1, a2, a3, mask);
#define __FUNC_ENTER4(type, fmt, a1, a2, a3, a4, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS4(fmt, a1, a2, a3, a4, mask);
#define __FUNC_ENTER5(type, fmt, a1, a2, a3, a4, a5, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS5(fmt, a1, a2, a3, a4, a5, mask);
#define __FUNC_ENTER6(type, fmt, a1, a2, a3, a4, a5, a6, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS6(fmt, a1, a2, a3, a4, a5, a6, mask);
#define __FUNC_ENTER7(type, fmt, a1, a2, a3, a4, a5, a6, a7, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS7(fmt, a1, a2, a3, a4, a5, a6, a7, mask);
#define __FUNC_ENTER8(type, fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask) \
__FUNC_ENTER(type); \
__FUNC_ARGS8(fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask);
#define __FUNC_LEAVE(expr) { \
ret_value = expr; \
goto done; \
#define __FUNC_LEAVE(expr) { \
ret_value = expr; \
goto done; \
}
//////////////////////////////////////////////////////////////////////////////
// function return macro
#if defined(NDEBUG)
#define __FUNC_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
h5_call_stack_pop(); \
#define __API_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
h5_call_stack_reset (); \
return ret_value;
#define __FUNC_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
return ret_value;
#else
#define __FUNC_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
if (h5_debug_level & mask ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
h5_debug (fmt, ret_value); \
} \
h5_call_stack_pop(); \
#define __API_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
if (h5_debug_level & mask ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
h5_debug (fmt, ret_value); \
} \
h5_call_stack_reset (); \
return ret_value;
#define __FUNC_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
if (h5_debug_level & mask ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
h5_debug (fmt, ret_value); \
h5_call_stack_pop(); \
} \
return ret_value;
#endif
//
//////////////////////////////////////////////////////////////////////////////
#define H5_API_ENTER_(type) \
if (!h5_initialized) { \
h5_initialize(); \
} \
__FUNC_ENTER(type);
#define H5_API_ENTER0(type) \
H5_API_ENTER_(type); \
__FUNC_ARGS0(H5_DEBUG_API)
#define H5_API_ENTER1(type, fmt, a1) \
H5_API_ENTER_(type); \
__FUNC_ARGS1(fmt, a1, H5_DEBUG_API)
#define H5_API_ENTER2(type, fmt, a1, a2) \
H5_API_ENTER_(type); \
__FUNC_ARGS2(fmt, a1,a2, H5_DEBUG_API)
#define H5_API_ENTER3(type, fmt, a1, a2, a3) \
H5_API_ENTER_(type); \
__FUNC_ARGS3(fmt, a1,a2,a3, H5_DEBUG_API)
#define H5_API_ENTER4(type, fmt, a1, a2, a3, a4) \
H5_API_ENTER_(type); \
__FUNC_ARGS4(fmt, a1,a2,a3, a4, H5_DEBUG_API)
#define H5_API_ENTER5(type, fmt, a1, a2, a3, a4, a5) \
H5_API_ENTER_(type); \
__FUNC_ARGS5(fmt, a1,a2,a3, a4, a5, H5_DEBUG_API)
#define H5_API_ENTER6(type, fmt, a1, a2, a3, a4, a5, a6) \
H5_API_ENTER_(type); \
__FUNC_ARGS6(fmt, a1,a2,a3, a4, a5, a6, H5_DEBUG_API)
#define H5_API_ENTER7(type, fmt, a1, a2, a3, a4, a5, a6, a7) \
H5_API_ENTER_(type); \
__FUNC_ARGS7(fmt, a1,a2,a3, a4, a5, a6, a7, H5_DEBUG_API)
#define H5_API_ENTER8(type, fmt, a1, a2, a3, a4, a5, a6, a7, a8) \
H5_API_ENTER_(type); \
__FUNC_ARGS8(fmt, a1,a2,a3, a4, a5, a6, a7, a8, H5_DEBUG_API)
#define H5_API_LEAVE(expr) __FUNC_LEAVE(expr)
#define H5_API_RETURN(expr) __FUNC_RETURN(expr, H5_DEBUG_API);
#define H5_API_ENTER(type, fmt, ...) \
if (!h5_initialized) { \
h5_initialize(); \
} \
__API_ENTER(type, H5_DEBUG_API, fmt, __VA_ARGS__)
#define H5_API_LEAVE(expr) __API_LEAVE(expr)
#define H5_API_RETURN(expr) __API_RETURN(expr, H5_DEBUG_API);
#define TRY( func ) \
+4 -1
View File
@@ -58,6 +58,9 @@ h5_initialize (
H5_ERR_INVAL, \
"Attempting to write to read-only file" );
#define is_writable(f) (f->mode != H5_O_RDONLY)
#define CHECK_READONLY_MODE( f ) \
if ( ! f->mode==H5_O_RDONLY ) \
return h5_error ( \
@@ -73,7 +76,7 @@ h5_initialize (
#define h5_error_not_implemented() \
h5_error( \
H5_ERR_NOT_IMPLEMENTED, \
"%s: Function \"%s\", line %d not yet implemented!", \
"%s: Function '%s', line %d not yet implemented!", \
__FILE__, __func__, __LINE__);
#define h5_error_internal() \
+2 -1
View File
@@ -9,7 +9,8 @@ h5_file_t *
h5_open_file (
const char *filename,
h5_int32_t flags,
MPI_Comm comm
MPI_Comm comm,
h5_size_t alignment
);
h5_err_t
+51 -6
View File
@@ -1,26 +1,71 @@
#ifndef __H5_SYSCALL_H
#define __H5_SYSCALL_H
#include <stdlib.h>
#include <string.h>
#include "h5_errorhandling.h"
#define MALLOC_WRAPPER_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__)
#define MALLOC_WRAPPER_LEAVE(value) __FUNC_LEAVE(value)
#define MALLOC_WRAPPER_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_MALLOC)
#ifdef __cplusplus
extern "C" {
#endif
void*
static inline void_p
h5_alloc (
void* ptr,
const size_t size
);
) {
MALLOC_WRAPPER_ENTER (void_p, "ptr=%p, size=%lu", ptr, size);
ptr = realloc (ptr, size);
if (ptr == NULL) {
MALLOC_WRAPPER_LEAVE (
(void_p)h5_error (H5_ERR_NOMEM, "Out of memory."));
}
MALLOC_WRAPPER_RETURN (ptr);
}
void*
static inline void_p
h5_calloc (
const size_t count,
const size_t size
);
) {
MALLOC_WRAPPER_ENTER (void_p, "count=%zu , size=%zu", count, size);
void* ptr = calloc (count, size);
if (ptr == NULL) {
MALLOC_WRAPPER_LEAVE (
(void_p)h5_error (H5_ERR_NOMEM, "Out of memory."));
}
MALLOC_WRAPPER_RETURN (ptr);
}
h5_err_t
static inline h5_err_t
h5_free (
void* ptr
);
) {
MALLOC_WRAPPER_ENTER (h5_err_t, "ptr=%p", ptr);
if (ptr) {
free (ptr);
}
MALLOC_WRAPPER_RETURN (H5_SUCCESS);
}
static inline char_p
h5_strdup (
const char* s1
) {
MALLOC_WRAPPER_ENTER (char_p, "s='%s'", s1);
char_p s2 = h5_calloc (1, strlen (s1)+1 );
if (s2 == NULL) {
MALLOC_WRAPPER_LEAVE (
(char_p)h5_error (H5_ERR_NOMEM, "Out of memory."));
}
MALLOC_WRAPPER_RETURN (strcpy (s2, s1));
}
#ifdef __cplusplus
}
+16 -7
View File
@@ -16,21 +16,26 @@ extern "C" {
H5_O_RDWR: dataset may exist
*/
#define H5_O_RDWR 0x01
#define H5_O_RDONLY 0x02
#define H5_O_WRONLY 0x04
#define H5_O_APPEND 0x08
#define H5_O_RDWR 0x001
#define H5_O_RDONLY 0x002
#define H5_O_WRONLY 0x004
#define H5_O_APPEND 0x008
#define H5_VFD_MPIPOSIX 0x10
#define H5_VFD_INDEPENDENT 0x20
#define H5_VFD_MPIPOSIX 0x010
#define H5_VFD_INDEPENDENT 0x020
#define H5_O_FLUSHSTEP 0x40
#define H5_FLUSH_FILE 0x040
#define H5_FLUSH_STEP 0x080
#define H5_FLUSH_DATASET 0x100
#define H5_FS_LUSTRE 0x200
#define H5_ID_T H5T_NATIVE_INT64
#define H5_FLOAT64_T H5T_NATIVE_DOUBLE
#define H5_FLOAT32_T H5T_NATIVE_FLOAT
#define H5_INT64_T H5T_NATIVE_INT64
#define H5_INT32_T H5T_NATIVE_INT32
#define H5_INT16_T H5T_NATIVE_INT16
#define H5_STRING_T H5T_NATIVE_CHAR
#define H5_COMPOUND_T H5T_COMPOUND
@@ -72,6 +77,10 @@ struct h5_file;
typedef struct h5_file h5_file_t;
typedef h5_file_t* h5_file_p;
struct h5t_mesh;
typedef struct h5t_mesh h5t_mesh_t;
typedef h5t_mesh_t* h5t_mesh_p;
typedef h5_err_t (*h5_errorhandler_t)(
const char*,
va_list ap );
+3 -3
View File
@@ -7,7 +7,7 @@ extern "C" {
h5_err_t
h5t_get_adjacencies (
h5_file_t * const f,
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
const h5_int32_t dim,
h5_loc_idlist_t **list
@@ -15,13 +15,13 @@ h5t_get_adjacencies (
h5_err_t
h5t_release_list_of_adjacencies (
h5_file_t * const f,
h5t_mesh_t* const m,
h5_loc_idlist_t **list
);
h5_err_t
h5t_find_te2 (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_loc_idx_t face_idx,
h5_loc_idx_t elem_idx,
h5_loc_idlist_t** retval
+4 -4
View File
@@ -17,24 +17,24 @@ h5t_get_num_trimeshes (
h5_ssize_t
h5t_get_num_leaf_levels (
h5_file_t * const f
h5t_mesh_t* const m
);
h5_ssize_t
h5t_get_num_elems (
h5_file_t * const f,
h5t_mesh_t* const m,
const h5_id_t cnode
);
h5_ssize_t
h5t_get_num_vertices (
h5_file_t * const f,
h5t_mesh_t* const m,
const h5_id_t cnode
);
h5t_lvl_idx_t
h5t_get_level (
h5_file_t * const f
h5t_mesh_t* const m
);
#ifdef __cplusplus
+13 -13
View File
@@ -7,13 +7,13 @@ extern "C" {
h5_loc_idx_t
h5t_map_global_vertex_idx2local (
h5_file_t* const f,
h5t_mesh_t* const m,
h5_glb_idx_t glb_idx
);
h5_err_t
h5t_map_global_vertex_indices2local (
h5_file_t* f,
h5t_mesh_t* f,
const h5_glb_id_t* const glb_indices,
const h5_size_t size,
h5_loc_idx_t* const loc_indices
@@ -21,13 +21,13 @@ h5t_map_global_vertex_indices2local (
h5_loc_idx_t
h5t_map_glb_elem_idx2loc (
h5_file_t * const f,
h5t_mesh_t* const m,
const h5_glb_idx_t glb_idx
);
h5_err_t
h5t_map_glb_elem_indices2loc (
h5_file_t * const f,
h5t_mesh_t* const m,
const h5_glb_idx_t* glb_indices,
const h5_size_t size,
h5_loc_idx_t* loc_indices
@@ -35,14 +35,14 @@ h5t_map_glb_elem_indices2loc (
h5_err_t
h5t_get_vertex_index_of_vertex (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_index
);
h5_err_t
h5t_get_vertex_index_of_vertex2 (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_idx_t face_idx,
const h5_loc_idx_t elem_idx,
h5_loc_idx_t* vertex_indices
@@ -50,14 +50,14 @@ h5t_get_vertex_index_of_vertex2 (
h5_err_t
h5t_get_vertex_indices_of_edge (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
h5_loc_idx_t *vertex_indices
);
h5_err_t
h5t_get_vertex_indices_of_edge2 (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_idx_t face_idx,
const h5_loc_idx_t elem_id,
h5_loc_idx_t* vertex_indices
@@ -65,14 +65,14 @@ h5t_get_vertex_indices_of_edge2 (
h5_err_t
h5t_get_vertex_indices_of_triangle (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_indices
);
h5_err_t
h5t_get_vertex_indices_of_triangle2 (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_idx_t face_idx,
const h5_loc_idx_t elem_idx,
h5_loc_idx_t* vertex_indices
@@ -80,21 +80,21 @@ h5t_get_vertex_indices_of_triangle2 (
h5_err_t
h5t_get_vertex_indices_of_tet (
h5_file_t* const f,
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
h5_loc_idx_t *vertex_indices
);
h5_err_t
h5t_get_vertex_indices_of_entity (
h5_file_t * const f,
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
h5_loc_idx_t *vertex_indices
);
h5_err_t
h5t_get_vertex_indices_of_entity2 (
h5_file_t* const f,
h5t_mesh_t* const m,
const int dim,
const h5_loc_idx_t face_idx,
const h5_loc_idx_t elem_idx,
+10 -23
View File
@@ -5,33 +5,20 @@
extern "C" {
#endif
h5_err_t h5t_open_tetrahedral_mesh (
h5_file_t * const f,
const h5_id_t id
);
h5_err_t h5t_open_tetrahedral_mesh (h5_file_t* const, const char*, h5t_mesh_t**);
h5_err_t h5t_open_tetrahedral_mesh_by_idx (h5_file_t* const, const h5_id_t, h5t_mesh_t**);
h5_err_t h5t_open_triangle_mesh (
h5_file_t * const f,
const h5_id_t id
);
h5_err_t h5t_open_triangle_mesh (h5_file_t* const, const char*, h5t_mesh_t**);
h5_err_t h5t_open_triangle_mesh_by_idx (h5_file_t* const, const h5_id_t, h5t_mesh_t**);
h5_id_t
h5t_add_tetrahedral_mesh (
h5_file_t * const f
);
h5_id_t
h5t_add_triangle_mesh (
h5_file_t * const f
);
h5_id_t h5t_add_tetrahedral_mesh (h5_file_t* const, const char* name, h5t_mesh_t**);
h5_err_t h5t_set_level (
h5_file_t * const f,
const h5t_lvl_idx_t id
);
h5_err_t h5t_close_mesh (
h5_file_t * const f
);
h5_id_t h5t_add_triangle_mesh (h5_file_t* const, const char*, h5t_mesh_t**);
h5_err_t h5t_set_level (h5t_mesh_t* const, const h5t_lvl_idx_t);
h5_err_t h5t_close_mesh (h5t_mesh_t* const);
#ifdef __cplusplus
}
+18 -45
View File
@@ -9,29 +9,31 @@ struct h5t_tagset;
union h5t_iterator;
typedef struct {
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
h5t_mesh_t* mesh;
h5_loc_id_t (*iter)(union h5t_iterator*);
h5t_lvl_idx_t leaf_level;
const h5t_ref_elem_t* ref_elem;
h5_loc_idx_t elem_idx;
h5_loc_idx_t face_idx; // face according reference element
int codim; // dimension of entities to traverse
h5_err_t (*find)(h5_file_t *const f, h5_loc_id_t face_idx,
h5_loc_id_t elem_idx, h5_loc_idlist_t **retval);
h5_err_t (*find)(h5t_mesh_t *const, h5_loc_id_t, h5_loc_id_t, h5_loc_idlist_t**);
} h5t_leaf_iterator_t;
typedef struct {
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
h5t_mesh_t* mesh;
h5_loc_id_t (*iter)(union h5t_iterator* iter);
h5t_lvl_idx_t refinement_level;
const h5t_ref_elem_t* ref_elem;
h5_loc_idx_t elem_idx;
h5_loc_idx_t face_idx; // face according reference element
int codim; // dimension of entities to traverse
h5_err_t (*find)(h5_file_t *const f, h5_loc_id_t face_idx,
h5_err_t (*find)(h5t_mesh_t *const f, h5_loc_id_t face_idx,
h5_loc_id_t elem_idx, h5_loc_idlist_t **retval);
} h5t_level_iterator_t;
typedef struct {
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
h5t_mesh_t* mesh;
h5_loc_id_t (*iter)(union h5t_iterator* iter);
h5t_lvl_idx_t level_idx;
struct h5t_tagset* tagset;
h5_loc_idx_t elem_idx;
@@ -39,7 +41,8 @@ typedef struct {
} h5t_tag_iterator_t;
typedef struct h5t_generic_iterator {
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
h5t_mesh_t* mesh;
h5_loc_id_t (*iter)(union h5t_iterator* iter);
} h5t_generic_iterator_t;
typedef union h5t_iterator {
@@ -52,58 +55,28 @@ typedef union h5t_iterator {
typedef h5t_iterator_t* h5t_iterator_p;
h5_err_t
h5t_init_leaf_iterator (
h5_file_t* f,
h5t_iterator_t* iter,
const int codim
);
h5t_init_leaf_iterator (h5t_iterator_t*, h5t_mesh_t*, const int);
h5_err_t
h5t_init_boundary_face_iterator (
h5_file_t* f,
h5t_iterator_t* iter,
const int codim
);
h5t_init_boundary_face_iterator (h5t_iterator_t*, h5t_mesh_t*, const int);
h5_err_t
h5t_init_mtag_iterator (
h5_file_t* f,
h5t_iterator_t* iter,
const char* name
);
h5t_init_mtag_iterator (h5t_iterator_t*, h5t_mesh_t*, const char*);
h5_err_t
h5t_release_entity_iterator (
h5_file_t* const f,
h5t_iterator_t* iter
);
h5t_release_entity_iterator (h5t_iterator_t*);
h5_loc_id_t
h5t_iterate_entities (
h5_file_t * const f,
h5t_iterator_t *iter
);
h5t_iterate_entities (h5t_iterator_t*);
h5_err_t
h5t_end_iterate_entities (
h5_file_t * const f,
h5t_iterator_t *iter
);
h5t_end_iterate_entities (h5t_iterator_t*);
h5_err_t
h5t_get_vertex_coords_by_index (
h5_file_t* const f,
h5_loc_idx_t vertex_idx,
h5_float64_t P[3]
);
h5t_get_vertex_coords_by_index (h5t_mesh_t* const, h5_loc_idx_t, h5_float64_t[3]);
h5_err_t
h5t_get_vertex_coords_by_id (
h5_file_t* const f,
h5_loc_id_t vertex_id,
h5_float64_t P[3]
);
h5t_get_vertex_coords_by_id (h5t_mesh_t* const, h5_loc_id_t, h5_float64_t[3]);
#ifdef __cplusplus
}
+14 -49
View File
@@ -6,81 +6,46 @@ extern "C" {
#endif
h5t_lvl_idx_t
h5t_add_level (
h5_file_t * const f
);
h5t_add_level (h5t_mesh_t* const);
h5_err_t
h5t_begin_store_vertices (
h5_file_t * const f,
const h5_size_t num
);
h5t_begin_store_vertices (h5t_mesh_t* const, const h5_size_t);
h5_loc_id_t
h5t_store_vertex (
h5_file_t * const f,
const h5_glb_id_t glb_id,
const h5_float64_t P[3]
);
h5t_store_vertex (h5t_mesh_t* const, const h5_glb_id_t, const h5_float64_t[3]);
h5_err_t
h5t_end_store_vertices (
h5_file_t * const f
);
h5t_end_store_vertices (h5t_mesh_t* const);
h5_err_t
h5t_begin_store_elems (
h5_file_t * const f,
const h5_size_t num
);
h5t_begin_store_elems (h5t_mesh_t* const, const h5_size_t);
h5_loc_idx_t
h5t_store_elem (
h5_file_t * const f,
const h5_loc_idx_t parent_idx,
const h5_loc_idx_t* vertex_indices
);
h5t_store_elem (h5t_mesh_t* const, const h5_loc_idx_t, const h5_loc_idx_t*);
h5_err_t
h5t_end_store_elems (
h5_file_t * const f
);
h5t_end_store_elems (h5t_mesh_t* const);
h5_err_t
h5t_begin_refine_elems (
h5_file_t * const f
);
h5t_begin_refine_elems (h5t_mesh_t* const);
h5_err_t
h5t_refine_marked_elems (
h5_file_t * const f
);
h5t_refine_marked_elems (h5t_mesh_t* const);
h5_err_t
h5t_end_refine_elems (
h5_file_t * const f
);
h5t_end_refine_elems (h5t_mesh_t* const);
h5_err_t
h5t_mark_entity (
h5_file_t* const f,
const h5_loc_id_t entity_id
);
h5t_mark_entity (h5t_mesh_t* const, const h5_loc_id_t);
h5_err_t
h5t_pre_refine (
h5_file_t* const f
);
h5t_pre_refine (h5t_mesh_t* const);
h5_err_t
h5t_refine (
h5_file_t* const f
);
h5t_refine (h5t_mesh_t* const);
h5_err_t
h5t_post_refine (
h5_file_t* const f
);
h5t_post_refine (h5t_mesh_t* const);
#ifdef __cplusplus
}
+20 -82
View File
@@ -8,98 +8,36 @@ extern "C" {
typedef struct h5t_tagset h5t_tagset_t;
typedef struct h5t_tagcontainer h5t_tagcontainer_t;
h5_err_t
h5t_mtagset_exists (
h5_file_t* const f,
h5t_tagcontainer_t* ctn,
char* name
);
h5_err_t
h5t_add_mtagset (
h5_file_t* const f,
char name[],
h5_id_t type
);
h5_err_t
h5t_remove_mtagset (
h5_file_t* const f,
const char name[]
);
h5_err_t
h5t_open_mtagset (
h5_file_t* const f,
const char *name,
h5t_tagset_t** retval
);
h5_ssize_t
h5t_get_num_mtagsets (
h5_file_t* const f
);
h5_ssize_t
h5t_get_mtagsets (
h5_file_t* const f,
char** names[]
);
h5_err_t
h5t_get_mtagset_info (
h5_file_t* const f,
const h5_id_t idx,
char** names,
h5_id_t* type
);
h5_id_t
h5t_get_mtagset_type_by_name (
h5_file_t* const f,
char name[]
);
h5t_get_num_mtagsets (h5t_mesh_t* const);
h5_err_t
h5t_set_mtag_by_name (
h5_file_t* const f,
char name[],
const h5_loc_id_t entity_id,
const size_t dim,
void* value
);
h5t_get_mtagset_info (h5t_mesh_t* const, const h5_size_t, char[],
const h5_size_t, h5_int64_t* const);
h5_err_t
h5t_get_mtag_by_name (
h5_file_t* const f,
const char name[],
const h5_loc_id_t entity_id,
size_t* dim,
void* vals );
h5t_mtagset_exists (h5t_mesh_t* const, const char* const);
h5_err_t
h5t_remove_mtag_by_name (
h5_file_t* const f,
const char name[],
const h5_loc_id_t entity_id
);
h5_ssize_t
h5t_get_tag (
h5_file_t *const f,
const h5t_tagset_t *tagset,
const h5_loc_id_t entity_id,
size_t* const dim,
void* const vals
);
h5t_create_mtagset (h5t_mesh_t* const, const char[], const h5_id_t, h5t_tagset_t**);
h5_err_t
h5t_remove_mtag (
h5_file_t* const f,
h5t_tagset_t* tagset,
const h5_loc_id_t entity_id
);
h5t_open_mtagset (h5t_mesh_t* const, const char* const, h5t_tagset_t**);
h5_ssize_t
h5t_get_mtagset_names_of_entity (
h5_file_t* const f,
const h5_loc_id_t entity_id,
char *names[],
const h5_size_t dim
);
h5_err_t
h5t_close_mtagset (h5t_tagset_t*);
h5_err_t
h5t_remove_mtagset (h5t_mesh_t* const, const char[]);
h5_err_t
h5t_set_tag (h5t_tagset_t* const, const h5_loc_id_t, const h5_size_t, void*);
h5_loc_id_t
h5t_get_tag (const h5t_tagset_t*, const h5_loc_id_t, h5_size_t* const, void* const);
h5_err_t
h5t_remove_tag (h5t_tagset_t*, const h5_loc_id_t);
#ifdef __cplusplus
}