refactoring and triangle meshes
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_core.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
@@ -120,8 +120,8 @@ h5_err_t
|
||||
H5GetStepNameFormat (
|
||||
h5_file *f, /*!< Handle to file */
|
||||
char *name, /*!< OUT: Prefix */
|
||||
h5_int64_t *l_name, /*!< length of buffer name */
|
||||
h5_int64_t *width /*!< OUT: Width of the number */
|
||||
const h5_size_t l_name, /*!< length of buffer name */
|
||||
h5_size_t *width /*!< OUT: Width of the number */
|
||||
) {
|
||||
SET_FNAME ( "H5PartDefineStepNameFormat" );
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ h5_err_t
|
||||
H5GetStepNameFormat (
|
||||
h5_file *f,
|
||||
char *name,
|
||||
h5_int64_t *l_name,
|
||||
h5_int64_t *width
|
||||
const h5_size_t l_name,
|
||||
h5_size_t *width
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
|
||||
+9
-7
@@ -15,32 +15,34 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_core.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
h5_err_t
|
||||
H5FedOpenMesh (
|
||||
h5_file * f,
|
||||
const h5_id_t id
|
||||
const h5_id_t id,
|
||||
const enum h5_mesh_types type
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_open_mesh ( f, id );
|
||||
return h5t_open_mesh ( f, id, type );
|
||||
}
|
||||
|
||||
h5_id_t
|
||||
H5FedAddMesh (
|
||||
h5_file * f
|
||||
h5_file * f,
|
||||
const enum h5_mesh_types type
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_open_mesh ( f, -1 );
|
||||
return h5t_open_mesh ( f, -1, type );
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedSetRefinementLevel (
|
||||
H5FedSetLevel (
|
||||
h5_file * f,
|
||||
const h5_id_t id
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_open_level ( f, id );
|
||||
return h5t_open_level ( f, id );
|
||||
}
|
||||
|
||||
+77
-402
@@ -25,123 +25,111 @@
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumMeshes (
|
||||
h5_file * f /*!< file handle */
|
||||
h5_file * f,
|
||||
const enum h5_mesh_types type
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedOpenMesh (
|
||||
h5_file * f,
|
||||
const h5_id_t id
|
||||
const h5_id_t id,
|
||||
const enum h5_mesh_types type
|
||||
);
|
||||
h5_id_t
|
||||
H5FedAddMesh (
|
||||
h5_file * fh
|
||||
h5_file * f,
|
||||
const enum h5_mesh_types type
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumRefinementLevels (
|
||||
h5_file * f /*!< file handle */
|
||||
H5FedGetNumLevels (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedSetRefinementLevel (
|
||||
H5FedSetLevel (
|
||||
h5_file * f,
|
||||
const h5_id_t id
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedAddRefinementLevel (
|
||||
h5_file * fh
|
||||
H5FedGetLevel (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedSetAdditionalNumVerticesToStore (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_size_t num /*!< number of additional vertices */
|
||||
h5_id_t
|
||||
H5FedAddLevel (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedAddNumVertices (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedAddNumEntities (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
/****** INQUIRY routines *****************************************************/
|
||||
|
||||
h5_int_t H5GetNumNodes (
|
||||
h5_file * fh
|
||||
h5_size_t
|
||||
H5GetNumNodes (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_int_t H5FedGetNumMeshLevels (
|
||||
h5_file * fh
|
||||
);
|
||||
|
||||
h5_int_t H5FedHasTetrahedralMesh (
|
||||
h5_file * fh,
|
||||
const h5_id_t level
|
||||
);
|
||||
|
||||
h5_int_t H5FedHasBoundaryMesh(
|
||||
h5_file * fh,
|
||||
const h5_id_t level
|
||||
);
|
||||
|
||||
/****** VERTEX statistics routines *******************************************/
|
||||
|
||||
h5_size_t H5FedGetNumVerticesTotal(
|
||||
h5_file * fh,
|
||||
const h5_id_t level
|
||||
h5_size_t
|
||||
H5FedGetNumVertices (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumVerticesCnode (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t cnode
|
||||
h5_size_t
|
||||
H5FedGetNumVerticesTotal(
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
/****** EDGE statistics routines ********************************************/
|
||||
|
||||
h5_size_t H5FedGetNumEdgesTotal (
|
||||
h5_file * fh,
|
||||
const h5_id_t level
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumEdgesCnode (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
h5_size_t
|
||||
H5FedGetNumVerticesCnode (
|
||||
h5_file * f,
|
||||
const h5_id_t cnode
|
||||
);
|
||||
|
||||
/****** TRIANGLE statistics routines *****************************************/
|
||||
|
||||
h5_size_t H5FedGetNumTrianglesTotal (
|
||||
h5_file * fh,
|
||||
const h5_id_t level
|
||||
h5_size_t
|
||||
H5FedGetNumTriangles (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumTrianglesCnode (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
h5_size_t
|
||||
H5FedGetNumTrianglesTotal (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumTrianglesCnode (
|
||||
h5_file * f,
|
||||
const h5_id_t cnode
|
||||
);
|
||||
|
||||
/****** TETRAHEDRON statistics routines **************************************/
|
||||
|
||||
h5_size_t H5FedGetNumTetrahedraTotal(
|
||||
h5_file * fh,
|
||||
const h5_id_t level
|
||||
h5_size_t
|
||||
H5FedGetNumTetrahedra (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumTetrahedraCnode (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t cnode
|
||||
h5_size_t
|
||||
H5FedGetNumTetrahedraTotal (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
/****** BOUNDARY statistics routines ****************************************/
|
||||
|
||||
h5_size_t H5FedGetNumBoundaryTrianglesTotal (
|
||||
h5_file * fh,
|
||||
const h5_id_t level
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumBoundaryTrianglesCnode (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
h5_size_t
|
||||
H5FedGetNumTetrahedraCnode (
|
||||
h5_file * f,
|
||||
const h5_id_t cnode
|
||||
);
|
||||
|
||||
@@ -149,17 +137,6 @@ h5_size_t H5FedGetNumBoundaryTrianglesCnode (
|
||||
|
||||
|
||||
/* vertices */
|
||||
h5_size_t
|
||||
H5FedSetNumVertices (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumVertices (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedStoreVertex (
|
||||
h5_file * f,
|
||||
@@ -167,110 +144,46 @@ H5FedStoreVertex (
|
||||
const h5_float64_t P[3]
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedStartTraverseVertices (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedGetVertex (
|
||||
H5FedTraverseVertices (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_float64_t P[3]
|
||||
);
|
||||
|
||||
/* edges */
|
||||
h5_size_t
|
||||
H5FedSetNumEdges (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumEdges (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedStoreEdge (
|
||||
h5_file * f,
|
||||
const h5_id_t id,
|
||||
const h5_id_t parent_id,
|
||||
const h5_id_t vertex_ids[2]
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedGetEdge (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_id_t * const parent_id,
|
||||
h5_id_t * const vertex_ids[2]
|
||||
);
|
||||
|
||||
/* triangles */
|
||||
h5_size_t
|
||||
H5FedSetNumTriangles (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumTriangles (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_int_t
|
||||
h5_id_t
|
||||
H5FedStoreTriangle (
|
||||
h5_file * f,
|
||||
const h5_id_t id,
|
||||
const h5_id_t parent_id,
|
||||
const h5_id_t vertex_ids[3]
|
||||
h5_id_t vertex_ids[3]
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedGetTriangle (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_id_t * const parent_id,
|
||||
h5_id_t * const vertex_ids[2]
|
||||
);
|
||||
|
||||
/* boundary triangles */
|
||||
h5_size_t
|
||||
H5FedSetNumBoundaryTriangles (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumBoundaryTriangles (
|
||||
h5_err_t
|
||||
H5FedStartTraverseTriangles (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
|
||||
h5_id_t
|
||||
H5FedStoreBoundaryTriangle (
|
||||
h5_file * fh,
|
||||
const h5_id_t id,
|
||||
const h5_id_t parent_id,
|
||||
const h5_id_t vertex_ids[3]
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedGetBoundaryTriangle (
|
||||
H5FedTraverseTriangles (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_id_t * const parent_id,
|
||||
h5_id_t * const vertex_ids[3]
|
||||
h5_id_t vertex_ids[3]
|
||||
);
|
||||
|
||||
/* tetrahedra */
|
||||
h5_size_t
|
||||
H5FedSetAdditionalNumTetrahedraToStore (
|
||||
h5_file * f,
|
||||
const h5_size_t num_tet
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumTetrahedra (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedStoreTetrahedron (
|
||||
h5_file * f,
|
||||
@@ -279,257 +192,19 @@ H5FedStoreTetrahedron (
|
||||
const h5_id_t vertex_ids[4]
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedStartTraverseTetrahedra (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5FedGetTetrahedron (
|
||||
H5FedTraverseTetrahedra (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_id_t * parent_id,
|
||||
h5_id_t * const parent_id,
|
||||
h5_id_t vertex_ids[4]
|
||||
);
|
||||
|
||||
/****** UPWARD ADJACENCY routines *********************************************/
|
||||
|
||||
h5_id_t * H5FedGetEdgesUAdjacentToVertex (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t vertex_id,
|
||||
h5_size_t * const num_adj_edges
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetTrianglesUAdjacentToVertex (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t vertex_id,
|
||||
h5_size_t * const num_adj_triangles
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetTetrahedrasUAdjacentToVertex (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t vertex_id,
|
||||
h5_size_t * const num_adj_tetrahedra
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetTrianglesUAdjacentToEdge (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t edge_id,
|
||||
h5_size_t * const num_adj_triangles
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetTetrahedraUAdjacentToEdge (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t edge_id,
|
||||
h5_size_t * const num_adj_tets
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetTetrahedraUAdjacentToTriangle (
|
||||
h5_file * fh,
|
||||
const h5_int_t level,
|
||||
const h5_int_t triangle_id,
|
||||
h5_size_t * const num_adj_tets
|
||||
);
|
||||
|
||||
/****** DOWNWARD ADJACENCY routines *********************************************/
|
||||
|
||||
h5_id_t * H5FedGetVerticesDAdjacentToEdge (
|
||||
h5_file * fh,
|
||||
const h5_int_t level,
|
||||
const h5_int_t edge_id,
|
||||
h5_size_t * const num_adj_vertices
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetEdjesDAdjacentToTriangle (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t triangle_id,
|
||||
h5_size_t * const num_adj_triangles
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetVerticesDAdjacentToTriangle (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t triangle_id,
|
||||
h5_size_t * const num_adj_vertices
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetTrianglesDAdjacentToTetrahedron (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t tet_id,
|
||||
h5_size_t * const num_adj_triangles
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetEdjesDAdjacentToTetrahedron (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t tet_id,
|
||||
h5_size_t * const num_adj_edges
|
||||
);
|
||||
|
||||
h5_id_t * H5FedGetVerticesDAdjacentToTetrahedron (
|
||||
h5_file * fh,
|
||||
const h5_id_t level,
|
||||
const h5_id_t tet_id,
|
||||
h5_size_t * const num_adj_vertices
|
||||
);
|
||||
|
||||
/****** routines for accessing degrees of freedom DoF *************************/
|
||||
|
||||
/* DoF acces for vertices */
|
||||
|
||||
h5_int_t H5FedStoreDoFVertexFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t vertex_id,
|
||||
const h5_float_t * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_int_t H5FedStoreDoFVertexComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t vertex_id,
|
||||
const h5_complex * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_float_t * H5FedGetDoFVertexFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t vertex_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_complex * H5FedGetDoFVertexComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t vertex_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFVertexFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t vertex_id
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFVertexComplex (
|
||||
h5_file * fh,
|
||||
const h5_size_t vertex_id
|
||||
);
|
||||
|
||||
/* DoF access for edges */
|
||||
|
||||
h5_int_t H5FedStoreDoFEdgeFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t edge_id,
|
||||
const h5_float_t * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_int_t H5FedStoreDoFEdgeComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t edge_id,
|
||||
const h5_complex * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_float_t * H5FedGetDoFEdgeFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t edge_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_complex* H5FedGetDoFEdgeComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t edge_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFEdgeFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t edge_id
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFEdgeComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t edge_id
|
||||
);
|
||||
|
||||
|
||||
/* DoF access for triangles */
|
||||
|
||||
h5_int_t H5FedStoreDoFTriangleFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t triangle_id,
|
||||
const h5_float_t * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_int_t H5FedStoreDoFTriangleComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t triangle_id,
|
||||
const h5_complex * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_float_t * H5FedGetDoFTriangleFloat (
|
||||
h5_file* fh,
|
||||
const h5_id_t triangle_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_complex * H5FedGetDoFTriangleComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t triangle_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFTriangleFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t triangle_id
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFTriangleComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t triangle_id
|
||||
);
|
||||
|
||||
/* DoF access for tetrahedra */
|
||||
|
||||
h5_int_t H5FedStoreDoFTetrahedronFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t tet_id,
|
||||
const h5_float_t * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_int_t H5FedStoreDoFTetrahedronComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t tet_id,
|
||||
const h5_complex * const dof,
|
||||
const h5_size_t dof_size
|
||||
);
|
||||
|
||||
h5_float_t * H5FedGetDoFTetrahedronFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t tet_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_complex * H5FedGetDoFTetrahedronComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t tet_id,
|
||||
h5_size_t * const dof_size
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFTetrahedronFloat (
|
||||
h5_file * fh,
|
||||
const h5_id_t tet_id
|
||||
);
|
||||
|
||||
h5_size_t H5FedGetNumDoFTetrahedronComplex (
|
||||
h5_file * fh,
|
||||
const h5_id_t tet_id
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
+49
-128
@@ -19,50 +19,17 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_core.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Check whether a tetrahedral mesh hierarchy exists on level \c level
|
||||
|
||||
\return \c 1 tetrahedral mesh hierarchy exists on given level.
|
||||
\return \c 0 tetrahedral mesh exists, but not on given level.
|
||||
\return \c -1 tetrahedral mesh doesn't exist
|
||||
*/
|
||||
h5_int_t H5FedHasTetrahedralMesh (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to check */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Check whether a triangle mesh hierarchy exists on level \c level
|
||||
|
||||
\return \c 1 boundary mesh hierarchy exists on given level.
|
||||
\return \c 0 boundary mesh hierarchy exists, but not on given level.
|
||||
\return \c -1 boundary mesh doesn't exist.
|
||||
*/
|
||||
h5_int_t H5FedHasTriangleMesh(
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to check */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return -1;
|
||||
}
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumMeshes (
|
||||
h5_file * f /*!< file handle */
|
||||
h5_file * f, /*!< file handle */
|
||||
const enum h5_mesh_types type
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_meshes ( f );
|
||||
return h5t_get_num_meshes ( f, type );
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -74,11 +41,27 @@ H5FedGetNumMeshes (
|
||||
\return \c -1 on error
|
||||
*/
|
||||
h5_size_t
|
||||
H5FedGetNumRefinementLevels (
|
||||
h5_file * f /*!< file handle */
|
||||
H5FedGetNumLevels (
|
||||
h5_file * fh /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_levels ( f );
|
||||
return h5t_get_num_levels ( fh );
|
||||
}
|
||||
|
||||
h5_id_t
|
||||
H5FedGetLevel (
|
||||
h5_file * fh /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_get_level ( fh );
|
||||
}
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumVertices (
|
||||
h5_file * fh /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_get_num_vertices ( fh );
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -90,11 +73,12 @@ H5FedGetNumRefinementLevels (
|
||||
\return number of vertices
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumVerticesTotal(
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
h5_size_t
|
||||
H5FedGetNumVerticesTotal(
|
||||
h5_file * fh /*!< file handle */
|
||||
) {
|
||||
return -1;
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_get_num_vertices ( fh );
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -108,60 +92,6 @@ q \return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumVerticesCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Get the number of vertices used for defining a submesh
|
||||
at level \c level for this compute node in current step.
|
||||
|
||||
\return number of vertices
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t
|
||||
H5FedGetNumVertices (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_vertices ( f );
|
||||
}
|
||||
|
||||
/****** EDGE statistics routines ********************************************/
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Returns the number of edges present in the mesh at level \c level,
|
||||
in current step, summed up over all compute nodes
|
||||
|
||||
\return number of edges
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumEdgesTotal (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Returns the number of edges present in the mesh at level \c level
|
||||
on compute node \c cnode
|
||||
|
||||
\return number of edges
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumEdgesCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
) {
|
||||
return -1;
|
||||
@@ -169,6 +99,13 @@ h5_size_t H5FedGetNumEdgesCnode (
|
||||
|
||||
/****** TRIANGLE statistics routines *****************************************/
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumTriangles (
|
||||
h5_file * fh /*!< file handle */
|
||||
) {
|
||||
return h5t_get_num_entities ( fh );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
@@ -178,13 +115,14 @@ h5_size_t H5FedGetNumEdgesCnode (
|
||||
\return Number of triangles
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumTrianglesTotal (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
h5_size_t
|
||||
H5FedGetNumTrianglesTotal (
|
||||
h5_file * fh /*!< file handle */
|
||||
) {
|
||||
return -1;
|
||||
return h5t_get_num_entities ( fh );
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
@@ -194,10 +132,10 @@ h5_size_t H5FedGetNumTrianglesTotal (
|
||||
\return Number of triangles
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumTrianglesCnode (
|
||||
h5_size_t
|
||||
H5FedGetNumTrianglesCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
const h5_id_t cnode /*!< compute node to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
@@ -213,11 +151,12 @@ h5_size_t H5FedGetNumTrianglesCnode (
|
||||
\return number of tetrahedra
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumTetrahedraTotal(
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
h5_size_t
|
||||
H5FedGetNumTetrahedraTotal(
|
||||
h5_file * fh /*!< file handle */
|
||||
) {
|
||||
return -1;
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_get_num_entities ( fh );
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -231,29 +170,11 @@ h5_size_t H5FedGetNumTetrahedraTotal(
|
||||
*/
|
||||
h5_size_t H5FedGetNumTetrahedraCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Returns the number of tetrahedral elements present in the mesh at
|
||||
level \c level in current step on this compute node.
|
||||
|
||||
\return number of tetrahedra
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t
|
||||
H5FedGetNumTetrahedra (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_tets ( f );
|
||||
}
|
||||
|
||||
|
||||
/****** BOUNDARY statistics routines ****************************************/
|
||||
|
||||
|
||||
+49
-8
@@ -16,10 +16,18 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_core.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
h5_err_t
|
||||
H5FedStartTraverseVertices (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_start_traverse_vertices ( f );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
@@ -29,16 +37,48 @@
|
||||
\return error code (H5_ERR_NOENT means no more vertices on this level)
|
||||
|
||||
*/
|
||||
h5_id_t
|
||||
H5FedGetVertex (
|
||||
h5_err_t
|
||||
H5FedTraverseVertices (
|
||||
h5_file * f, /*!< file handle */
|
||||
h5_id_t * const id, /*!< OUT: global id */
|
||||
h5_float64_t P[3] /*!< OUT: coordinates */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_vertex ( f, id, P );
|
||||
return h5t_traverse_vertices ( f, id, P );
|
||||
}
|
||||
|
||||
|
||||
|
||||
h5_err_t
|
||||
H5FedStartTraverseTriangles (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_start_traverse_triangles ( f );
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedTraverseTriangles (
|
||||
h5_file * f, /*!< file handle */
|
||||
h5_id_t * const id, /*!< OUT: global tetrahedron id */
|
||||
h5_id_t * const parent_id, /*!< OUT: parent id if level
|
||||
\c >0 else \c -1 */
|
||||
h5_id_t vertex_ids[3] /*!< OUT: vertex id's */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_traverse_triangles ( f, id, parent_id, vertex_ids );
|
||||
}
|
||||
|
||||
|
||||
h5_err_t
|
||||
H5FedStartTraverseTetrahedra (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_start_traverse_tets ( f );
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
@@ -49,15 +89,16 @@ H5FedGetVertex (
|
||||
\return pointer to 4-tuple of vertex id's defining the tetrahedron.
|
||||
\return NULL-pointer on error.
|
||||
*/
|
||||
h5_id_t
|
||||
H5FedGetTetrahedron (
|
||||
h5_err_t
|
||||
H5FedTraverseTetrahedra (
|
||||
h5_file * f, /*!< file handle */
|
||||
h5_id_t * const id, /*!< OUT: global tetrahedron id */
|
||||
h5_id_t * parent_id, /*!< OUT: parent id if level
|
||||
h5_id_t * const parent_id, /*!< OUT: parent id if level
|
||||
\c >0 else \c -1 */
|
||||
h5_id_t vertex_ids[4] /*!< OUT: vertex id's */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_tet ( f, id, parent_id, vertex_ids );
|
||||
return h5t_traverse_tets ( f, id, parent_id, vertex_ids );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+26
-15
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_core.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
@@ -32,16 +32,16 @@
|
||||
\note
|
||||
write new level:
|
||||
H5FedAddLevel( f );
|
||||
H5FedSetNumVertices( f, nv );
|
||||
H5FedSetNumTetrahedra( f, nt );
|
||||
H5FedAddNumVertices( f, nv );
|
||||
H5FedAddNumEntities( f, ne );
|
||||
*/
|
||||
|
||||
h5_id_t
|
||||
H5FedAddRefinementLevel (
|
||||
H5FedAddLevel (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_add_level ( f );
|
||||
return h5t_add_level ( f );
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -59,15 +59,14 @@ H5FedAddRefinementLevel (
|
||||
\return number of vertices
|
||||
\return errno on error
|
||||
*/
|
||||
|
||||
h5_size_t
|
||||
H5FedSetAdditionalNumVerticesToStore (
|
||||
h5_err_t
|
||||
H5FedAddNumVertices (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_size_t num /*!< number of additional vertices */
|
||||
) {
|
||||
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_add_num_vertices ( f, num );
|
||||
return h5t_add_num_vertices ( f, num );
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -87,20 +86,20 @@ H5FedStoreVertex (
|
||||
) {
|
||||
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_store_vertex ( f, id, P );
|
||||
return h5t_store_vertex ( f, id, P );
|
||||
}
|
||||
|
||||
/*** T E T R A H E D R A ****************************************************/
|
||||
|
||||
h5_size_t
|
||||
H5FedSetAdditionalNumTetrahedraToStore (
|
||||
h5_err_t
|
||||
H5FedAddNumEntities (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_size_t num /*!< number of additional
|
||||
tetrahedra at level \c level */
|
||||
entities on current level */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
|
||||
return H5t_add_num_tets ( f, num );
|
||||
return h5t_add_num_entities ( f, num );
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -126,5 +125,17 @@ H5FedStoreTetrahedron (
|
||||
const h5_id_t vertex_ids[4] /*!< tuple with vertex id's */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_store_tet ( f, id, parent_id, vertex_ids );
|
||||
return h5t_store_tet ( f, id, parent_id, vertex_ids );
|
||||
}
|
||||
|
||||
h5_id_t
|
||||
H5FedStoreTriangle (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_id_t id, /*!< global tetrahedron id */
|
||||
const h5_id_t parent_id, /*!< global parent id
|
||||
if level \c >0 else \c -1 */
|
||||
h5_id_t vertex_ids[3] /*!< tuple with vertex id's */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return h5t_store_triangle ( f, id, parent_id, vertex_ids );
|
||||
}
|
||||
|
||||
+3
-3
@@ -31,12 +31,12 @@
|
||||
\return Number of compute notes.
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_int_t
|
||||
h5_size_t
|
||||
H5GetNumNodes (
|
||||
h5_file * fh /*!< file handle */
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return (h5_int_t)fh->nprocs;
|
||||
return (h5_size_t)fh->nprocs;
|
||||
}
|
||||
|
||||
/*`
|
||||
|
||||
+14
-14
@@ -11,32 +11,32 @@
|
||||
#include "H5Part.h"
|
||||
|
||||
h5_error_handler _err_handler = h5_report_errorhandler;
|
||||
h5_int64_t _h5part_errno = H5PART_SUCCESS;
|
||||
h5_int64_t _debug = 0;
|
||||
h5_err_t _h5part_errno = H5PART_SUCCESS;
|
||||
h5_id_t _debug = 0;
|
||||
|
||||
static char *__funcname = "NONE";
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_set_debuglevel (
|
||||
h5part_int64_t level
|
||||
h5_id_t level
|
||||
) {
|
||||
_debug = level;
|
||||
return H5PART_SUCCESS;
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_get_debuglevel (
|
||||
void
|
||||
) {
|
||||
return _debug;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_set_errorhandler (
|
||||
h5part_error_handler handler
|
||||
h5_error_handler handler
|
||||
) {
|
||||
_err_handler = handler;
|
||||
return H5PART_SUCCESS;
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
h5part_error_handler
|
||||
@@ -46,7 +46,7 @@ h5_get_errorhandler (
|
||||
return _err_handler;
|
||||
}
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_get_errno (
|
||||
void
|
||||
) {
|
||||
@@ -62,10 +62,10 @@ h5_get_errno (
|
||||
|
||||
\return value given in \c eno
|
||||
*/
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_report_errorhandler (
|
||||
const char *funcname,
|
||||
const h5part_int64_t eno,
|
||||
const h5_err_t eno,
|
||||
const char *fmt,
|
||||
...
|
||||
) {
|
||||
@@ -86,10 +86,10 @@ h5_report_errorhandler (
|
||||
If an error occures, an error message will be printed and the
|
||||
program exists with the error code given in \c eno.
|
||||
*/
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_abort_errorhandler (
|
||||
const char *funcname,
|
||||
const h5part_int64_t eno,
|
||||
const h5_err_t eno,
|
||||
const char *fmt,
|
||||
...
|
||||
) {
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
#define h5_warn h5_print_warn
|
||||
#define h5_error h5_print_error
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_set_debuglevel (
|
||||
h5part_int64_t level
|
||||
h5_id_t level
|
||||
);
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_get_debuglevel (
|
||||
void
|
||||
);
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_set_errorhandler (
|
||||
h5part_error_handler handler
|
||||
);
|
||||
@@ -26,23 +26,23 @@ h5_get_errorhandler (
|
||||
void
|
||||
);
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_get_errno (
|
||||
void
|
||||
);
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_report_errorhandler (
|
||||
const char *funcname,
|
||||
const h5part_int64_t eno,
|
||||
const h5_err_t eno,
|
||||
const char *fmt,
|
||||
...
|
||||
);
|
||||
|
||||
h5part_int64_t
|
||||
h5_err_t
|
||||
h5_abort_errorhandler (
|
||||
const char *funcname,
|
||||
const h5part_int64_t eno,
|
||||
const h5_err_t eno,
|
||||
const char *fmt,
|
||||
...
|
||||
) ;
|
||||
|
||||
+2
-1
@@ -446,7 +446,8 @@ h5_err_t
|
||||
h5_get_stepname_fmt (
|
||||
h5_file * f,
|
||||
char *name,
|
||||
h5_int64_t *width
|
||||
const h5_size_t l_name,
|
||||
h5_size_t *width
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,14 @@ h5_define_stepname_fmt (
|
||||
const h5part_int64_t width
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5_get_stepname_fmt (
|
||||
h5_file *f,
|
||||
char *name,
|
||||
const h5_size_t l_name,
|
||||
h5_size_t *width
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
_h5_close_step (
|
||||
h5_file *f
|
||||
@@ -38,6 +46,11 @@ h5_has_step (
|
||||
h5_int64_t step
|
||||
);
|
||||
|
||||
h5_int64_t
|
||||
h5_get_step (
|
||||
h5_file *f
|
||||
);
|
||||
|
||||
#include "attribs.h"
|
||||
#include "errorhandling.h"
|
||||
#include "readwrite.h"
|
||||
|
||||
@@ -6,13 +6,6 @@
|
||||
#define H5B_CONTAINER_GRPNAME "Block"
|
||||
|
||||
#define H5T_CONTAINER_GRPNAME "Topo"
|
||||
#define H5T_COORD_GRPNAME "COORD"
|
||||
#define H5T_COORD3D_DSNAME "COORD3D"
|
||||
#define H5T_COORD3D_NUM_ELEMS_DSNAME "COORD3D_NUM_ELEMS"
|
||||
#define H5T_VMESH_GRPNAME "VOLUME_MESH"
|
||||
#define H5T_TETMESH_DSNAME "TETMESH"
|
||||
#define H5T_TETMESH_NUM_ELEMS_DSNAME "TETMESH_NUM_ELEMS"
|
||||
#define H5T_TETMESH_NUM_ELEMS_ON_LEVEL_DSNAME "TETMESH_NUM_ELEMS_ON_LEVEL"
|
||||
|
||||
#define H5BLOCK_GROUPNAME_BLOCK H5B_CONTAINER_GRPNAME
|
||||
|
||||
|
||||
+25
-12
@@ -34,6 +34,7 @@ typedef __int64 int64_t;
|
||||
#endif /* WIN32 */
|
||||
|
||||
typedef int64_t h5_int64_t;
|
||||
typedef int32_t h5_int32_t;
|
||||
typedef h5_int64_t h5_int_t;
|
||||
typedef h5_int64_t h5part_int64_t;
|
||||
typedef int32_t h5_id_t;
|
||||
@@ -44,13 +45,16 @@ typedef double h5_float64_t;
|
||||
typedef h5_float64_t h5_float_t;
|
||||
typedef h5_float64_t h5part_float64_t;
|
||||
|
||||
typedef h5_err_t h5_int32_t;
|
||||
|
||||
struct h5_complex {
|
||||
h5_float64_t r,i;
|
||||
};
|
||||
typedef struct h5_complex h5_complex;
|
||||
|
||||
enum h5_mesh_types {
|
||||
TETRAHEDRAL_MESH,
|
||||
TRIANGLE_MESH
|
||||
};
|
||||
|
||||
struct h5_vertex { /* 32Byte */
|
||||
h5_id_t id;
|
||||
h5_id_t unused; /* for right alignment */
|
||||
@@ -85,7 +89,7 @@ typedef struct h5_edge h5_edge;
|
||||
typedef struct h5_triangle h5_triangle;
|
||||
typedef struct h5_tetrahedron h5_tetrahedron;
|
||||
|
||||
typedef h5_int64_t (*h5_error_handler)( const char*, const h5_int64_t, const char*,...)
|
||||
typedef h5_err_t (*h5_error_handler)( const char*, const h5_err_t, const char*,...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__ ((format (printf, 3, 4)))
|
||||
#endif
|
||||
@@ -146,8 +150,15 @@ struct h5b_fdata {
|
||||
struct h5t_fdata_level {
|
||||
};
|
||||
|
||||
union entities {
|
||||
h5_tetrahedron *tets;
|
||||
h5_triangle *tris;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct h5t_fdata {
|
||||
char mesh_name[16];
|
||||
enum h5_mesh_types mesh_type;
|
||||
h5_id_t cur_mesh;
|
||||
h5_id_t new_mesh; /* idx of the first new mesh or -1 */
|
||||
h5_id_t num_meshes;
|
||||
@@ -157,24 +168,25 @@ struct h5t_fdata {
|
||||
h5_size_t num_levels;
|
||||
|
||||
h5_size_t *num_vertices;
|
||||
h5_size_t *num_tets;
|
||||
h5_size_t *num_tets_on_level;
|
||||
h5_size_t *map_tets_g2l;
|
||||
h5_size_t *num_entities;
|
||||
h5_size_t *num_entities_on_level;
|
||||
h5_size_t *map_entity_g2l;/* map global id to local id */
|
||||
|
||||
h5_id_t last_retrieved_vertex_id;
|
||||
h5_id_t last_stored_vertex_id;
|
||||
h5_vertex * vertices;
|
||||
h5_vertex *vertices;
|
||||
|
||||
h5_id_t last_retrieved_tet_id;
|
||||
h5_id_t last_stored_tet_id;
|
||||
h5_tetrahedron * tets;
|
||||
h5_id_t last_retrieved_entity_id;
|
||||
h5_id_t last_stored_entity_id;
|
||||
|
||||
hid_t entity_tid;
|
||||
union entities entities;
|
||||
|
||||
/* HDF5 objects */
|
||||
|
||||
hid_t topo_gid; /* grp id of mesh in current level */
|
||||
hid_t meshes_gid;
|
||||
hid_t mesh_gid;
|
||||
hid_t coord_gid;
|
||||
hid_t vmesh_gid;
|
||||
|
||||
/* type ids' for compound types */
|
||||
hid_t float64_3tuple_tid;
|
||||
@@ -182,6 +194,7 @@ struct h5t_fdata {
|
||||
hid_t int32_3tuple_tid;
|
||||
hid_t int32_4tuple_tid;
|
||||
hid_t vertex_tid;
|
||||
hid_t triangle_tid;
|
||||
hid_t tet_tid;
|
||||
};
|
||||
|
||||
|
||||
+58
-5
@@ -15,7 +15,9 @@ extern h5part_error_handler _err_handler;
|
||||
extern h5part_int64_t _h5part_errno;
|
||||
extern unsigned _debug;
|
||||
|
||||
|
||||
/*
|
||||
create several HDF5 types
|
||||
*/
|
||||
static h5_err_t
|
||||
_create_array_types (
|
||||
h5_file * f
|
||||
@@ -95,6 +97,57 @@ _create_vertex_type (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
static h5_err_t
|
||||
_create_triangle_type (
|
||||
h5_file * f
|
||||
) {
|
||||
struct h5t_fdata *t = &f->t;
|
||||
|
||||
hid_t hid = H5Tcreate ( H5T_COMPOUND, sizeof(struct h5_triangle) );
|
||||
if ( hid < 0 ) {
|
||||
return HANDLE_H5T_CREATE_ERR ( "H5T_COMPOUND", "triangle" );
|
||||
}
|
||||
t->triangle_tid = hid;
|
||||
|
||||
herr_t herr = H5Tinsert (
|
||||
t->triangle_tid,
|
||||
"id",
|
||||
HOFFSET(struct h5_triangle, id),
|
||||
H5T_NATIVE_INT32 );
|
||||
if ( herr < 0 ) {
|
||||
return HANDLE_H5T_INSERT_ERR ( "id", "triangle" );
|
||||
}
|
||||
|
||||
herr = H5Tinsert (
|
||||
t->triangle_tid,
|
||||
"parent_id",
|
||||
HOFFSET(struct h5_triangle, parent_id),
|
||||
H5T_NATIVE_INT32 );
|
||||
if ( herr < 0 ) {
|
||||
return HANDLE_H5T_INSERT_ERR ( "parent_id", "triangle" );
|
||||
}
|
||||
|
||||
herr = H5Tinsert (
|
||||
t->triangle_tid,
|
||||
"refined_on_level",
|
||||
HOFFSET(struct h5_triangle, refined_on_level),
|
||||
H5T_NATIVE_INT32 );
|
||||
if ( herr < 0 ) {
|
||||
return HANDLE_H5T_INSERT_ERR ( "refined_on_level", "triangle" );
|
||||
}
|
||||
|
||||
herr = H5Tinsert (
|
||||
t->triangle_tid,
|
||||
"vertex_ids",
|
||||
HOFFSET(struct h5_triangle, vertex_ids),
|
||||
t->int32_3tuple_tid );
|
||||
if ( herr < 0 ) {
|
||||
return HANDLE_H5T_INSERT_ERR ( "vertex_ids", "triangle" );
|
||||
}
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
static h5_err_t
|
||||
_create_tet_type (
|
||||
h5_file * f
|
||||
@@ -168,12 +221,11 @@ _h5t_init_fdata (
|
||||
t->new_level = -1;
|
||||
t->cur_level = -1;
|
||||
t->last_stored_vertex_id = -1;
|
||||
t->last_stored_tet_id = -1;
|
||||
t->last_stored_entity_id = -1;
|
||||
t->topo_gid = -1;
|
||||
t->meshes_gid = -1;
|
||||
t->mesh_gid = -1;
|
||||
t->coord_gid = -1;
|
||||
t->vmesh_gid = -1;
|
||||
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -198,6 +250,7 @@ _h5t_open_file (
|
||||
|
||||
if (( h5err = _create_array_types ( f )) < 0 ) return h5err;
|
||||
if (( h5err = _create_vertex_type ( f )) < 0 ) return h5err;
|
||||
if (( h5err = _create_triangle_type ( f )) < 0 ) return h5err;
|
||||
if (( h5err = _create_tet_type ( f )) < 0 ) return h5err;
|
||||
|
||||
return H5_SUCCESS;
|
||||
|
||||
+448
-208
File diff suppressed because it is too large
Load Diff
+60
-27
@@ -11,99 +11,132 @@ _h5t_close_step (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
_h5t_open_mesh (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5_err_t
|
||||
_h5t_close_mesh (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5t_get_num_meshes (
|
||||
h5_file * f
|
||||
h5t_get_num_meshes (
|
||||
h5_file * f,
|
||||
const enum h5_mesh_types type
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5t_open_mesh (
|
||||
h5t_open_mesh (
|
||||
h5_file * f,
|
||||
h5_id_t id
|
||||
h5_id_t id,
|
||||
const enum h5_mesh_types type
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5t_add_mesh (
|
||||
h5t_add_mesh (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5t_get_num_levels (
|
||||
h5t_get_num_levels (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5t_open_level (
|
||||
h5t_open_level (
|
||||
h5_file * f,
|
||||
const h5_id_t id
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5t_add_level (
|
||||
h5t_get_level (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5t_add_level (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5t_add_num_vertices (
|
||||
h5t_add_num_vertices (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5t_store_vertex (
|
||||
h5t_store_vertex (
|
||||
h5_file * f,
|
||||
const h5_id_t id,
|
||||
const h5_float64_t P[3]
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5t_get_num_vertices (
|
||||
h5_size_t
|
||||
h5t_get_num_vertices (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_start_traverse_vertices (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5t_get_vertex (
|
||||
h5t_traverse_vertices (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_float64_t P[3]
|
||||
);
|
||||
|
||||
h5_size_t
|
||||
H5t_add_num_tets (
|
||||
h5t_add_num_entities (
|
||||
h5_file * f,
|
||||
const h5_size_t num
|
||||
) ;
|
||||
|
||||
h5_size_t
|
||||
H5t_get_num_tets (
|
||||
h5t_get_num_entities (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5t_store_tet (
|
||||
h5t_store_tet (
|
||||
h5_file * f,
|
||||
const h5_id_t tet_id, /*!< global tetrahedron id */
|
||||
const h5_id_t parent_id, /*!< global parent id
|
||||
if level \c >0 else \c -1 */
|
||||
const h5_id_t vertex_ids[4] /*!< tuple with vertex id's */
|
||||
const h5_id_t id,
|
||||
const h5_id_t parent_id,
|
||||
const h5_id_t vertex_ids[4]
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
H5t_get_tet (
|
||||
h5t_store_triangle (
|
||||
h5_file * f,
|
||||
const h5_id_t id,
|
||||
const h5_id_t parent_id,
|
||||
const h5_id_t vertex_ids[3]
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_start_traverse_tets (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5t_traverse_tets (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_id_t * const parent_id,
|
||||
h5_id_t vertex_ids[4]
|
||||
);
|
||||
|
||||
|
||||
h5_err_t
|
||||
h5t_start_traverse_triangles (
|
||||
h5_file * f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5t_traverse_triangles (
|
||||
h5_file * f,
|
||||
h5_id_t * const id,
|
||||
h5_id_t * const parent_id,
|
||||
h5_id_t vertex_ids[3]
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user