- introducing types for local and globale IDs and indices
- different structurs for local elements and stored elements in file - interator for border facets added
This commit is contained in:
@@ -20,6 +20,11 @@ H5FedBeginTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
int codim
|
||||
);
|
||||
h5t_entity_iterator_t*
|
||||
H5FedBeginTraverseBoundaryFaces (
|
||||
h5_file_t* const f,
|
||||
int codim
|
||||
);
|
||||
h5_loc_id_t
|
||||
H5FedTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
|
||||
@@ -118,19 +118,18 @@ h5_error (
|
||||
|
||||
void
|
||||
h5_verror (
|
||||
const h5_file_t * const f,
|
||||
const char *fmt,
|
||||
const h5_file_t* const f,
|
||||
const char* fmt,
|
||||
va_list ap
|
||||
);
|
||||
|
||||
void
|
||||
h5_vwarn (
|
||||
const h5_file_t * const f,
|
||||
const char *fmt,
|
||||
va_list ap
|
||||
);
|
||||
/*!
|
||||
\ingroup h5_core_errorhandling
|
||||
|
||||
void
|
||||
Print a warning message to \c stderr.
|
||||
*/
|
||||
|
||||
static inline void
|
||||
h5_warn (
|
||||
const h5_file_t * const f,
|
||||
const char *fmt,
|
||||
@@ -140,6 +139,19 @@ h5_warn (
|
||||
__attribute__ ((format (printf, 2, 3)))
|
||||
#endif
|
||||
;
|
||||
static inline void
|
||||
h5_warn (
|
||||
const h5_file_t* const f,
|
||||
const char* fmt,
|
||||
...
|
||||
) {
|
||||
if (h5priv_debug_level >= 2) {
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
h5priv_vprintf (stderr, "W", h5_get_funcname(f), fmt, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5_core_errorhandling
|
||||
@@ -214,7 +226,7 @@ h5_set_funcname (
|
||||
);
|
||||
|
||||
static inline void
|
||||
SET_FNAME (
|
||||
H5_ENTER_API (
|
||||
h5_file_t* const f,
|
||||
const char* const fname
|
||||
) {
|
||||
|
||||
@@ -39,6 +39,8 @@ typedef __int64 int64_t;
|
||||
typedef int64_t h5_int64_t;
|
||||
typedef int32_t h5_int32_t;
|
||||
typedef int64_t h5_id_t;
|
||||
typedef h5_int32_t h5t_lvl_idx_t;
|
||||
typedef h5_int32_t h5t_elem_flags_t;
|
||||
typedef int64_t h5_glb_idx_t; // type for a global index
|
||||
typedef int64_t h5_loc_idx_t; // type for a local index
|
||||
typedef int64_t h5_glb_id_t; // type for a global ID
|
||||
|
||||
@@ -14,73 +14,4 @@
|
||||
#include "h5t_storemesh.h"
|
||||
#include "h5t_tags.h"
|
||||
|
||||
|
||||
#if !(defined(ULLONG_MAX))
|
||||
#define ULLONG_MAX (ULONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
/*
|
||||
ID's: 64bit
|
||||
|
||||
Vertices:
|
||||
000100vv tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt
|
||||
3V TT TT TT TT TT TT
|
||||
|
||||
Edges:
|
||||
00100eee tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt
|
||||
2E TT TT TT TT TT TT
|
||||
|
||||
Trinagles:
|
||||
001100dd tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt
|
||||
1D TT TT TT TT TT TT
|
||||
|
||||
Tets:
|
||||
01000000 tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt tttttttt
|
||||
00 TT TT TT TT TT TT
|
||||
|
||||
*/
|
||||
#define H5T_ELEM_MASK ( (h5_id_t) (ULLONG_MAX >> 8) )
|
||||
#define H5T_ETYPE_MASK ( 7ull << (sizeof(h5_id_t)*8-4) )
|
||||
#define H5T_COMPONENT_MASK (~H5T_ELEM_MASK)
|
||||
#define H5T_COMPONENT_ID_MASK (15ull << (sizeof(h5_id_t)*7) )
|
||||
|
||||
#define H5T_ETYPE_VERTEX ((h5_id_t)1)
|
||||
#define H5T_ETYPE_EDGE ((h5_id_t)2)
|
||||
#define H5T_ETYPE_TRIANGLE ((h5_id_t)3)
|
||||
#define H5T_ETYPE_TET ((h5_id_t)4)
|
||||
|
||||
#define h5tpriv_set_entity_type( type, elem_idx ) \
|
||||
( \
|
||||
((h5_id_t)(type) << (sizeof(h5_id_t)*8-4)) | \
|
||||
((h5_id_t)(elem_idx)) \
|
||||
)
|
||||
#define h5tpriv_get_entity_type( entity_id ) \
|
||||
((entity_id & H5T_ETYPE_MASK) >> (sizeof(h5_id_t)*8-4))
|
||||
|
||||
|
||||
#define h5tpriv_build_id( type, comp_idx, elem_idx ) \
|
||||
( \
|
||||
((h5_id_t)(type) << (sizeof(h5_id_t)*8-4)) | \
|
||||
((h5_id_t)(comp_idx) << (sizeof(h5_id_t)*7)) | \
|
||||
((h5_id_t)(elem_idx) & H5T_ELEM_MASK) \
|
||||
)
|
||||
|
||||
#define h5tpriv_build_vertex_id( comp_idx, elem_idx ) \
|
||||
( h5tpriv_build_id ( H5T_ETYPE_VERTEX, comp_idx, elem_idx ) )
|
||||
|
||||
#define h5tpriv_build_edge_id( comp_idx, elem_idx ) \
|
||||
( h5tpriv_build_id ( H5T_ETYPE_EDGE, comp_idx, elem_idx ) )
|
||||
|
||||
#define h5tpriv_build_triangle_id( comp_idx, elem_idx ) \
|
||||
( h5tpriv_build_id ( H5T_ETYPE_TRIANGLE, comp_idx, elem_idx ) )
|
||||
|
||||
#define h5tpriv_build_elem_id( elem_idx ) \
|
||||
( h5tpriv_build_id ( f->t->mesh_type, 0, elem_idx ) )
|
||||
|
||||
#define h5tpriv_get_face_idx( entity_id ) \
|
||||
( (entity_id & H5T_COMPONENT_ID_MASK) >> (sizeof(h5_id_t)*7) )
|
||||
|
||||
#define h5tpriv_get_elem_idx( entity_id ) \
|
||||
( entity_id & H5T_ELEM_MASK )
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@ h5t_get_num_vertices (
|
||||
const h5_id_t cnode
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5t_lvl_idx_t
|
||||
h5t_get_level (
|
||||
h5_file_t * const f
|
||||
);
|
||||
|
||||
@@ -88,4 +88,13 @@ h5t_get_vertex_indices_of_entity (
|
||||
h5_loc_idx_t *vertex_indices
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_entity2 (
|
||||
h5_file_t* const f,
|
||||
const int dim,
|
||||
const h5_loc_idx_t face_idx,
|
||||
const h5_loc_idx_t elem_idx,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,7 @@ h5_err_t h5t_open_mesh (
|
||||
);
|
||||
h5_err_t h5t_set_level (
|
||||
h5_file_t * const f,
|
||||
const h5_id_t id
|
||||
const h5t_lvl_idx_t id
|
||||
);
|
||||
h5_err_t h5t_close_mesh (
|
||||
h5_file_t * const f
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
typedef struct {
|
||||
int dim;
|
||||
int entity_types[H5T_MAX_DIM+1];
|
||||
int num_faces[H5T_MAX_DIM+1];
|
||||
int num_vertices_of_face[H5T_MAX_DIM+1][H5T_MAX_FACES];
|
||||
int map[H5T_MAX_DIM+1][H5T_MAX_FACES][H5T_MAX_VERTICES];
|
||||
|
||||
@@ -1,22 +1,33 @@
|
||||
#ifndef __H5T_RETRIEVE_H
|
||||
#define __H5T_RETRIEVE_H
|
||||
|
||||
typedef struct {
|
||||
typedef struct h5t_entity_iterator {
|
||||
h5_id_t elem_idx; // local element id
|
||||
h5_id_t face_idx; // face id according reference element
|
||||
int codim; // dimension of entities to traverse
|
||||
const h5t_ref_elem_t* ref_elem; // pointer to reference element
|
||||
h5_err_t (*find)(h5_file_t *const f,
|
||||
h5_id_t face_idx,
|
||||
h5_id_t elem_idx,
|
||||
h5_idlist_t **retval);
|
||||
h5_err_t (*find)(
|
||||
h5_file_t *const f,
|
||||
h5_id_t face_idx,
|
||||
h5_id_t elem_idx,
|
||||
h5_idlist_t **retval);
|
||||
h5_loc_id_t (*iter)(
|
||||
h5_file_t *const f,
|
||||
struct h5t_entity_iterator* iter);
|
||||
} h5t_entity_iterator_t;
|
||||
|
||||
h5_err_t
|
||||
h5t_alloc_entity_iterator (
|
||||
h5_file_t* f,
|
||||
h5t_entity_iterator_t** iter,
|
||||
int codim
|
||||
const int codim
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_alloc_boundary_face_iterator (
|
||||
h5_file_t* f,
|
||||
h5t_entity_iterator_t** iter,
|
||||
const int codim
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
@@ -29,7 +40,14 @@ h5_err_t
|
||||
h5t_begin_iterate_entities (
|
||||
h5_file_t* f,
|
||||
h5t_entity_iterator_t* iter,
|
||||
int codim
|
||||
const int codim
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_begin_iterate_boundary_faces (
|
||||
h5_file_t* f,
|
||||
h5t_entity_iterator_t* iter,
|
||||
const int codim
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
|
||||
@@ -7,7 +7,7 @@ h5t_add_mesh (
|
||||
const h5_oid_t mesh_type
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5t_lvl_idx_t
|
||||
h5t_add_level (
|
||||
h5_file_t * const f
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user