- local IDs and indices are now 32bit (in the future it will be possible
to compile the library with 32bit or 64bit IDs/indices. - bugfixes
This commit is contained in:
+1
-1
@@ -38,7 +38,7 @@ H5FedCloseMesh (
|
||||
h5_err_t
|
||||
H5FedSetLevel (
|
||||
h5_file_t* const f,
|
||||
const h5_id_t level_id
|
||||
const h5t_lvl_idx_t level_id
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_err_t h5err = h5t_set_level (f, level_id);
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
h5_err_t
|
||||
H5FedGetAdjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_id_t entity_id,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_err_t h5err = h5t_get_adjacencies (f, entity_id, dim, list);
|
||||
@@ -36,7 +36,7 @@ H5FedGetAdjacencies (
|
||||
h5_err_t
|
||||
H5FedReleaseListOfAdjacencies (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
H5_API_ENTER
|
||||
h5_err_t h5err = h5t_release_list_of_adjacencies (f, list);
|
||||
|
||||
+10
-10
@@ -106,7 +106,7 @@ H5FedEndTraverseEntities (
|
||||
h5_err_t
|
||||
H5FedGetVertexCoordsByIndex (
|
||||
h5_file_t* const f,
|
||||
h5_id_t vertex_index,
|
||||
h5_loc_idx_t vertex_index,
|
||||
h5_float64_t P[3]
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
@@ -117,7 +117,7 @@ H5FedGetVertexCoordsByIndex (
|
||||
h5_err_t
|
||||
H5FedGetVertexCoordsByID (
|
||||
h5_file_t* const f,
|
||||
h5_id_t vertex_id,
|
||||
h5_loc_id_t vertex_id,
|
||||
h5_float64_t P[3]
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
@@ -128,8 +128,8 @@ H5FedGetVertexCoordsByID (
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfEdge (
|
||||
h5_file_t* const f,
|
||||
h5_id_t entity_id,
|
||||
h5_id_t* vertex_indices
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_err_t h5err = h5t_get_vertex_indices_of_edge (f, entity_id, vertex_indices);
|
||||
@@ -139,8 +139,8 @@ H5FedGetVertexIndicesOfEdge (
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfTriangle (
|
||||
h5_file_t* const f,
|
||||
h5_id_t entity_id,
|
||||
h5_id_t* vertex_indices
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_err_t h5err = h5t_get_vertex_indices_of_triangle (f, entity_id, vertex_indices);
|
||||
@@ -150,8 +150,8 @@ H5FedGetVertexIndicesOfTriangle (
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfTet (
|
||||
h5_file_t* const f,
|
||||
h5_id_t entity_id,
|
||||
h5_id_t* vertex_indices
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER
|
||||
h5_err_t h5err = h5t_get_vertex_indices_of_tet (f, entity_id, vertex_indices);
|
||||
@@ -161,8 +161,8 @@ H5FedGetVertexIndicesOfTet (
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfEntity (
|
||||
h5_file_t* const f,
|
||||
h5_id_t entity_id,
|
||||
h5_id_t* vertex_indices
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_err_t h5err = h5t_get_vertex_indices_of_entity (f, entity_id, vertex_indices);
|
||||
|
||||
+4
-4
@@ -78,7 +78,7 @@ H5FedBeginStoreVertices (
|
||||
h5_loc_idx_t
|
||||
H5FedStoreVertex (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_id_t vertex_id, /*!< id from mesher or -1 */
|
||||
const h5_glb_id_t vertex_id, /*!< id from mesher or -1 */
|
||||
const h5_float64_t P[3] /*!< coordinates */
|
||||
) {
|
||||
|
||||
@@ -131,7 +131,7 @@ H5FedBeginStoreElements (
|
||||
h5_loc_idx_t
|
||||
H5FedStoreElement (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_id_t local_vids[] /*!< tuple with vertex id's */
|
||||
const h5_loc_idx_t local_vids[] /*!< tuple with vertex id's */
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_loc_idx_t idx;
|
||||
@@ -163,10 +163,10 @@ H5FedBeginRefineElements (
|
||||
H5_API_RETURN (h5err);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5_loc_idx_t
|
||||
H5FedRefineElement (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_id_t local_eid /*!< local element id */
|
||||
const h5_loc_id_t local_eid /*!< local element id */
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_err_t h5err = h5t_mark_entity (f, local_eid);
|
||||
|
||||
+3
-3
@@ -103,7 +103,7 @@ h5_err_t
|
||||
H5FedSetMTag (
|
||||
h5_file_t* const f,
|
||||
char name[],
|
||||
h5_id_t id,
|
||||
h5_loc_id_t id,
|
||||
const size_t dims,
|
||||
void* val
|
||||
) {
|
||||
@@ -127,7 +127,7 @@ h5_err_t
|
||||
H5FedGetMTag (
|
||||
h5_file_t* const f,
|
||||
const char name[],
|
||||
const h5_id_t id,
|
||||
const h5_loc_id_t id,
|
||||
size_t* dim,
|
||||
void* vals
|
||||
) {
|
||||
@@ -147,7 +147,7 @@ h5_err_t
|
||||
H5FedRemoveMTag (
|
||||
h5_file_t* const f,
|
||||
const char name[],
|
||||
const h5_id_t id
|
||||
const h5_loc_id_t id
|
||||
) {
|
||||
H5_API_ENTER;
|
||||
h5_err_t h5err = h5t_remove_mtag_by_name (f, name, id);
|
||||
|
||||
@@ -28,6 +28,7 @@ done: \
|
||||
|
||||
#include "h5_types_private.h"
|
||||
|
||||
#include "h5_attribs_private.h"
|
||||
#include "h5_errorhandling_private.h"
|
||||
#include "h5_fcmp_private.h"
|
||||
#include "h5_hdf5_private.h"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
h5_err_t
|
||||
h5priv_alloc_idlist (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list,
|
||||
h5_loc_idlist_t** list,
|
||||
const h5_size_t size
|
||||
) {
|
||||
TRY( *list = h5_calloc (f, 1, sizeof (**list)+size*sizeof ((*list)->items[0])) );
|
||||
@@ -27,7 +27,7 @@ h5priv_alloc_idlist (
|
||||
h5_err_t
|
||||
h5priv_free_idlist (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
if (*list == NULL) return H5_SUCCESS;
|
||||
TRY( h5_free( f, *list) );
|
||||
@@ -38,7 +38,7 @@ h5priv_free_idlist (
|
||||
static inline h5_err_t
|
||||
grow_idlist (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list,
|
||||
h5_loc_idlist_t** list,
|
||||
size_t new_size
|
||||
) {
|
||||
size_t bytes_to_allocate = sizeof (**list) + (new_size-1)*sizeof((*list)->items[0]);
|
||||
@@ -53,7 +53,7 @@ grow_idlist (
|
||||
h5_loc_idx_t
|
||||
h5priv_insert_idlist (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list,
|
||||
h5_loc_idlist_t** list,
|
||||
h5_loc_id_t id,
|
||||
h5_loc_idx_t idx
|
||||
) {
|
||||
@@ -68,7 +68,7 @@ h5priv_insert_idlist (
|
||||
}
|
||||
TRY( grow_idlist (f, list, size) );
|
||||
}
|
||||
h5_idlist_t* l = *list;
|
||||
h5_loc_idlist_t* l = *list;
|
||||
if (idx == -1) {
|
||||
idx = l->num_items;
|
||||
} else {
|
||||
@@ -88,7 +88,7 @@ h5priv_insert_idlist (
|
||||
h5_loc_id_t
|
||||
h5priv_find_idlist (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t* list,
|
||||
h5_loc_idlist_t* list,
|
||||
const h5_loc_id_t item
|
||||
) {
|
||||
UNUSED_ARGUMENT (f);
|
||||
@@ -125,7 +125,7 @@ h5priv_find_idlist (
|
||||
h5_loc_idx_t
|
||||
h5priv_search_idlist (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list,
|
||||
h5_loc_idlist_t** list,
|
||||
h5_loc_id_t item
|
||||
) {
|
||||
h5_loc_idx_t idx = h5priv_find_idlist (f, *list, item);
|
||||
|
||||
@@ -4,27 +4,27 @@
|
||||
h5_err_t
|
||||
h5priv_alloc_idlist (
|
||||
h5_file_t * const f,
|
||||
h5_idlist_t **list,
|
||||
h5_loc_idlist_t **list,
|
||||
const h5_size_t size
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5priv_free_idlist (
|
||||
h5_file_t * const f,
|
||||
h5_idlist_t **list
|
||||
h5_loc_idlist_t **list
|
||||
);
|
||||
|
||||
h5_loc_id_t
|
||||
h5priv_find_idlist (
|
||||
h5_file_t * const f,
|
||||
h5_idlist_t* list,
|
||||
h5_loc_idlist_t* list,
|
||||
h5_loc_id_t item
|
||||
);
|
||||
|
||||
h5_loc_idx_t
|
||||
h5priv_insert_idlist (
|
||||
h5_file_t * const f,
|
||||
h5_idlist_t** list,
|
||||
h5_loc_idlist_t** list,
|
||||
h5_loc_id_t item,
|
||||
h5_loc_idx_t idx
|
||||
);
|
||||
@@ -32,7 +32,7 @@ h5priv_insert_idlist (
|
||||
h5_loc_idx_t
|
||||
h5priv_search_idlist (
|
||||
h5_file_t * const f,
|
||||
h5_idlist_t** list,
|
||||
h5_loc_idlist_t** list,
|
||||
h5_loc_id_t item
|
||||
);
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
struct h5t_access_methods {
|
||||
h5_generic_loc_elem_t* (*get_loc_elem)(
|
||||
h5_file_t* const, const h5_loc_idx_t);
|
||||
h5_glb_idx_t (*get_loc_elem_glb_idx) (
|
||||
h5_file_t* const, const h5_loc_idx_t);
|
||||
h5_glb_idx_t (*set_loc_elem_glb_idx) (
|
||||
h5_file_t* const, const h5_loc_idx_t, const h5_glb_idx_t);
|
||||
h5_loc_idx_t (*get_loc_elem_parent_idx)(
|
||||
h5_file_t* const, const h5_loc_idx_t);
|
||||
h5_loc_idx_t (*set_loc_elem_parent_idx)(
|
||||
@@ -79,6 +83,23 @@ h5tpriv_get_loc_elem (
|
||||
return (*f->t->methods.access->get_loc_elem)(f, elem_idx);
|
||||
}
|
||||
|
||||
static inline h5_glb_idx_t
|
||||
h5tpriv_set_loc_elem_glb_idx (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t loc_elem_idx,
|
||||
h5_glb_idx_t glb_elem_idx
|
||||
) {
|
||||
return (*f->t->methods.access->set_loc_elem_glb_idx)(f, loc_elem_idx, glb_elem_idx);
|
||||
}
|
||||
|
||||
static inline h5_glb_idx_t
|
||||
h5tpriv_get_loc_elem_glb_idx (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t loc_elem_idx
|
||||
) {
|
||||
return (*f->t->methods.access->get_loc_elem_glb_idx)(f, loc_elem_idx);
|
||||
}
|
||||
|
||||
static inline h5_loc_idx_t
|
||||
h5tpriv_get_loc_elem_parent_idx (
|
||||
h5_file_t* const f,
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "h5_core_private.h"
|
||||
|
||||
/*** op's on local elements ***/
|
||||
|
||||
|
||||
static h5_generic_loc_elem_t*
|
||||
get_loc_elem (
|
||||
h5_file_t* const f,
|
||||
@@ -11,6 +13,24 @@ get_loc_elem (
|
||||
return (h5_generic_loc_elem_t*)elem;
|
||||
}
|
||||
|
||||
static h5_glb_idx_t
|
||||
get_loc_elem_glb_idx (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_idx_t elem_idx
|
||||
) {
|
||||
return f->t->loc_elems.tets[elem_idx].glb_idx;
|
||||
}
|
||||
|
||||
static h5_glb_idx_t
|
||||
set_loc_elem_glb_idx (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_idx_t elem_idx,
|
||||
const h5_glb_idx_t glb_idx
|
||||
) {
|
||||
f->t->loc_elems.tets[elem_idx].glb_idx = glb_idx;
|
||||
return glb_idx;
|
||||
}
|
||||
|
||||
static h5_loc_idx_t
|
||||
get_loc_elem_parent_idx (
|
||||
h5_file_t* const f,
|
||||
@@ -311,6 +331,8 @@ is_boundary_face (
|
||||
|
||||
struct h5t_access_methods h5tpriv_access_tetm_methods = {
|
||||
get_loc_elem,
|
||||
get_loc_elem_glb_idx,
|
||||
set_loc_elem_glb_idx,
|
||||
get_loc_elem_parent_idx,
|
||||
set_loc_elem_parent_idx,
|
||||
get_loc_elem_child_idx,
|
||||
|
||||
@@ -10,6 +10,24 @@ get_loc_elem (
|
||||
return (h5_generic_loc_elem_t*)&f->t->loc_elems.tris[elem_idx];
|
||||
}
|
||||
|
||||
static h5_glb_idx_t
|
||||
get_loc_elem_glb_idx (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_idx_t elem_idx
|
||||
) {
|
||||
return f->t->loc_elems.tris[elem_idx].glb_idx;
|
||||
}
|
||||
|
||||
static h5_glb_idx_t
|
||||
set_loc_elem_glb_idx (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_idx_t elem_idx,
|
||||
const h5_glb_idx_t glb_idx
|
||||
) {
|
||||
f->t->loc_elems.tris[elem_idx].glb_idx = glb_idx;
|
||||
return glb_idx;
|
||||
}
|
||||
|
||||
static h5_loc_idx_t
|
||||
get_loc_elem_parent_idx (
|
||||
h5_file_t* const f,
|
||||
@@ -309,6 +327,8 @@ is_boundary_face (
|
||||
|
||||
struct h5t_access_methods h5tpriv_access_trim_methods = {
|
||||
get_loc_elem,
|
||||
get_loc_elem_glb_idx,
|
||||
set_loc_elem_glb_idx,
|
||||
get_loc_elem_parent_idx,
|
||||
set_loc_elem_parent_idx,
|
||||
get_loc_elem_child_idx,
|
||||
|
||||
@@ -21,7 +21,7 @@ h5t_get_adjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
return h5tpriv_get_adjacencies (f, entity_id, dim, list);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ h5t_get_adjacencies (
|
||||
h5_err_t
|
||||
h5t_release_list_of_adjacencies (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
TRY( h5priv_free_idlist (f, list) );
|
||||
return H5_SUCCESS;
|
||||
@@ -40,7 +40,7 @@ h5t_find_te2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t** retval
|
||||
h5_loc_idlist_t** retval
|
||||
) {
|
||||
return h5tpriv_find_te2 (f,face_idx,elem_idx,retval);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ struct h5t_adjacency_methods {
|
||||
h5_err_t (*release_internal_structs)(h5_file_t* const);
|
||||
h5_err_t (*get_adjacencies)(
|
||||
h5_file_t * const,
|
||||
const h5_loc_id_t, const h5_int32_t, h5_idlist_t**);
|
||||
const h5_loc_id_t, const h5_int32_t, h5_loc_idlist_t**);
|
||||
};
|
||||
|
||||
extern struct h5t_adjacency_methods h5tpriv_trim_adjacency_methods;
|
||||
@@ -17,7 +17,7 @@ h5tpriv_get_adjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
if (f->t->methods.adjacency == NULL) {
|
||||
h5_error_internal (f, __FILE__, __func__, __LINE__);
|
||||
|
||||
@@ -136,9 +136,9 @@ static inline h5_err_t
|
||||
compute_children_of_edge (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_idlist_t** children
|
||||
h5_loc_idlist_t** children
|
||||
) {
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
TRY( h5tpriv_find_te (f, entity_id, &te ) );
|
||||
h5_loc_id_t* edge_idp = te->items;
|
||||
h5_loc_id_t* end = te->items+te->num_items;
|
||||
@@ -169,9 +169,9 @@ static inline h5_err_t
|
||||
compute_sections_of_edge (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_idlist_t** children
|
||||
h5_loc_idlist_t** children
|
||||
) {
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
TRY( h5tpriv_find_te (f, entity_id, &te) );
|
||||
h5_loc_id_t* edge_idp = te->items;
|
||||
h5_loc_id_t* end = te->items+te->num_items;
|
||||
@@ -261,9 +261,9 @@ static inline h5_err_t
|
||||
compute_children_of_triangle (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_idlist_t** children
|
||||
h5_loc_idlist_t** children
|
||||
) {
|
||||
h5_idlist_t* td;
|
||||
h5_loc_idlist_t* td;
|
||||
TRY( h5tpriv_find_td (f, entity_id, &td) );
|
||||
h5_loc_id_t* triangle_idp = td->items;
|
||||
h5_loc_id_t* end = td->items+td->num_items;
|
||||
@@ -293,9 +293,9 @@ static inline h5_err_t
|
||||
compute_sections_of_triangle (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_idlist_t** children
|
||||
h5_loc_idlist_t** children
|
||||
) {
|
||||
h5_idlist_t* td;
|
||||
h5_loc_idlist_t* td;
|
||||
TRY( h5tpriv_find_td (f, entity_id, &td) );
|
||||
h5_loc_id_t* triangle_idp = td->items;
|
||||
h5_loc_id_t* end = td->items+td->num_items;
|
||||
@@ -330,11 +330,11 @@ compute_sections_of_triangle (
|
||||
static inline h5_err_t
|
||||
add_vertex2 (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_idx_t face_idx, // in
|
||||
h5_loc_idx_t elem_idx // in
|
||||
) {
|
||||
h5_idlist_t* tv;
|
||||
h5_loc_idlist_t* tv;
|
||||
TRY( h5tpriv_find_tv2 (f, face_idx, elem_idx, &tv) );
|
||||
TRY( h5priv_search_idlist (f, list, tv->items[0]) );
|
||||
return H5_SUCCESS;
|
||||
@@ -346,10 +346,10 @@ add_vertex2 (
|
||||
static inline h5_err_t
|
||||
add_edge (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_id_t entity_id // in
|
||||
) {
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
TRY( h5tpriv_find_te (f, entity_id, &te) );
|
||||
TRY( h5priv_search_idlist (f, list, te->items[0]) );
|
||||
return H5_SUCCESS;
|
||||
@@ -358,11 +358,11 @@ add_edge (
|
||||
static inline h5_err_t
|
||||
add_edge2 (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_idx_t face_idx, // in
|
||||
h5_loc_idx_t elem_idx // in
|
||||
) {
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
TRY( h5tpriv_find_te2 (f, face_idx, elem_idx, &te) );
|
||||
TRY( h5priv_search_idlist (f, list, te->items[0]) );
|
||||
return H5_SUCCESS;
|
||||
@@ -374,10 +374,10 @@ add_edge2 (
|
||||
static inline h5_err_t
|
||||
add_triangle (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_idx_t entity_id // in
|
||||
) {
|
||||
h5_idlist_t* td;
|
||||
h5_loc_idlist_t* td;
|
||||
TRY( h5tpriv_find_td (f, entity_id, &td) );
|
||||
TRY( h5priv_search_idlist (f, list, td->items[0]) );
|
||||
|
||||
@@ -387,11 +387,11 @@ add_triangle (
|
||||
static inline h5_err_t
|
||||
add_triangle2 (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_idx_t face_idx, // in
|
||||
h5_loc_idx_t elem_idx // in
|
||||
) {
|
||||
h5_idlist_t* td;
|
||||
h5_loc_idlist_t* td;
|
||||
TRY( h5tpriv_find_td2 (f, face_idx, elem_idx, &td) );
|
||||
TRY( h5priv_search_idlist (f, list, td->items[0]) );
|
||||
|
||||
@@ -401,7 +401,7 @@ add_triangle2 (
|
||||
static inline h5_err_t
|
||||
add_elem2 (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_idx_t elem_idx // in
|
||||
) {
|
||||
h5_loc_id_t elem_id = h5tpriv_build_tet_id (0, elem_idx);
|
||||
@@ -417,11 +417,11 @@ static inline h5_err_t
|
||||
get_edges_uadj_to_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_loc_idx_t vertex_idx;
|
||||
TRY( h5t_get_vertex_index_of_vertex (f, entity_id, &vertex_idx) );
|
||||
h5_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
h5_loc_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
h5_loc_id_t* vertex_idp = tv->items;
|
||||
@@ -454,14 +454,14 @@ static inline h5_err_t
|
||||
get_triangles_uadj_to_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
/* get list of all tetrahedra connected to given vertex
|
||||
Note: this list may include tetrahedra which are not in
|
||||
the (current) leaf grid */
|
||||
h5_loc_idx_t vertex_idx;
|
||||
TRY( h5t_get_vertex_index_of_vertex (f, entity_id, &vertex_idx) );
|
||||
h5_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
h5_loc_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
|
||||
// build list of upward adjacent triangles
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
@@ -494,11 +494,11 @@ static inline h5_err_t
|
||||
get_tets_uadj_to_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_loc_idx_t vertex_idx;
|
||||
TRY( h5t_get_vertex_index_of_vertex (f, entity_id, &vertex_idx) );
|
||||
h5_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
h5_loc_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
h5_loc_id_t* vertex_idp = tv->items;
|
||||
@@ -518,9 +518,9 @@ static inline h5_err_t
|
||||
get_triangles_uadj_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
TRY( compute_children_of_edge (f, entity_id, &children) );
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
@@ -547,9 +547,9 @@ static inline h5_err_t
|
||||
get_tets_uadj_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
TRY( compute_children_of_edge (f, entity_id, &children) );
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
@@ -566,9 +566,9 @@ static inline h5_err_t
|
||||
get_tets_uadj_to_triangle (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
TRY( compute_children_of_triangle (f, entity_id, &children) );
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
@@ -585,9 +585,9 @@ static inline h5_err_t
|
||||
get_vertices_dadj_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
TRY( compute_sections_of_edge (f, entity_id, &children) );
|
||||
// build list of unique vertex IDs
|
||||
@@ -618,9 +618,9 @@ static inline h5_err_t
|
||||
get_vertices_dadj_to_triangle (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
|
||||
h5_loc_idx_t face_idx = h5tpriv_get_face_idx (entity_id);
|
||||
@@ -662,9 +662,9 @@ static inline h5_err_t
|
||||
get_vertices_dadj_to_tet (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
// loop over all edges of tetrahedron
|
||||
@@ -700,9 +700,9 @@ static inline h5_err_t
|
||||
get_edges_dadj_to_triangle (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
h5_loc_idx_t face_idx = h5tpriv_get_face_idx (entity_id);
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
|
||||
@@ -732,9 +732,9 @@ static inline h5_err_t
|
||||
get_edges_dadj_to_tet (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t elem_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (elem_id);
|
||||
|
||||
@@ -761,9 +761,9 @@ static inline h5_err_t
|
||||
get_triangles_dadj_to_tet (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
|
||||
// loop over all triangle of element
|
||||
@@ -800,7 +800,7 @@ get_adjacencies_to_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
switch (dim) {
|
||||
case 1:
|
||||
@@ -819,7 +819,7 @@ get_adjacencies_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
switch (dim) {
|
||||
case 0:
|
||||
@@ -838,7 +838,7 @@ get_adjacencies_to_triangle (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
switch (dim) {
|
||||
case 0:
|
||||
@@ -857,7 +857,7 @@ get_adjacencies_to_tet (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
switch (dim) {
|
||||
case 0:
|
||||
@@ -876,7 +876,7 @@ get_adjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_loc_id_t entity_type = h5tpriv_get_entity_type (entity_id);
|
||||
switch (entity_type) {
|
||||
|
||||
@@ -107,9 +107,9 @@ static inline h5_err_t
|
||||
compute_children_of_edge (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_idlist_t** children
|
||||
h5_loc_idlist_t** children
|
||||
) {
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
TRY( h5tpriv_find_te (f, entity_id, &te ) );
|
||||
h5_loc_id_t* edge_idp = te->items;
|
||||
h5_loc_id_t* end = te->items + te->num_items;
|
||||
@@ -141,9 +141,9 @@ static inline h5_err_t
|
||||
compute_sections_of_edge (
|
||||
h5_file_t * const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_idlist_t** children
|
||||
h5_loc_idlist_t** children
|
||||
) {
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
TRY( h5tpriv_find_te (f, entity_id, &te) );
|
||||
h5_loc_id_t* edge_idp = te->items;
|
||||
h5_loc_id_t *end = te->items+te->num_items;
|
||||
@@ -176,11 +176,11 @@ compute_sections_of_edge (
|
||||
static inline h5_err_t
|
||||
add_vertex2 (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_idx_t face_idx, // in
|
||||
h5_loc_idx_t elem_idx // in
|
||||
) {
|
||||
h5_idlist_t* tv;
|
||||
h5_loc_idlist_t* tv;
|
||||
TRY( h5tpriv_find_tv2 (f, face_idx, elem_idx, &tv) );
|
||||
TRY( h5priv_search_idlist (f, list, tv->items[0]) );
|
||||
return H5_SUCCESS;
|
||||
@@ -192,10 +192,10 @@ add_vertex2 (
|
||||
static inline h5_err_t
|
||||
add_edge (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_id_t entity_id // in
|
||||
) {
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
TRY( h5tpriv_find_te (f, entity_id, &te) );
|
||||
TRY( h5priv_search_idlist (f, list, te->items[0]) );
|
||||
return H5_SUCCESS;
|
||||
@@ -204,11 +204,11 @@ add_edge (
|
||||
static inline h5_err_t
|
||||
add_edge2 (
|
||||
h5_file_t* const f,
|
||||
h5_idlist_t** list,
|
||||
h5_loc_idlist_t** list,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx
|
||||
) {
|
||||
h5_idlist_t *te;
|
||||
h5_loc_idlist_t *te;
|
||||
TRY( h5tpriv_find_te2 (f, face_idx, elem_idx, &te) );
|
||||
TRY( h5priv_search_idlist (f, list, te->items[0]) );
|
||||
return H5_SUCCESS;
|
||||
@@ -217,7 +217,7 @@ add_edge2 (
|
||||
static inline h5_err_t
|
||||
add_elem2 (
|
||||
h5_file_t* const f, // in
|
||||
h5_idlist_t** list, // out
|
||||
h5_loc_idlist_t** list, // out
|
||||
h5_loc_idx_t elem_idx // in
|
||||
) {
|
||||
h5_loc_id_t elem_id = h5tpriv_build_triangle_id (0, elem_idx);
|
||||
@@ -233,11 +233,11 @@ static inline h5_err_t
|
||||
get_edges_uadj_to_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_loc_idx_t vertex_idx;
|
||||
TRY( h5t_get_vertex_index_of_vertex (f, entity_id, &vertex_idx) );
|
||||
h5_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
h5_loc_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
h5_loc_id_t* vertex_idp = tv->items;
|
||||
@@ -266,11 +266,11 @@ static inline h5_err_t
|
||||
get_triangles_uadj_to_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_loc_idx_t vertex_idx;
|
||||
TRY( h5t_get_vertex_index_of_vertex (f, entity_id, &vertex_idx) );
|
||||
h5_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
h5_loc_idlist_t* tv = f->t->adjacencies.tv.v[vertex_idx];
|
||||
|
||||
TRY ( h5priv_alloc_idlist ( f, list, 8 ) );
|
||||
h5_loc_id_t *vertex_idp = tv->items;
|
||||
@@ -291,9 +291,9 @@ static inline h5_err_t
|
||||
get_triangles_uadj_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
TRY( compute_children_of_edge (f, entity_id, &children) );
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
@@ -312,10 +312,10 @@ static inline h5_err_t
|
||||
get_edges_adj_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
TRY( compute_sections_of_edge (f, entity_id, &children) );
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
@@ -332,9 +332,9 @@ static inline h5_err_t
|
||||
get_vertices_dadj_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY( h5priv_alloc_idlist (f, &children, 8) );
|
||||
TRY( compute_sections_of_edge (f, entity_id, &children) );
|
||||
TRY( h5priv_alloc_idlist (f, list, 8) );
|
||||
@@ -364,9 +364,9 @@ static inline h5_err_t
|
||||
get_vertices_dadj_to_triangle (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY ( h5priv_alloc_idlist ( f, &children, 8 ) );
|
||||
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx ( entity_id );
|
||||
@@ -403,9 +403,9 @@ static inline h5_err_t
|
||||
get_edges_dadj_to_triangle (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_idlist_t* children;
|
||||
h5_loc_idlist_t* children;
|
||||
TRY ( h5priv_alloc_idlist (f, &children, 8) );
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
|
||||
// loop over all edges of triangle
|
||||
@@ -442,7 +442,7 @@ get_adjacencies_to_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
switch (dim) {
|
||||
case 1:
|
||||
@@ -459,7 +459,7 @@ get_adjacencies_to_edge (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
switch (dim) {
|
||||
case 0:
|
||||
@@ -478,7 +478,7 @@ get_adjacencies_to_triangle (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
switch (dim) {
|
||||
case 0:
|
||||
@@ -495,7 +495,7 @@ get_adjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
h5_loc_id_t entity_type = h5tpriv_get_entity_type (entity_id);
|
||||
switch (entity_type) {
|
||||
|
||||
@@ -45,64 +45,52 @@
|
||||
00 TT TT TT TT TT TT
|
||||
|
||||
*/
|
||||
#define H5T_ELEM_MASK ( (h5_id_t) (ULLONG_MAX >> 8) )
|
||||
#define H5T_TYPE_MASK ( 7ull << (sizeof(h5_id_t)*7+4) )
|
||||
#define H5T_FACE_MASK (15ull << (sizeof(h5_id_t)*7) )
|
||||
|
||||
#define H5T_TYPE_VERTEX (1)
|
||||
#define H5T_TYPE_EDGE (2)
|
||||
#define H5T_TYPE_TRIANGLE (3)
|
||||
#define H5T_TYPE_TET (4)
|
||||
#define BITS_OF(x) (sizeof(x)*CHAR_BIT)
|
||||
|
||||
#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_TYPE_MASK) >> (sizeof(h5_id_t)*8-4))
|
||||
#define H5T_TYPE_VERTEX (1<<4)
|
||||
#define H5T_TYPE_EDGE (2<<4)
|
||||
#define H5T_TYPE_TRIANGLE (3<<4)
|
||||
#define H5T_TYPE_TET (4<<4)
|
||||
|
||||
#define H5T_FACE_MASK (0x0f)
|
||||
#define H5T_TYPE_MASK (0x70)
|
||||
|
||||
#define h5tpriv_build_entity_id( type, face_idx, elem_idx ) \
|
||||
( \
|
||||
((h5_id_t)(type) << (sizeof(h5_id_t)*8-4)) | \
|
||||
((h5_id_t)(face_idx) << (sizeof(h5_id_t)*7)) | \
|
||||
((h5_id_t)(elem_idx) & H5T_ELEM_MASK) \
|
||||
)
|
||||
#define h5tpriv_set_entity_type( type, elem_idx ) \
|
||||
(((type) << (BITS_OF(elem_idx)-4)) | (elem_idx))
|
||||
|
||||
#define h5tpriv_get_entity_type( entity_id ) \
|
||||
((entity_id >> (BITS_OF(entity_id)-8)) & H5T_TYPE_MASK)
|
||||
|
||||
#define h5tpriv_build_entity_id2( face_id, elem_idx ) \
|
||||
( \
|
||||
((h5_id_t)(face_id) << (sizeof(h5_id_t)*7)) | \
|
||||
((h5_id_t)(elem_idx) & H5T_ELEM_MASK) \
|
||||
)
|
||||
#define h5tpriv_build_entity_id( type, face_idx, elem_idx ) \
|
||||
(((type) | (face_idx)) << (BITS_OF(elem_idx)-8) | (elem_idx))
|
||||
|
||||
#define h5tpriv_build_face_id( type_id, face_idx ) \
|
||||
(type_id << 4 | face_idx)
|
||||
#define h5tpriv_build_entity_id2( face_id, elem_idx ) \
|
||||
(((face_id) << (BITS_OF(elem_idx)-8)) | \
|
||||
(elem_idx))
|
||||
|
||||
#define h5tpriv_build_vertex_id( face_idx, elem_idx ) \
|
||||
( h5tpriv_build_entity_id ( H5T_TYPE_VERTEX, face_idx, elem_idx ) )
|
||||
(h5tpriv_build_entity_id (H5T_TYPE_VERTEX, face_idx, elem_idx))
|
||||
|
||||
#define h5tpriv_build_edge_id( face_idx, elem_idx ) \
|
||||
( h5tpriv_build_entity_id ( H5T_TYPE_EDGE, face_idx, elem_idx ) )
|
||||
(h5tpriv_build_entity_id (H5T_TYPE_EDGE, face_idx, elem_idx))
|
||||
|
||||
#define h5tpriv_build_triangle_id( face_idx, elem_idx ) \
|
||||
( h5tpriv_build_entity_id ( H5T_TYPE_TRIANGLE, face_idx, elem_idx ) )
|
||||
|
||||
#define h5tpriv_build_tet_id( face_idx, elem_idx ) \
|
||||
( h5tpriv_build_entity_id ( H5T_TYPE_TET, face_idx, elem_idx ) )
|
||||
#define h5tpriv_build_triangle_id( face_idx, elem_idx ) \
|
||||
(h5tpriv_build_entity_id (H5T_TYPE_TRIANGLE, face_idx, elem_idx))
|
||||
|
||||
#define h5tpriv_build_tet_id( face_idx, elem_idx ) \
|
||||
(h5tpriv_build_entity_id (H5T_TYPE_TET, face_idx, elem_idx))
|
||||
|
||||
#define h5tpriv_get_face_idx( entity_id ) \
|
||||
( (entity_id & H5T_FACE_MASK) >> (sizeof(h5_id_t)*7) )
|
||||
(((entity_id) >> (BITS_OF(entity_id)-8)) & H5T_FACE_MASK)
|
||||
|
||||
#define h5tpriv_get_face_id( entity_id ) \
|
||||
( (entity_id & (H5T_TYPE_MASK|H5T_FACE_MASK)) >> (sizeof(h5_id_t)*7) )
|
||||
(((entity_id) >> (BITS_OF(entity_id)-8)) & (H5T_TYPE_MASK|H5T_FACE_MASK))
|
||||
|
||||
#define h5tpriv_get_elem_idx( entity_id ) \
|
||||
( entity_id & H5T_ELEM_MASK )
|
||||
#define h5tpriv_get_elem_idx( entity_id ) \
|
||||
(((entity_id) << 8) >> 8)
|
||||
|
||||
#define H5T_BOUNDARY_ELEM_FLAG 1
|
||||
#define H5T_BOUNDARY_FACET_FLAG 2
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+12
-31
@@ -9,7 +9,7 @@ h5tpriv_search_tv2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t** idlist
|
||||
h5_loc_idlist_t** idlist
|
||||
) {
|
||||
H5_CORE_API_ENTER;
|
||||
h5_err_t ret_value = H5_SUCCESS;
|
||||
@@ -63,7 +63,7 @@ release_te_entry (
|
||||
const void* __entry
|
||||
) {
|
||||
struct h5_te_entry* entry = *(struct h5_te_entry**)__entry;
|
||||
h5_idlist_t* list = entry->value;
|
||||
h5_loc_idlist_t* list = entry->value;
|
||||
TRY( h5priv_free_idlist (f, &list) );
|
||||
TRY( h5_free (f, entry) );
|
||||
return H5_SUCCESS;
|
||||
@@ -94,7 +94,7 @@ h5tpriv_search_te2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t** idlist
|
||||
h5_loc_idlist_t** idlist
|
||||
) {
|
||||
h5t_fdata_t* t = f->t;
|
||||
h5t_adjacencies_t* a = &t->adjacencies;
|
||||
@@ -154,7 +154,7 @@ static inline h5_err_t
|
||||
find_te (
|
||||
h5_file_t* const f,
|
||||
h5t_te_entry_t* item, // in: item to find
|
||||
h5_idlist_t** idlist // out:
|
||||
h5_loc_idlist_t** idlist // out:
|
||||
) {
|
||||
void* __entry;
|
||||
TRY( h5priv_hsearch (
|
||||
@@ -182,7 +182,7 @@ h5_err_t
|
||||
h5tpriv_find_te (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t edge_id, // in
|
||||
h5_idlist_t** idlist // out
|
||||
h5_loc_idlist_t** idlist // out
|
||||
) {
|
||||
h5t_te_entry_t item;
|
||||
TRY( h5t_get_vertex_indices_of_edge (
|
||||
@@ -197,7 +197,7 @@ h5tpriv_find_te2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx, // in
|
||||
h5_loc_idx_t elem_idx, // in
|
||||
h5_idlist_t** idlist // out
|
||||
h5_loc_idlist_t** idlist // out
|
||||
) {
|
||||
h5t_te_entry_t item;
|
||||
TRY( h5t_get_vertex_indices_of_edge2 (
|
||||
@@ -218,25 +218,6 @@ cmp_td_entries (
|
||||
return memcmp (a->key.vids, b->key.vids, sizeof(a->key.vids));
|
||||
}
|
||||
|
||||
#if 0
|
||||
static unsigned int
|
||||
compute_td_hashval (
|
||||
const void* __item
|
||||
) {
|
||||
h5t_te_entry_t* item = (h5t_te_entry_t*)__item;
|
||||
unsigned char* key = (unsigned char*)item->key.vids;
|
||||
unsigned int count = sizeof (h5_3id_t);
|
||||
unsigned int hval = count;
|
||||
while (count-- > 0) {
|
||||
if (key[count]) {
|
||||
hval <<= 4;
|
||||
hval += key[count];
|
||||
}
|
||||
}
|
||||
return hval;
|
||||
}
|
||||
#endif
|
||||
|
||||
static unsigned int
|
||||
compute_td_hashval (
|
||||
const void* __item
|
||||
@@ -261,7 +242,7 @@ release_td_entry (
|
||||
const void* __entry
|
||||
) {
|
||||
struct h5_td_entry* entry = *(struct h5_td_entry**)__entry;
|
||||
h5_idlist_t* list = entry->value;
|
||||
h5_loc_idlist_t* list = entry->value;
|
||||
TRY( h5priv_free_idlist (f, &list) );
|
||||
TRY( h5_free (f, entry) );
|
||||
return H5_SUCCESS;
|
||||
@@ -293,7 +274,7 @@ h5tpriv_search_td2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t** idlist // out
|
||||
h5_loc_idlist_t** idlist // out
|
||||
) {
|
||||
h5t_fdata_t* t = f->t;
|
||||
h5t_adjacencies_t* a = &f->t->adjacencies;
|
||||
@@ -341,7 +322,7 @@ static inline h5_err_t
|
||||
find_td (
|
||||
h5_file_t* const f,
|
||||
h5t_td_entry_t* item,
|
||||
h5_idlist_t** idlist // out
|
||||
h5_loc_idlist_t** idlist // out
|
||||
) {
|
||||
void* __entry;
|
||||
h5priv_hsearch (
|
||||
@@ -362,7 +343,7 @@ h5_err_t
|
||||
h5tpriv_find_td (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t triangle_id,
|
||||
h5_idlist_t** idlist
|
||||
h5_loc_idlist_t** idlist
|
||||
) {
|
||||
h5t_td_entry_t item;
|
||||
TRY( h5t_get_vertex_indices_of_triangle (
|
||||
@@ -377,7 +358,7 @@ h5tpriv_find_td2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t** idlist
|
||||
h5_loc_idlist_t** idlist
|
||||
) {
|
||||
h5t_td_entry_t item;
|
||||
TRY( h5t_get_vertex_indices_of_triangle2 (
|
||||
@@ -396,7 +377,7 @@ h5tpriv_find_tv2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t** idlist
|
||||
h5_loc_idlist_t** idlist
|
||||
) {
|
||||
h5_loc_idx_t idx;
|
||||
TRY( idx = h5tpriv_get_loc_elem_vertex_idx (f, elem_idx, face_idx) );
|
||||
|
||||
@@ -15,12 +15,12 @@ typedef struct h5t_td_entry_key {
|
||||
*/
|
||||
typedef struct h5_te_entry {
|
||||
h5t_te_entry_key_t key;
|
||||
h5_idlist_t* value;
|
||||
h5_loc_idlist_t* value;
|
||||
} h5t_te_entry_t;
|
||||
|
||||
typedef struct h5_td_entry {
|
||||
h5t_td_entry_key_t key;
|
||||
h5_idlist_t* value;
|
||||
h5_loc_idlist_t* value;
|
||||
} h5t_td_entry_t;
|
||||
|
||||
h5_err_t
|
||||
@@ -34,7 +34,7 @@ h5tpriv_search_tv2 (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t **entry
|
||||
h5_loc_idlist_t **entry
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
@@ -42,14 +42,14 @@ h5tpriv_search_te2 (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t **entry
|
||||
h5_loc_idlist_t **entry
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5tpriv_find_te (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t edge_id,
|
||||
h5_idlist_t **retval
|
||||
h5_loc_idlist_t **retval
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
@@ -57,7 +57,7 @@ h5tpriv_find_te2 (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t **retval
|
||||
h5_loc_idlist_t **retval
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
@@ -71,14 +71,14 @@ h5tpriv_search_td2 (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t **entry
|
||||
h5_loc_idlist_t **entry
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5tpriv_find_td (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t triangle_id,
|
||||
h5_idlist_t **retval
|
||||
h5_loc_idlist_t **retval
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
@@ -86,7 +86,7 @@ h5tpriv_find_td2 (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t **rentry
|
||||
h5_loc_idlist_t **rentry
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
@@ -94,6 +94,6 @@ h5tpriv_find_tv2 (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t **retval
|
||||
h5_loc_idlist_t **retval
|
||||
);
|
||||
#endif
|
||||
|
||||
+11
-12
@@ -167,7 +167,7 @@ h5tpriv_rebuild_elem_indices_mapping (
|
||||
h5_idxmap_el_t *item = &t->map_elem_g2l.items[loc_idx];
|
||||
|
||||
for (; loc_idx < num_loc_elems; loc_idx++, item++) {
|
||||
item->glb_idx = h5tpriv_get_glb_elem_idx (f, loc_idx);
|
||||
item->glb_idx = h5tpriv_get_loc_elem_glb_idx (f, loc_idx);
|
||||
item->loc_idx = loc_idx;
|
||||
t->map_elem_g2l.num_items++;
|
||||
}
|
||||
@@ -185,19 +185,18 @@ h5t_get_vertex_indices_of_entity (
|
||||
const h5_loc_id_t entity_id, // in
|
||||
h5_loc_idx_t* vertex_indices // out
|
||||
) {
|
||||
static int map_entity_type_to_dimension[] = {
|
||||
-1,
|
||||
[H5_OID_VERTEX] = 0,
|
||||
[H5_OID_EDGE] = 1,
|
||||
[H5_OID_TRIANGLE] = 2,
|
||||
[H5_OID_TETRAHEDRON] = 3
|
||||
};
|
||||
|
||||
h5_loc_id_t entity_type = h5tpriv_get_entity_type (entity_id);
|
||||
h5_loc_idx_t type = h5tpriv_get_entity_type (entity_id);
|
||||
h5_loc_idx_t face_idx = h5tpriv_get_face_idx (entity_id);
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
|
||||
int dim = map_entity_type_to_dimension[entity_type];
|
||||
assert (dim >= 0);
|
||||
int dim = 0;
|
||||
switch (type) {
|
||||
case H5T_TYPE_VERTEX: dim = 0; break;
|
||||
case H5T_TYPE_EDGE: dim = 1; break;
|
||||
case H5T_TYPE_TRIANGLE: dim = 2; break;
|
||||
case H5T_TYPE_TET: dim = 3; break;
|
||||
default:
|
||||
h5_error_internal (f, __FILE__, __func__, __LINE__);
|
||||
}
|
||||
return h5t_get_vertex_indices_of_entity2 (f, dim, face_idx, elem_idx, vertex_indices);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,23 +142,23 @@ create_tag_types (
|
||||
h5_dtypes_t* dtypes = &f->t->dtypes;
|
||||
|
||||
TRY (
|
||||
dtypes->h5t_tag_idx_t = h5priv_create_hdf5_type (
|
||||
dtypes->h5t_glb_tag_idx_t = h5priv_create_hdf5_type (
|
||||
f,
|
||||
H5_COMPOUND_T,
|
||||
sizeof (h5t_tag_idx_t)) );
|
||||
sizeof (h5t_glb_tag_idx_t)) );
|
||||
TRY (
|
||||
h5priv_insert_hdf5_type (
|
||||
f,
|
||||
dtypes->h5t_tag_idx_t,
|
||||
dtypes->h5t_glb_tag_idx_t,
|
||||
"eid",
|
||||
HOFFSET (h5t_tag_idx_t, eid),
|
||||
HOFFSET (h5t_glb_tag_idx_t, eid),
|
||||
H5_ID_T) );
|
||||
TRY (
|
||||
h5priv_insert_hdf5_type (
|
||||
f,
|
||||
dtypes->h5t_tag_idx_t,
|
||||
dtypes->h5t_glb_tag_idx_t,
|
||||
"idx",
|
||||
HOFFSET (h5t_tag_idx_t, idx),
|
||||
HOFFSET (h5t_glb_tag_idx_t, idx),
|
||||
H5_ID_T) );
|
||||
|
||||
return H5_SUCCESS;
|
||||
@@ -500,8 +500,6 @@ release_elems (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
h5t_fdata_t* t = f->t;
|
||||
TRY( h5_free (f, t->glb_elems.data) );
|
||||
t->glb_elems.data = NULL;
|
||||
TRY( h5_free (f, t->loc_elems.data) );
|
||||
t->loc_elems.data = NULL;
|
||||
TRY( h5_free (f, t->num_elems) );
|
||||
|
||||
+34
-38
@@ -53,7 +53,12 @@ write_elems (
|
||||
h5t_fdata_t* t = f->t;
|
||||
assert (t->num_leaf_levels > 0);
|
||||
|
||||
t->dsinfo_elems.dims[0] = t->num_elems[t->num_leaf_levels-1];
|
||||
h5_loc_idx_t num_elems = t->num_elems[t->num_leaf_levels-1];
|
||||
// alloc and inititalize data in memory
|
||||
TRY( h5tpriv_alloc_glb_elems_struct (f, num_elems) );
|
||||
TRY( h5tpriv_init_glb_elems_struct (f) );
|
||||
|
||||
t->dsinfo_elems.dims[0] = num_elems;
|
||||
TRY( h5priv_write_dataset_by_name (
|
||||
f,
|
||||
t->mesh_gid,
|
||||
@@ -77,7 +82,9 @@ write_elems (
|
||||
open_space_all,
|
||||
open_space_all,
|
||||
t->num_elems_on_leaf_level) );
|
||||
|
||||
// release mem
|
||||
TRY( h5_free (f, t->glb_elems.data) );
|
||||
t->glb_elems.tets = NULL;
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -180,39 +187,6 @@ read_vertices (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static h5_err_t
|
||||
read_num_elems (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
h5t_fdata_t* t = f->t;
|
||||
|
||||
if (t->mesh_gid < 0) {
|
||||
return h5_error_internal (f, __FILE__, __func__, __LINE__);
|
||||
}
|
||||
size_t size = t->num_leaf_levels * sizeof (t->num_elems[0]);
|
||||
TRY( t->num_elems = h5_calloc (f, 1, size) );
|
||||
TRY( t->num_elems_on_leaf_level = h5_calloc (f, 1, size) );
|
||||
TRY( h5priv_read_dataset_by_name (
|
||||
f,
|
||||
t->mesh_gid,
|
||||
&t->dsinfo_num_elems,
|
||||
open_space_all,
|
||||
open_space_all,
|
||||
t->num_elems) );
|
||||
|
||||
TRY( h5priv_read_dataset_by_name (
|
||||
f,
|
||||
t->mesh_gid,
|
||||
&t->dsinfo_num_elems_on_leaf_level,
|
||||
open_space_all,
|
||||
open_space_all,
|
||||
t->num_elems_on_leaf_level) );
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
static hid_t
|
||||
open_mem_space_elems (
|
||||
h5_file_t* const f,
|
||||
@@ -239,7 +213,28 @@ read_elems (
|
||||
) {
|
||||
h5t_fdata_t* t = f->t;
|
||||
|
||||
TRY( h5tpriv_alloc_elems(f, 0, t->num_elems[t->num_leaf_levels-1]) );
|
||||
size_t size = t->num_leaf_levels * sizeof (t->num_elems[0]);
|
||||
TRY( t->num_elems = h5_calloc (f, 1, size) );
|
||||
TRY( t->num_elems_on_leaf_level = h5_calloc (f, 1, size) );
|
||||
TRY( h5priv_read_dataset_by_name (
|
||||
f,
|
||||
t->mesh_gid,
|
||||
&t->dsinfo_num_elems,
|
||||
open_space_all,
|
||||
open_space_all,
|
||||
t->num_elems) );
|
||||
|
||||
TRY( h5priv_read_dataset_by_name (
|
||||
f,
|
||||
t->mesh_gid,
|
||||
&t->dsinfo_num_elems_on_leaf_level,
|
||||
open_space_all,
|
||||
open_space_all,
|
||||
t->num_elems_on_leaf_level) );
|
||||
|
||||
h5_loc_idx_t num_elems = t->num_elems[t->num_leaf_levels-1];
|
||||
TRY( h5tpriv_alloc_elems (f, 0, num_elems) );
|
||||
TRY( h5tpriv_alloc_glb_elems_struct (f, num_elems) );
|
||||
TRY( h5priv_read_dataset_by_name (
|
||||
f,
|
||||
t->mesh_gid,
|
||||
@@ -274,14 +269,15 @@ h5tpriv_read_mesh (
|
||||
}
|
||||
TRY( read_num_leaf_levels (f) );
|
||||
TRY( read_num_vertices (f) );
|
||||
TRY( read_num_elems (f) );
|
||||
|
||||
TRY( read_vertices (f) );
|
||||
TRY( h5tpriv_rebuild_vertex_indices_mapping (f) );
|
||||
|
||||
TRY( read_elems (f) );
|
||||
TRY( h5tpriv_rebuild_elem_indices_mapping (f) );
|
||||
|
||||
TRY( h5tpriv_init_glb2loc_elem_map (f) );
|
||||
TRY( h5tpriv_init_loc_elems_struct (f, 0) );
|
||||
TRY( h5_free (f, t->glb_elems.data) );
|
||||
TRY( h5tpriv_update_adjacency_structs (f, 0) );
|
||||
TRY( h5tpriv_init_geom_boundary_info (f, 0) );
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
struct h5t_read_methods {
|
||||
h5_err_t (*init_loc_elems_struct)(h5_file_t* const, h5t_lvl_idx_t);
|
||||
h5_err_t (*init_geom_boundary_info)(h5_file_t* const, h5t_lvl_idx_t);
|
||||
h5_err_t (*alloc_glb_elems_struct)(h5_file_t* const, h5_loc_idx_t);
|
||||
h5_err_t (*init_glb2loc_elem_map)(h5_file_t* const);
|
||||
h5_err_t (*init_glb_elems_struct)(h5_file_t* const);
|
||||
};
|
||||
|
||||
extern struct h5t_read_methods h5tpriv_read_trim_methods;
|
||||
@@ -30,7 +33,6 @@ h5tpriv_write_mesh (
|
||||
h5_file_t * const f
|
||||
);
|
||||
|
||||
|
||||
static inline h5_err_t
|
||||
h5tpriv_init_loc_elems_struct (
|
||||
h5_file_t* const f,
|
||||
@@ -47,4 +49,26 @@ h5tpriv_init_geom_boundary_info (
|
||||
return (*f->t->methods.read->init_geom_boundary_info) (f, from_lvl);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
h5tpriv_alloc_glb_elems_struct (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t num_elems
|
||||
) {
|
||||
return (*f->t->methods.read->alloc_glb_elems_struct) (f, num_elems);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
h5tpriv_init_glb2loc_elem_map (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
return (*f->t->methods.read->init_glb2loc_elem_map) (f);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
h5tpriv_init_glb_elems_struct (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
return (*f->t->methods.read->init_glb_elems_struct) (f);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
@@ -90,7 +91,85 @@ init_geom_boundary_info (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
Alloc mem for elements
|
||||
*/
|
||||
static h5_err_t
|
||||
alloc_glb_elems_struct (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t num_elems
|
||||
) {
|
||||
h5t_fdata_t* const t = f->t;
|
||||
TRY ( t->glb_elems.tets = h5_calloc (
|
||||
f,
|
||||
num_elems,
|
||||
sizeof(t->glb_elems.tets[0]) ) );
|
||||
memset (
|
||||
t->glb_elems.tets,
|
||||
-1,
|
||||
(num_elems) * sizeof(t->glb_elems.tets[0]) );
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
static h5_err_t
|
||||
init_glb2loc_elem_map (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
h5_debug (f, "%s()", __func__);
|
||||
h5t_fdata_t* t = f->t;
|
||||
|
||||
if (t->num_leaf_levels <= 0) return H5_SUCCESS;
|
||||
|
||||
h5_loc_idx_t loc_idx = 0;
|
||||
h5_loc_idx_t num_loc_elems = t->num_elems[t->num_leaf_levels-1];
|
||||
h5_idxmap_el_t* item = &t->map_elem_g2l.items[loc_idx];
|
||||
h5_glb_tet_t* elem = t->glb_elems.tets;
|
||||
|
||||
for (; loc_idx < num_loc_elems; elem++, loc_idx++, item++) {
|
||||
item->glb_idx = elem->idx;
|
||||
item->loc_idx = loc_idx;
|
||||
t->map_elem_g2l.num_items++;
|
||||
}
|
||||
h5priv_sort_idxmap (&t->map_elem_g2l);
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
Setup data structure to be written on disk. We always write the hole mesh.
|
||||
*/
|
||||
static h5_err_t
|
||||
init_glb_elems_struct (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
h5t_fdata_t* const t = f->t;
|
||||
h5_loc_idx_t num_elems = t->num_elems[t->num_leaf_levels-1];
|
||||
|
||||
// simple in serial runs: global index = local index
|
||||
h5_loc_tet_t* loc_elem = t->loc_elems.tets;
|
||||
h5_glb_tet_t* glb_elem = t->glb_elems.tets;
|
||||
h5_loc_tet_t* end = loc_elem + num_elems;
|
||||
|
||||
while (loc_elem < end) {
|
||||
glb_elem->idx = loc_elem->glb_idx;
|
||||
glb_elem->parent_idx = loc_elem->parent_idx;
|
||||
glb_elem->child_idx = loc_elem->child_idx;
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
glb_elem->vertex_indices[i] = loc_elem->vertex_indices[i];
|
||||
glb_elem->neighbor_indices[i] = loc_elem->neighbor_indices[i];
|
||||
}
|
||||
loc_elem++;
|
||||
glb_elem++;
|
||||
}
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
struct h5t_read_methods h5tpriv_read_tetm_methods = {
|
||||
init_loc_elems_struct,
|
||||
init_geom_boundary_info,
|
||||
alloc_glb_elems_struct,
|
||||
init_glb2loc_elem_map,
|
||||
init_glb_elems_struct,
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "h5core/h5_core.h"
|
||||
#include "h5_core_private.h"
|
||||
|
||||
@@ -91,7 +92,85 @@ init_geom_boundary_info (
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
Alloc mem for elements
|
||||
*/
|
||||
static h5_err_t
|
||||
alloc_glb_elems_struct (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t num_elems
|
||||
) {
|
||||
h5t_fdata_t* const t = f->t;
|
||||
|
||||
TRY ( t->glb_elems.tris = h5_calloc (
|
||||
f,
|
||||
num_elems,
|
||||
sizeof(t->glb_elems.tris[0]) ) );
|
||||
memset (
|
||||
t->glb_elems.tris,
|
||||
-1,
|
||||
(num_elems) * sizeof(t->glb_elems.tris[0]) );
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
static h5_err_t
|
||||
init_glb2loc_elem_map (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
h5_debug (f, "%s()", __func__);
|
||||
h5t_fdata_t* t = f->t;
|
||||
|
||||
if (t->num_leaf_levels <= 0) return H5_SUCCESS;
|
||||
|
||||
h5_loc_idx_t loc_idx = 0;
|
||||
h5_loc_idx_t num_loc_elems = t->num_elems[t->num_leaf_levels-1];
|
||||
h5_idxmap_el_t* item = &t->map_elem_g2l.items[loc_idx];
|
||||
h5_glb_triangle_t* elem = t->glb_elems.tris;
|
||||
|
||||
for (; loc_idx < num_loc_elems; elem++, loc_idx++, item++) {
|
||||
item->glb_idx = elem->idx;
|
||||
item->loc_idx = loc_idx;
|
||||
t->map_elem_g2l.num_items++;
|
||||
}
|
||||
h5priv_sort_idxmap (&t->map_elem_g2l);
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
Setup data structure to be written on disk. We always write the hole mesh.
|
||||
*/
|
||||
static h5_err_t
|
||||
init_glb_elems_struct (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
h5t_fdata_t* const t = f->t;
|
||||
h5_loc_idx_t num_elems = t->num_elems[t->num_leaf_levels-1];
|
||||
|
||||
// simple in serial runs: global index = local index
|
||||
h5_loc_triangle_t* loc_elem = t->loc_elems.tris;
|
||||
h5_glb_triangle_t* glb_elem = t->glb_elems.tris;
|
||||
h5_loc_triangle_t* end = loc_elem + num_elems;
|
||||
|
||||
while (loc_elem < end) {
|
||||
glb_elem->idx = loc_elem->glb_idx;
|
||||
glb_elem->parent_idx = loc_elem->parent_idx;
|
||||
glb_elem->child_idx = loc_elem->child_idx;
|
||||
int i;
|
||||
for (i = 0; i < 3; i++) {
|
||||
glb_elem->vertex_indices[i] = loc_elem->vertex_indices[i];
|
||||
glb_elem->neighbor_indices[i] = loc_elem->neighbor_indices[i];
|
||||
}
|
||||
loc_elem++;
|
||||
glb_elem++;
|
||||
}
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
struct h5t_read_methods h5tpriv_read_trim_methods = {
|
||||
init_loc_elems_struct,
|
||||
init_geom_boundary_info,
|
||||
alloc_glb_elems_struct,
|
||||
init_glb2loc_elem_map,
|
||||
init_glb_elems_struct,
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ iterate_leaf_faces (
|
||||
h5t_iterator_t* iter
|
||||
) {
|
||||
h5t_leaf_iterator_t* it = (h5t_leaf_iterator_t*)iter;
|
||||
h5_idlist_t* entry;
|
||||
h5_loc_idlist_t* entry;
|
||||
int dim = h5tpriv_ref_elem_get_dim (it) - it->codim;
|
||||
int num_faces = h5tpriv_ref_elem_get_num_faces (it, dim) - 1;
|
||||
int i = -1;
|
||||
|
||||
+1
-51
@@ -66,59 +66,12 @@ assign_glb_elem_indices (
|
||||
h5_loc_idx_t loc_idx = (t->leaf_level == 0) ? 0 : t->num_elems[t->leaf_level-1];
|
||||
|
||||
for (; loc_idx < t->num_elems[t->leaf_level]; loc_idx++) {
|
||||
h5_generic_glb_elem_t *glb_elem = h5tpriv_get_glb_elem (f, loc_idx);
|
||||
|
||||
glb_elem->idx = loc_idx;
|
||||
h5tpriv_set_loc_elem_glb_idx (f, loc_idx, loc_idx);
|
||||
}
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
static h5_err_t
|
||||
assign_glb_elem_data (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
h5t_fdata_t* const t = f->t;
|
||||
|
||||
if (t->leaf_level < 0) return H5_SUCCESS; /* no level defined */
|
||||
|
||||
/*
|
||||
simple in serial runs: global index = local index
|
||||
*/
|
||||
h5_loc_idx_t loc_idx = (t->leaf_level == 0) ? 0 : t->num_elems[t->leaf_level-1];
|
||||
int num_vertices = h5tpriv_ref_elem_get_num_vertices (t);
|
||||
int dim = h5tpriv_ref_elem_get_dim (t) - 1;
|
||||
int num_faces = h5tpriv_ref_elem_get_num_faces(t, dim);
|
||||
for (; loc_idx < t->num_elems[t->leaf_level]; loc_idx++) {
|
||||
h5_generic_loc_elem_t *loc_elem = h5tpriv_get_loc_elem (f, loc_idx);
|
||||
h5_generic_glb_elem_t *glb_elem = h5tpriv_get_glb_elem (f, loc_idx);
|
||||
|
||||
glb_elem->parent_idx = loc_elem->parent_idx;
|
||||
if (loc_elem->parent_idx >= 0) {
|
||||
h5_generic_loc_elem_t *loc_parent = h5tpriv_get_loc_elem (
|
||||
f, loc_elem->parent_idx);
|
||||
h5_generic_glb_elem_t *glb_parent = h5tpriv_get_glb_elem (
|
||||
f, glb_elem->parent_idx);
|
||||
|
||||
glb_parent->child_idx = loc_parent->child_idx;
|
||||
}
|
||||
|
||||
glb_elem->child_idx = loc_elem->child_idx;
|
||||
|
||||
h5_glb_idx_t* glb_indices = h5tpriv_get_glb_elem_vertex_indices (f, loc_idx);
|
||||
h5_loc_idx_t* loc_indices = h5tpriv_get_loc_elem_vertex_indices (f, loc_idx);
|
||||
|
||||
memcpy (glb_indices, loc_indices, num_vertices*sizeof(*glb_indices));
|
||||
|
||||
glb_indices = h5tpriv_get_glb_elem_neighbor_indices (f, loc_idx);
|
||||
loc_indices = h5tpriv_get_loc_elem_neighbor_indices (f, loc_idx);
|
||||
|
||||
memcpy (glb_indices, loc_indices, num_faces*sizeof(*glb_indices));
|
||||
|
||||
}
|
||||
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
h5t_lvl_idx_t
|
||||
@@ -329,9 +282,6 @@ h5t_end_store_elems (
|
||||
/* mesh specific finalize */
|
||||
TRY( (t->methods.store->end_store_elems)(f) );
|
||||
|
||||
/* setup global element data */
|
||||
TRY( assign_glb_elem_data (f) );
|
||||
|
||||
h5_debug (f, "%s (): done", __func__);
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -11,16 +11,6 @@ alloc_tets (
|
||||
) {
|
||||
h5t_fdata_t *t = f->t;
|
||||
|
||||
/* alloc mem for elements */
|
||||
TRY ( t->glb_elems.tets = h5_alloc (
|
||||
f,
|
||||
t->glb_elems.tets,
|
||||
new * sizeof(t->glb_elems.tets[0]) ) );
|
||||
memset (
|
||||
t->glb_elems.tets + cur,
|
||||
-1,
|
||||
(new-cur) * sizeof(t->glb_elems.tets[0]) );
|
||||
|
||||
/* alloc mem for local data of elements */
|
||||
TRY ( t->loc_elems.tets = h5_alloc (
|
||||
f,
|
||||
@@ -84,7 +74,7 @@ bisect_edge (
|
||||
const h5_loc_idx_t elem_idx
|
||||
) {
|
||||
h5t_fdata_t* t = f->t;
|
||||
h5_idlist_t* retval;
|
||||
h5_loc_idlist_t* retval;
|
||||
/*
|
||||
get all elements sharing the given edge
|
||||
*/
|
||||
@@ -220,7 +210,6 @@ refine_tet (
|
||||
new_elem[3] = vertices[9];
|
||||
TRY( h5t_store_elem (f, elem_idx, new_elem) );
|
||||
|
||||
// t->glb_elems.tets[elem_idx].child_idx = elem_idx_of_first_child;
|
||||
t->loc_elems.tets[elem_idx].child_idx = elem_idx_of_first_child;
|
||||
t->num_elems_on_leaf_level[t->leaf_level]--;
|
||||
|
||||
@@ -235,7 +224,7 @@ compute_neighbor_of_face (
|
||||
) {
|
||||
|
||||
h5t_fdata_t * const t = f->t;
|
||||
h5_idlist_t* td;
|
||||
h5_loc_idlist_t* td;
|
||||
h5_loc_idx_t neighbor_idx = -2;
|
||||
|
||||
do {
|
||||
|
||||
@@ -11,16 +11,6 @@ alloc_triangles (
|
||||
) {
|
||||
h5t_fdata_t *t = f->t;
|
||||
|
||||
/* alloc mem for elements */
|
||||
TRY ( t->glb_elems.tris = h5_alloc (
|
||||
f,
|
||||
t->glb_elems.tris,
|
||||
new * sizeof(t->glb_elems.tris[0]) ) );
|
||||
memset (
|
||||
t->glb_elems.tris + cur,
|
||||
-1,
|
||||
(new-cur) * sizeof(t->glb_elems.tris[0]) );
|
||||
|
||||
/* alloc mem for local data of elements */
|
||||
TRY ( t->loc_elems.tris = h5_alloc (
|
||||
f,
|
||||
@@ -78,7 +68,7 @@ bisect_edge (
|
||||
const h5_loc_idx_t elem_idx
|
||||
) {
|
||||
h5t_fdata_t* const t = f->t;
|
||||
h5_idlist_t* retval;
|
||||
h5_loc_idlist_t* retval;
|
||||
/*
|
||||
get all elements sharing the given edge
|
||||
*/
|
||||
@@ -179,7 +169,6 @@ refine_triangle (
|
||||
new_elem[2] = vertices[5];
|
||||
TRY( h5t_store_elem (f, elem_idx, new_elem) );
|
||||
|
||||
t->glb_elems.tris[elem_idx].child_idx = elem_idx_of_first_child;
|
||||
t->loc_elems.tris[elem_idx].child_idx = elem_idx_of_first_child;
|
||||
t->num_elems_on_leaf_level[t->leaf_level]--;
|
||||
|
||||
@@ -194,7 +183,7 @@ compute_neighbor_of_face (
|
||||
) {
|
||||
|
||||
h5t_fdata_t * const t = f->t;
|
||||
h5_idlist_t* te;
|
||||
h5_loc_idlist_t* te;
|
||||
h5_loc_idx_t neighbor_idx = -2;
|
||||
|
||||
do {
|
||||
|
||||
+41
-21
@@ -148,7 +148,7 @@ add_tagset (
|
||||
// check if a tagset with given name already exists
|
||||
h5_err_t h5err;
|
||||
TRY( h5err = tagset_exists (f, ctn, name) );
|
||||
if (h5err != H5_SUCCESS) {
|
||||
if (h5err == H5_SUCCESS) {
|
||||
return h5_error (f, H5_ERR_INVAL,
|
||||
"Tagset with name %s already exists!",
|
||||
name);
|
||||
@@ -163,6 +163,8 @@ add_tagset (
|
||||
TRY( tagset->name = h5priv_strdup (f, name) );
|
||||
tagset->type = type;
|
||||
tagset->num_elems = t->num_elems[t->num_leaf_levels-1];
|
||||
tagset->scope.min_level = 32767;
|
||||
tagset->scope.max_level = -1;
|
||||
|
||||
// add tagset to hash of tagsets
|
||||
TRY( h5priv_hsearch (f, tagset, H5_ENTER, NULL, &ctn->sets) );
|
||||
@@ -465,7 +467,7 @@ set_tag (
|
||||
}
|
||||
h5t_tageleminfo_t* eleminfo = tagset->elems[elem_idx];
|
||||
int i = find_face_id (eleminfo, face_id);
|
||||
h5t_taginfo_t* ti = eleminfo->ti + i; // maybe an invalid pointer!!!
|
||||
h5t_taginfo_t* ti = eleminfo->ti + i;
|
||||
if (i >= 0 && dim != ti->val_dim) {
|
||||
/*
|
||||
This is a very unusual case! So the processing can be
|
||||
@@ -669,7 +671,7 @@ open_space_all (
|
||||
}
|
||||
|
||||
/*
|
||||
Store given tagset.
|
||||
Write tagset to disk.
|
||||
*/
|
||||
static h5_err_t
|
||||
write_tagset (
|
||||
@@ -680,12 +682,12 @@ write_tagset (
|
||||
h5t_fdata_t* t = f->t;
|
||||
h5t_tageleminfo_t** eleminfos = tagset->elems;
|
||||
hid_t group_id;
|
||||
h5t_tag_idx_t* elems = NULL;
|
||||
h5t_tag_idx_t* elem = NULL;
|
||||
h5t_glb_tag_idx_t* elems = NULL; // in memory dataset
|
||||
h5t_glb_tag_idx_t* elem = NULL; // reference an element in elems
|
||||
h5_loc_idx_t num_elems = 0;
|
||||
h5t_tag_idx_t* entities = NULL;
|
||||
h5t_tag_idx_t* entity = NULL;
|
||||
h5t_tagval_t* values = NULL;
|
||||
h5t_glb_tag_idx_t* entities = NULL;// in memory dataset
|
||||
h5t_glb_tag_idx_t* entity = NULL; // reference an element in entities
|
||||
h5t_tagval_t* values = NULL; // in memory dataset
|
||||
|
||||
h5_loc_idx_t elem_idx = 0;
|
||||
h5_loc_idx_t entity_idx = 0;
|
||||
@@ -722,10 +724,11 @@ write_tagset (
|
||||
|
||||
// loop over tagged faces of this element
|
||||
int ti_idx;
|
||||
for (ti_idx = 0; ti_idx < eleminfo->num_tags; ti_idx++) {
|
||||
for (ti_idx = 0; eleminfo && ti_idx < eleminfo->num_tags; ti_idx++) {
|
||||
h5t_taginfo_t* ti = eleminfo->ti+ti_idx;
|
||||
|
||||
entity->eid = h5tpriv_build_entity_id2 (ti->face_id, elem_idx);
|
||||
h5_glb_idx_t glb_elem_idx = h5tpriv_get_loc_elem_glb_idx (f, elem_idx);
|
||||
entity->eid = h5tpriv_build_entity_id2 (
|
||||
(h5_glb_id_t)ti->face_id, glb_elem_idx);
|
||||
entity->idx = val_idx;
|
||||
|
||||
// copy values
|
||||
@@ -737,7 +740,7 @@ write_tagset (
|
||||
entity++;
|
||||
}
|
||||
elem_idx++;
|
||||
eleminfos++;
|
||||
eleminfos++;
|
||||
elem++;
|
||||
}
|
||||
elem->eid = -1; // last entry
|
||||
@@ -756,7 +759,7 @@ write_tagset (
|
||||
|
||||
strcpy (dsinfo.name, "elems");
|
||||
dsinfo.dims[0] = num_elems + 1;
|
||||
dsinfo.type_id = t->dtypes.h5t_tag_idx_t;
|
||||
dsinfo.type_id = t->dtypes.h5t_glb_tag_idx_t;
|
||||
TRY( dsinfo.create_prop = h5priv_create_hdf5_property (f,
|
||||
H5P_DATASET_CREATE ) );
|
||||
TRY( h5priv_set_hdf5_chunk_property (f, dsinfo.create_prop, dsinfo.rank,
|
||||
@@ -787,10 +790,14 @@ write_tagset (
|
||||
f,
|
||||
group_id,
|
||||
&dsinfo,
|
||||
open_space_all, open_space_all,
|
||||
open_space_all, open_space_all,
|
||||
values) );
|
||||
|
||||
h5_int64_t scope = tagset->scope.min_level;
|
||||
TRY( h5priv_write_attrib (f, group_id, "__scope_min__", H5_INT64_T, &scope, 1) );
|
||||
scope = tagset->scope.max_level;
|
||||
TRY( h5priv_write_attrib (f, group_id, "__scope_max__", H5_INT64_T, &scope, 1) );
|
||||
cleanup:
|
||||
TRY( h5priv_close_hdf5_group (f, group_id) );
|
||||
TRY( h5_free (f, elems) );
|
||||
TRY( h5_free (f, entities) );
|
||||
TRY( h5_free (f, values) );
|
||||
@@ -861,7 +868,7 @@ read_tagset (
|
||||
/*
|
||||
read datasets: "elems", "entities" and "values"
|
||||
*/
|
||||
h5t_tag_idx_t* elems;
|
||||
h5t_glb_tag_idx_t* elems;
|
||||
size_t num_elems = 0;
|
||||
|
||||
TRY( dset_id = h5priv_open_hdf5_dataset (f, group_id, "elems") );
|
||||
@@ -869,7 +876,7 @@ read_tagset (
|
||||
TRY( elems = h5_calloc (f, num_elems, sizeof(*elems)) );
|
||||
h5_dsinfo_t dsinfo;
|
||||
memset (&dsinfo, 0, sizeof (dsinfo));
|
||||
dsinfo.type_id = t->dtypes.h5t_tag_idx_t;
|
||||
dsinfo.type_id = t->dtypes.h5t_glb_tag_idx_t;
|
||||
TRY( h5priv_read_dataset (
|
||||
f,
|
||||
dset_id,
|
||||
@@ -879,7 +886,7 @@ read_tagset (
|
||||
TRY( h5priv_close_hdf5_dataset (f, dset_id) );
|
||||
num_elems--;
|
||||
|
||||
h5t_tag_idx_t* entities;
|
||||
h5t_glb_tag_idx_t* entities;
|
||||
size_t ent_idx = 0;
|
||||
size_t num_entities = 0;
|
||||
TRY( dset_id = h5priv_open_hdf5_dataset (f, group_id, "entities") );
|
||||
@@ -913,14 +920,27 @@ read_tagset (
|
||||
*/
|
||||
h5t_tagset_t* tagset;
|
||||
TRY( add_tagset (f, ctn, name, type, &tagset) );
|
||||
|
||||
h5_int64_t scope;
|
||||
TRY( h5priv_read_attrib (f, group_id, "__scope_min__", H5_INT64_T, &scope) );
|
||||
tagset->scope.min_level = scope;
|
||||
TRY( h5priv_read_attrib (f, group_id, "__scope_max__", H5_INT64_T, &scope) );
|
||||
tagset->scope.max_level = scope;
|
||||
|
||||
for (ent_idx = 0; ent_idx < num_entities; ent_idx++) {
|
||||
h5t_tag_idx_t *entity = &entities[ent_idx];
|
||||
h5t_glb_tag_idx_t *entity = &entities[ent_idx];
|
||||
size_t dim = (entity+1)->idx - entity->idx;
|
||||
// map global face id and global element idx to local
|
||||
h5_loc_idx_t face_id;
|
||||
h5_loc_idx_t elem_idx;
|
||||
h5_glb_idx_t glb_elem_idx = h5tpriv_get_elem_idx (entity->eid);
|
||||
TRY( elem_idx = h5t_map_glb_elem_idx2loc (f, glb_elem_idx) );
|
||||
face_id = h5tpriv_get_face_id (entity->eid);
|
||||
TRY( set_tag (
|
||||
f,
|
||||
tagset,
|
||||
h5tpriv_get_face_id (entity->eid),
|
||||
h5tpriv_get_elem_idx (entity->eid),
|
||||
face_id,
|
||||
elem_idx,
|
||||
dim,
|
||||
&vals[entity->idx] ) );
|
||||
}
|
||||
|
||||
@@ -84,7 +84,12 @@ struct h5t_tagcontainer {
|
||||
typedef struct {
|
||||
h5_glb_id_t eid ; // global entity id
|
||||
h5_glb_idx_t idx; // global index
|
||||
} h5t_tag_idx_t;
|
||||
} h5t_glb_tag_idx_t;
|
||||
|
||||
typedef struct {
|
||||
h5_loc_id_t eid ; // local entity id
|
||||
h5_loc_idx_t idx; // local index
|
||||
} h5t_loc_tag_idx_t;
|
||||
|
||||
h5_err_t h5tpriv_write_mtags ( h5_file_t *const f );
|
||||
h5_err_t h5tpriv_release_tags ( h5_file_t * const f );
|
||||
|
||||
@@ -6,10 +6,7 @@ typedef struct h5_glb_vertex {
|
||||
h5_coord3d_t P;
|
||||
} h5_glb_vertex_t;
|
||||
|
||||
typedef struct h5_loc_vertex {
|
||||
h5_loc_idx_t idx;
|
||||
h5_coord3d_t P;
|
||||
} h5_loc_vertex_t;
|
||||
typedef struct h5_glb_vertex h5_loc_vertex_t;
|
||||
|
||||
typedef struct h5_glb_triangle {
|
||||
h5_glb_idx_t idx;
|
||||
@@ -92,13 +89,13 @@ typedef struct h5_dtypes {
|
||||
hid_t h5_vertex_t; /* vertex structure */
|
||||
hid_t h5_triangle_t; /* triangle structure */
|
||||
hid_t h5_tet_t; /* tetrahedron structure */
|
||||
hid_t h5t_tag_idx_t;
|
||||
hid_t h5t_glb_tag_idx_t;
|
||||
} h5_dtypes_t;
|
||||
|
||||
typedef struct h5t_adjacencies {
|
||||
struct {
|
||||
// h5_size_t size;
|
||||
h5_idlist_t** v;
|
||||
h5_loc_idlist_t** v;
|
||||
} tv;
|
||||
h5_hashtable_t te_hash;
|
||||
h5_hashtable_t td_hash;
|
||||
@@ -166,7 +163,7 @@ typedef struct h5t_fdata {
|
||||
h5_dsinfo_t dsinfo_num_elems;
|
||||
h5_dsinfo_t dsinfo_num_elems_on_leaf_level;
|
||||
|
||||
h5_idlist_t* marked_entities;
|
||||
h5_loc_idlist_t* marked_entities;
|
||||
|
||||
/*** Adjacencies ***/
|
||||
h5t_adjacencies_t adjacencies;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ H5FedCloseMesh (
|
||||
h5_err_t
|
||||
H5FedSetLevel (
|
||||
h5_file_t * f,
|
||||
const h5_id_t level_id
|
||||
const h5t_lvl_idx_t level_id
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -6,13 +6,13 @@ H5FedGetAdjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t** list
|
||||
h5_loc_idlist_t** list
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedReleaseListOfAdjacencies (
|
||||
h5_file_t * const f,
|
||||
h5_idlist_t **list
|
||||
h5_loc_idlist_t **list
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -55,10 +55,10 @@ H5FedBeginStoreElements (
|
||||
);
|
||||
|
||||
|
||||
h5_err_t
|
||||
h5_loc_idx_t
|
||||
H5FedStoreElement (
|
||||
h5_file_t * const f,
|
||||
const h5_loc_idx_t vertex_indices[]
|
||||
h5_file_t* const f,
|
||||
const h5_loc_idx_t local_vids[]
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -42,9 +42,11 @@ typedef int64_t h5_id_t;
|
||||
typedef int16_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_loc_idx_t; // type for a local index
|
||||
typedef int32_t h5_loc_idx_t; // type for a local index
|
||||
typedef int64_t h5_glb_id_t; // type for a global ID
|
||||
typedef int64_t h5_loc_id_t; // type for a local ID
|
||||
//typedef int64_t h5_loc_id_t; // type for a local ID
|
||||
typedef int32_t h5_loc_id_t; // type for a local ID
|
||||
typedef uint64_t h5_size_t; /* size in number of elements */
|
||||
typedef int64_t h5_ssize_t; /* size in number of elements */
|
||||
typedef int64_t h5_err_t;
|
||||
@@ -56,12 +58,8 @@ typedef struct h5_complex {
|
||||
h5_float64_t r,i;
|
||||
} h5_complex_t;
|
||||
|
||||
typedef h5_id_t h5_2id_t[2];
|
||||
typedef h5_id_t h5_3id_t[3];
|
||||
typedef h5_id_t h5_4id_t[4];
|
||||
typedef h5_float64_t h5_coord3d_t[3];
|
||||
|
||||
|
||||
struct h5_file;
|
||||
typedef struct h5_file h5_file_t;
|
||||
|
||||
@@ -75,11 +73,11 @@ typedef unsigned long MPI_Comm;
|
||||
typedef unsigned long MPI_Datatype;
|
||||
#endif
|
||||
|
||||
typedef struct h5_idlist {
|
||||
typedef struct h5_loc_idlist {
|
||||
int32_t size; /* allocated space in number of items */
|
||||
int32_t num_items; /* stored items */
|
||||
h5_id_t items[1];
|
||||
} h5_idlist_t;
|
||||
h5_loc_id_t items[1];
|
||||
} h5_loc_idlist_t;
|
||||
|
||||
struct h5_idxmap;
|
||||
typedef struct h5_idxmap h5_idxmap_t;
|
||||
|
||||
@@ -6,13 +6,13 @@ h5t_get_adjacencies (
|
||||
h5_file_t * const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_idlist_t **list
|
||||
h5_loc_idlist_t **list
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_release_list_of_adjacencies (
|
||||
h5_file_t * const f,
|
||||
h5_idlist_t **list
|
||||
h5_loc_idlist_t **list
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
@@ -20,7 +20,7 @@ h5t_find_te2 (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_idlist_t** retval
|
||||
h5_loc_idlist_t** retval
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef __H5T_MAP_H
|
||||
#define __H5T_MAP_H
|
||||
|
||||
h5_id_t
|
||||
h5_loc_idx_t
|
||||
h5t_map_global_vertex_idx2local (
|
||||
h5_file_t * const f,
|
||||
h5_file_t* const f,
|
||||
h5_glb_idx_t glb_idx
|
||||
);
|
||||
|
||||
@@ -33,7 +33,7 @@ h5_err_t
|
||||
h5t_get_vertex_index_of_vertex (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_id_t* vertex_index
|
||||
h5_loc_idx_t* vertex_index
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -11,8 +11,8 @@ typedef struct {
|
||||
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_id_t face_idx,
|
||||
h5_id_t elem_idx, h5_idlist_t **retval);
|
||||
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);
|
||||
} h5t_leaf_iterator_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -22,8 +22,8 @@ typedef struct {
|
||||
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_id_t face_idx,
|
||||
h5_id_t elem_idx, h5_idlist_t **retval);
|
||||
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);
|
||||
} h5t_level_iterator_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -73,7 +73,7 @@ h5t_release_entity_iterator (
|
||||
h5t_iterator_t* iter
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5_loc_id_t
|
||||
h5t_iterate_entities (
|
||||
h5_file_t * const f,
|
||||
h5t_iterator_t *iter
|
||||
|
||||
@@ -18,7 +18,7 @@ h5t_begin_store_vertices (
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5_loc_id_t
|
||||
h5t_store_vertex (
|
||||
h5_file_t * const f,
|
||||
const h5_glb_id_t glb_id,
|
||||
@@ -53,7 +53,7 @@ h5t_begin_refine_elems (
|
||||
h5_file_t * const f
|
||||
);
|
||||
|
||||
h5_id_t
|
||||
h5_err_t
|
||||
h5t_refine_marked_elems (
|
||||
h5_file_t * const f
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user