Commit 65757c19 authored by gsell's avatar gsell
Browse files

bug fixes, some private functions renamed, formating changes

parent 80523c6d
# src/C level Makefile.am
if ENABLE_C
# Header files that I wish to install in $(prefix)/include
include_HEADERS = \
../include/H5.h \
......@@ -22,6 +22,7 @@ include_HEADERS = \
# Listing of all possible headers that I may include
EXTRA_HEADERS =
endif
clean-local:
$(RM) *~
# src/Fortran level Makefile.am
OBJEXT=o
if ENABLE_FORTRAN
AM_CPPFLAGS += -I$(top_srcdir)/src/include
AM_CPPFLAGS = -I../include @AM_CPPFLAGS@
F90_FILES = H5F.f90 \
H5_constF.f90 \
H5_attribsF.f90 \
H5PartF.f90 \
H5Part_ioF.f90 \
H5BlockF.f90 \
H5Block_attribsF.f90 \
H5Block_ioF.f90
F90_FILES = \
H5F.f90 \
H5_constF.f90 \
H5_attribsF.f90 \
H5PartF.f90 \
H5Part_ioF.f90 \
H5BlockF.f90 \
H5Block_attribsF.f90 \
H5Block_ioF.f90
EXTRA_HEADERS =
# Extra files that I wish to include in the dist tar ball.
EXTRA_DIST = TestUnderscoreC.c \
TestUnderscore.f \
$(F90_FILES)
# Files that I don't want to include in the dist tar ball
nodist_include_HEADERS = ../include/H5hutF.h
EXTRA_DIST = \
TestUnderscoreC.c \
TestUnderscore.f \
$(F90_FILES)
# What to build... Will be determined by configure script.
lib_LTLIBRARIES = @LIB_FORTRAN@
nodist_include_HEADERS = \
$(top_srcdir)/src/include/H5hutF.h
# Listing of all possible targets that I may build.
EXTRA_LTLIBRARIES = libH5hutF.la
lib_LTLIBRARIES = libH5hutF.la
include_HEADERS = \
../include/H5hutF.h
......@@ -41,17 +36,19 @@ libH5hutF_la_SOURCES = \
H5Block_attribs.c \
H5Block_io.c
libH5hutF_la_DEPENDENCIES =
libH5hutF_la_DEPENDENCIES = \
$(top_srcdir)/src/include/H5hutF.h
libH5hutF_la_LDFLAGS = -version-info 2:0:0 -rpath '$(libdir)'
../include/H5hutF.h: $(F90_FILES)
$(top_srcdir)/src/include/H5hutF.h: $(F90_FILES)
awk '/INTEGER\*8 :: /{print "\t" $$0}' $^ >$@
awk '/PARAMETER /{print "\t" $$0}' $^ >> $@
awk '/INTEGER\*8 FUNCTION/{print "\t" $$1 " " $$3}' $^ >>$@
all-local: ../include/H5hutF.h
$(INSTALL) -m644 .libs/libH5hutF.a ../lib
endif
clean: clean-am
......
# test level Makefile.am
SUBDIRS = h5core @BINDINGS@
SUBDIRS = h5core C Fortran include
# src level Makefile.am
OBJEXT=o
AM_CPPFLAGS = -I$(top_srcdir)/src/include @AM_CPPFLAGS@
......@@ -103,13 +100,13 @@ libH5hut_la_DEPENDENCIES = $(EXTRA_HEADERS)
libH5hut_la_LDFLAGS = -version-info 2:0:0
all-local:
$(INSTALL) -m755 -d ../lib
$(INSTALL) -m644 .libs/libH5hut.a ../lib
$(INSTALL) -m0755 -d $(top_builddir)/src/lib
$(INSTALL) -m644 .libs/libH5hut.a $(top_builddir)/src/lib
install-exec-local:
@$(INSTALL) -d $(DESTDIR)$(includedir)/h5core
@$(INSTALL) -m644 ../include/h5core/*.h $(DESTDIR)$(includedir)/h5core/
@$(INSTALL) -m644 $(top_srcdir)/src/include/h5core/*.h $(DESTDIR)$(includedir)/h5core/
clean-local:
$(RM) -f ../lib/libH5hut.*
$(RM) -f $(top_srcdir)/src/lib/libH5hut.*
$(RM) -f *~
......@@ -205,7 +205,8 @@ copy_glb_elems (
return (h5_glb_elem_t*)dst;
}
int compare_glb_elems(const void *p_a, const void *p_b) {
static int
compare_glb_elems(const void *p_a, const void *p_b) {
return ((h5_glb_tet_t*) p_a)->idx - ((h5_glb_tet_t*) p_b)->idx;
}
......
......@@ -203,7 +203,8 @@ copy_glb_elems (
return (h5_glb_elem_t*)dst;
}
int compare_glb_elems(const void *p_a, const void *p_b) {
static int
compare_glb_elems(const void *p_a, const void *p_b) {
return ((h5_glb_tri_t*) p_a)->idx - ((h5_glb_tri_t*) p_b)->idx;
}
......
......@@ -292,7 +292,7 @@ get_edges_uadj_to_vertex (
"m=%p, entity_id=%llu, list=%p",
m, (long long unsigned)entity_id, list);
h5_loc_idx_t vertex_idx;
TRY( h5tpriv_get_vertex_index_of_vertex (m, entity_id, &vertex_idx) );
TRY( h5tpriv_get_loc_vtx_idx_of_vtx (m, entity_id, &vertex_idx) );
h5_loc_idlist_t* tv = m->adjacencies.tv.v[vertex_idx];
TRY( h5priv_alloc_loc_idlist (list, 8) );
......@@ -335,7 +335,7 @@ get_triangles_uadj_to_vertex (
Note: this list may include tetrahedra which are not in
the (current) leaf grid */
h5_loc_idx_t vertex_idx;
TRY( h5tpriv_get_vertex_index_of_vertex (m, entity_id, &vertex_idx) );
TRY( h5tpriv_get_loc_vtx_idx_of_vtx (m, entity_id, &vertex_idx) );
h5_loc_idlist_t* tv = m->adjacencies.tv.v[vertex_idx];
// build list of upward adjacent triangles
......@@ -375,7 +375,7 @@ get_tets_uadj_to_vertex (
"m=%p, entity_id=%llu, list=%p",
m, (long long unsigned)entity_id, list);
h5_loc_idx_t vertex_idx;
TRY( h5tpriv_get_vertex_index_of_vertex (m, entity_id, &vertex_idx) );
TRY( h5tpriv_get_loc_vtx_idx_of_vtx (m, entity_id, &vertex_idx) );
h5_loc_idlist_t* tv = m->adjacencies.tv.v[vertex_idx];
TRY( h5priv_alloc_loc_idlist (list, 8) );
......
......@@ -168,7 +168,7 @@ get_edges_uadj_to_vertex (
"m=%p, entity_id=%llu, list=%p",
m, (long long unsigned)entity_id, list);
h5_loc_idx_t vertex_idx;
TRY( h5tpriv_get_vertex_index_of_vertex (m, entity_id, &vertex_idx) );
TRY( h5tpriv_get_loc_vtx_idx_of_vtx (m, entity_id, &vertex_idx) );
h5_loc_idlist_t* tv = m->adjacencies.tv.v[vertex_idx];
TRY( h5priv_alloc_loc_idlist (list, 8) );
......@@ -204,7 +204,7 @@ get_triangles_uadj_to_vertex (
"m=%p, entity_id=%llu, list=%p",
m, (long long unsigned)entity_id, list);
h5_loc_idx_t vertex_idx;
TRY( h5tpriv_get_vertex_index_of_vertex (m, entity_id, &vertex_idx) );
TRY( h5tpriv_get_loc_vtx_idx_of_vtx (m, entity_id, &vertex_idx) );
h5_loc_idlist_t* tv = m->adjacencies.tv.v[vertex_idx];
TRY ( h5priv_alloc_loc_idlist (list, 8) );
......
......@@ -32,7 +32,7 @@ h5tpriv_enter_tv2 (
m, (long long)face_idx, (long long)elem_idx, idlist);
h5_loc_idx_t vertex_idx;
TRY (h5t_get_loc_vertex_index_of_vertex2 (
TRY (h5tpriv_get_loc_vtx_idx_of_vtx2 (
m,
face_idx, elem_idx,
&vertex_idx));
......
......@@ -303,7 +303,7 @@ h5t_get_glb_vertex_indices_of_entity (
}
h5_err_t
h5tpriv_get_vertex_index_of_vertex (
h5tpriv_get_loc_vtx_idx_of_vtx (
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_index
......@@ -315,12 +315,12 @@ h5tpriv_get_vertex_index_of_vertex (
(long long unsigned)*vertex_index);
h5_loc_idx_t face_idx = h5tpriv_get_face_idx (entity_id);
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
H5_CORE_API_RETURN (h5tpriv_get_vertex_index_of_vertex2 (
H5_CORE_API_RETURN (h5tpriv_get_loc_vtx_idx_of_vtx2 (
m, face_idx, elem_idx, vertex_index));
}
h5_err_t
h5tpriv_get_vertex_index_of_vertex2 (
h5tpriv_get_loc_vtx_idx_of_vtx2 (
h5t_mesh_t* const m,
const h5_loc_idx_t face_idx, // vertex index according ref. element
const h5_loc_idx_t elem_idx, // local element index
......
......@@ -69,14 +69,14 @@ h5priv_find_in_idlist (glb_id)
h5priv_search_in_xlist (glb_id)
h5_err_t
h5tpriv_get_vertex_index_of_vertex (
h5tpriv_get_loc_vtx_idx_of_vtx (
h5t_mesh_t* const m,
const h5_loc_id_t entity_id,
h5_loc_idx_t* vertex_index
);
h5_err_t
h5tpriv_get_vertex_index_of_vertex2 (
h5tpriv_get_loc_vtx_idx_of_vtx2 (
h5t_mesh_t* const m,
const h5_loc_idx_t face_idx,
const h5_loc_idx_t elem_idx,
......
......@@ -191,7 +191,8 @@ h5tpriv_init_mesh (
"__num_leaf_levels__",
H5T_NATIVE_INT16,
&m->num_leaf_levels));
m->leaf_level = m->num_leaf_levels-1; //seems not to be set otherwise but for reading vtx it should be...
//seems not to be set otherwise but for reading vtx it should be...
m->leaf_level = m->num_leaf_levels-1;
TRY (m->num_glb_elems = h5_calloc (m->num_leaf_levels, sizeof(*m->num_glb_elems)));
TRY (m->num_glb_leaf_elems = h5_calloc (m->num_leaf_levels, sizeof(*m->num_glb_leaf_elems)));
TRY (m->num_glb_vertices = h5_calloc (m->num_leaf_levels, sizeof (*m->num_glb_vertices)));
......
......@@ -137,6 +137,7 @@ h5_err_t
h5t_add_tetrahedral_mesh (
const h5_file_t fh,
const char* name,
const h5_weight_t num_weights,
h5t_mesh_t** mesh
) {
h5_file_p f = (h5_file_p)fh;
......@@ -177,11 +178,13 @@ h5t_add_tetrahedral_mesh (
m->leaf_level = 0;
m->num_leaf_levels = 0;
m->num_weights = num_weights;
TRY (h5tpriv_add_level (m));
m->mesh_changed = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
}
/*!
Add new mesh
......@@ -191,6 +194,7 @@ h5_err_t
h5t_add_chunked_tetrahedral_mesh (
const h5_file_t fh,
const char* name,
const h5_weight_t num_weights,
h5t_mesh_t** mesh
) {
h5_file_p f = (h5_file_p)fh;
......
......@@ -153,6 +153,7 @@ h5_err_t
h5t_add_triangle_mesh (
const h5_file_t fh,
const char* name,
const h5_weight_t num_weights,
h5t_mesh_t** mesh
) {
h5_file_p f = (h5_file_p)fh;
......@@ -207,6 +208,7 @@ h5_err_t
h5t_add_chunked_triangle_mesh(
const h5_file_t fh,
const char* name,
const h5_weight_t num_weights,
h5t_mesh_t** mesh
) {
h5_file_p f = (h5_file_p)fh;
......
......@@ -319,7 +319,7 @@ h5t_get_vertex_coords_by_id (
(long long unsigned)vertex_id,
P);
h5_loc_idx_t vertex_index;
TRY (h5tpriv_get_vertex_index_of_vertex (m, vertex_id, &vertex_index));
TRY (h5tpriv_get_loc_vtx_idx_of_vtx (m, vertex_id, &vertex_index));
TRY (h5t_get_vertex_coords_by_index (m, vertex_index, P));
H5_CORE_API_RETURN (H5_SUCCESS);
}
......@@ -336,7 +336,7 @@ h5t_get_vertex_by_id (
m, (long long)vertex_id, glb_idx, P);
// get loc index of vertex
h5_loc_idx_t idx;
TRY (h5t_get_loc_vertex_index_of_vertex (m, vertex_id, &idx));
TRY (h5tpriv_get_loc_vtx_idx_of_vtx (m, vertex_id, &idx));
*glb_idx = m->vertices[idx].idx;
*P = m->vertices[idx].P;
H5_CORE_API_RETURN (H5_SUCCESS);
......
......@@ -497,12 +497,11 @@ h5t_end_store_vertices (
h5_err_t
h5t_begin_store_elems (
h5t_mesh_t* const m,
const h5_size_t num,
const h5_weight_t num_weights
const h5_size_t num
) {
H5_CORE_API_ENTER (h5_err_t,
"m=%p, num=%llu, num_weights=%d",
m, (long long unsigned)num, num_weights);
"m=%p, num=%llu",
m, (long long unsigned)num);
h5_debug ("begin storing %llu elements", (long long)num);
size_t cur = m->leaf_level > 0 ? m->num_interior_elems[m->leaf_level-1] : 0;
......@@ -515,9 +514,8 @@ h5t_begin_store_elems (
m->num_interior_leaf_elems[m->leaf_level] = m->leaf_level > 0 ?
num + m->num_interior_leaf_elems[m->leaf_level-1] : num;
m->num_weights = num_weights;
if (m->leaf_level == 0) {
TRY (m->weights = h5_calloc(num_weights * num, sizeof (* m->weights) ));
TRY (m->weights = h5_calloc(m->num_weights * num, sizeof (* m->weights) ));
if (m->num_weights < 1) {
m->weights = NULL;
}
......@@ -541,13 +539,13 @@ h5t_begin_store_elems (
tetrahedron.
*/
h5_loc_idx_t
h5t_store_elem (
h5tpriv_add_cell (
h5t_mesh_t* const m,
const h5_loc_idx_t parent_idx,
const h5_loc_idx_t* vertex_indices,
const h5_weight_t* weights
) {
H5_CORE_API_ENTER (h5_loc_idx_t,
H5_PRIV_FUNC_ENTER (h5_loc_idx_t,
"m=%p, parent_idx=%lld, vertex_indices=%p, weights=%p",
m,
(long long)parent_idx,
......@@ -602,20 +600,19 @@ h5t_store_elem (
}
H5_CORE_API_RETURN (elem_idx);
}
h5_loc_idx_t
h5t_store_elem2 (
h5t_add_lvl0_cell (
h5t_mesh_t* const m,
const h5_loc_idx_t parent_idx,
const h5_loc_idx_t* vertex_indices,
const h5_weight_t* weights
) {
H5_CORE_API_ENTER (h5_loc_idx_t,
"m=%p, parent_idx=%lld, vertex_indices=%p, weights=%p",
"m=%p, vertex_indices=%p, weights=%p",
m,
(long long)parent_idx,
vertex_indices,
weights);
h5t_store_elem (m, parent_idx, vertex_indices, weights);
h5tpriv_add_cell (m, -1, vertex_indices, weights);
h5_loc_idx_t* loc_vertex_indices = h5tpriv_get_loc_elem_vertex_indices (
m, m->last_stored_eid);
int num_vertices = h5tpriv_ref_elem_get_num_vertices (m);
......@@ -682,7 +679,11 @@ h5t_end_store_elems (
h5t_mesh_t* const m
) {
H5_CORE_API_ENTER (h5_err_t, "m=%p", m);
h5_debug ("end storing elements");
if (m->leaf_level == 0) {
m->num_glb_leaf_elems[0] = m->num_glb_elems[0];
}
m->num_interior_elems[m->leaf_level] = m->last_stored_eid+1;
m->num_glb_elems[m->leaf_level] = m->last_stored_eid+1;
m->num_glb_leaf_elems[m->leaf_level] = m->num_interior_leaf_elems[m->leaf_level];
......@@ -1787,7 +1788,8 @@ h5t_refine_marked_elems_chk (
// refine elements
for (int i = 0; i < num_midpoints; i++) {
TRY (h5tpriv_refine_elem (m, h5t_map_glb_elem_idx2loc(m,midpoints[i].elem))); // needs to be ordered acc to octants
// needs to be ordered acc to octants
TRY (h5tpriv_refine_elem (m, h5t_map_glb_elem_idx2loc(m,midpoints[i].elem)));
}
TRY (h5_free (oct_c_list.items));
TRY (h5_free (elem_range));
......@@ -2147,7 +2149,9 @@ store_exchanged_elems (
// create list of new glb_vtx
h5_glb_vertex_t* new_vtx = h5_calloc(new_elems_c * 4, sizeof (*new_vtx));// TODO should be by far enough -> could be optimzed
// TODO should be by far enough -> could be optimzed
h5_glb_vertex_t* new_vtx = h5_calloc(new_elems_c * 4, sizeof (*new_vtx));
int new_vtx_c = 0;
......
......@@ -37,6 +37,11 @@ h5tpriv_alloc_loc_elems (
return m->methods->store->alloc_loc_elems (m, cur, new);
}
h5_loc_idx_t
h5tpriv_add_cell (
h5t_mesh_t* const, const h5_loc_idx_t, const h5_loc_idx_t*, const h5_weight_t*);
static inline h5_loc_idx_t
h5tpriv_refine_elem (
h5t_mesh_t * const m,
......
......@@ -126,7 +126,7 @@ pre_refine_tet (
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p", m);
unsigned int num_interior_elems_to_refine = m->marked_entities->num_items;
TRY (h5t_begin_store_vertices (m, num_interior_elems_to_refine*3 + 192));
TRY (h5t_begin_store_elems (m, num_interior_elems_to_refine*8, m->num_weights));
TRY (h5t_begin_store_elems (m, num_interior_elems_to_refine*8));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
}
......@@ -170,61 +170,87 @@ refine_tet (
// add new tets
h5_loc_idx_t new_elem[4];
/*
Add refined cells with pre-sorted vertices!
This is actually importend: sorting refined cells may produce wrong
orientated cells. This can easily be shown with triangle:
0
*
*4
2*
*2
*
* 5
1
The parent triangle is (0,1,2) with a counter-clockwise orientation.
Since we must use an epsilon comparision, we run into a problem, if
the comparision returns X(0) < X(1), but X(0) == X(2). This happens,
if
X(0) - X(1) < 2*epsilon
The refined triangle (0,2,4) would be stored as (2,0,4), if we try
to sort the vertices. The orientation of (2,0,4) is clockwise! But
we assume that (0,2,4), (2,1,5) and (4,5,2) have the same orientation
as the parent and (2,4,5) the opposite orientation.
*/
// child 0
new_elem[0] = vertices[0]; // vertex 0
new_elem[1] = vertices[4]; // split point (0,1)
new_elem[2] = vertices[5]; // split point (0,2)
new_elem[3] = vertices[7]; // split point (0,3)
TRY( elem_idx_of_first_child = h5t_store_elem (m, elem_idx, new_elem, NULL) ); //TODO check use of h5t_store_elem2
TRY (elem_idx_of_first_child = h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
// child 1
new_elem[0] = vertices[4]; // split point (0,1)
new_elem[1] = vertices[1]; // vertex 1
new_elem[2] = vertices[6]; // split point (1,2)
new_elem[3] = vertices[8]; // split point (1,3)
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) ); //TODO check use of h5t_store_elem2
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
// child 2
new_elem[0] = vertices[5]; // split point (0,2)
new_elem[1] = vertices[6]; // split point (1,2)
new_elem[2] = vertices[2]; // vertex 2
new_elem[3] = vertices[9]; // split point (2,3)
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) ); //TODO check use of h5t_store_elem2
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
// child 3
new_elem[0] = vertices[7]; // split point (0,3)
new_elem[1] = vertices[8]; // split point (1,3)
new_elem[2] = vertices[9]; // split point (2,3)
new_elem[3] = vertices[3]; // vertex 3
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );//TODO check use of h5t_store_elem2
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
// child 4
new_elem[0] = vertices[4]; // split point (0,1)
new_elem[1] = vertices[5]; // split point (0,2)
new_elem[2] = vertices[6]; // split point (1,2)
new_elem[3] = vertices[8]; // split point (1,3)
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );//TODO check use of h5t_store_elem2
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
// child 5
new_elem[0] = vertices[4]; // split point (0,1)
new_elem[1] = vertices[5]; // split point (0,2)
new_elem[2] = vertices[7]; // split point (0,3)
new_elem[3] = vertices[8]; // split point (1,3)
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );//TODO check use of h5t_store_elem2
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
// child 6
new_elem[0] = vertices[5]; // split point (0,2)
new_elem[1] = vertices[6]; // split point (1,2)
new_elem[2] = vertices[8]; // split point (1,3)
new_elem[3] = vertices[9]; // split point (2,3)
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );//TODO check use of h5t_store_elem2
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
// child 7
new_elem[0] = vertices[5]; // split point (0,2)
new_elem[1] = vertices[7]; // split point (0,3)
new_elem[2] = vertices[8]; // split point (1,3)
new_elem[3] = vertices[9]; // split point (2,3)
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );//TODO check use of h5t_store_elem2
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
((h5_loc_tet_t*)m->loc_elems)[elem_idx].child_idx = elem_idx_of_first_child;
m->num_interior_leaf_elems[m->leaf_level]--;
......
......@@ -108,7 +108,7 @@ pre_refine_triangle (
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p", m);
unsigned int num_interior_elems_to_refine = m->marked_entities->num_items;
TRY (h5t_begin_store_vertices (m, num_interior_elems_to_refine*3 + 64));
TRY (h5t_begin_store_elems (m, num_interior_elems_to_refine*4, m->num_weights));
TRY (h5t_begin_store_elems (m, num_interior_elems_to_refine*4));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
}
......@@ -149,22 +149,22 @@ refine_triangle (
new_elem[0] = vertices[0]; // V[0] < V[3] , V[4]
new_elem[1] = vertices[3];
new_elem[2] = vertices[4];
TRY( elem_idx_of_first_child = h5t_store_elem (m, elem_idx, new_elem, NULL) );
TRY (elem_idx_of_first_child = h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
new_elem[0] = vertices[3]; // V[3] < V[1] , V[5]
new_elem[1] = vertices[1];
new_elem[2] = vertices[5];
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
new_elem[0] = vertices[4]; // V[4] < V[5] , V[2]
new_elem[1] = vertices[5];
new_elem[2] = vertices[2];
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
new_elem[0] = vertices[3]; // V[3] < V[4] , V[5]
new_elem[1] = vertices[5];
new_elem[2] = vertices[4]; // TODO check if that ordering is correct!
TRY( h5t_store_elem (m, elem_idx, new_elem, NULL) );
TRY (h5tpriv_add_cell (m, elem_idx, new_elem, NULL));
((h5_loc_tri_t*)m->loc_elems)[elem_idx].child_idx = elem_idx_of_first_child;
m->num_interior_leaf_elems[m->leaf_level]--;
......
......@@ -29,7 +29,7 @@
static h5_err_t
read_dataset (
h5t_mesh_t* const m,
h5t_mesh_t* const m,
const h5_file_p f,
hid_t dset_id,
h5_dsinfo_t* dsinfo,
......@@ -421,11 +421,13 @@ read_tagset (
TRY (dset_id = hdf5_open_dataset (loc_id, "elems"));
TRY (num_interior_elems = hdf5_get_npoints_of_dataset (dset_id));
TRY (elems = h5_calloc (num_interior_elems, sizeof(*elems)));
h5_dsinfo_t dsinfo;
memset (&dsinfo, 0, sizeof (dsinfo));
dsinfo.type_id = h5_dta_types.h5t_glb_tag_idx_t;
TRY (h5priv_read_dataset (
tagset->m->f,
TRY (read_dataset (
tagset->m,
tagset->m->f,
dset_id,
&dsinfo,
open_space_all,
......@@ -442,7 +444,7 @@ read_tagset (
TRY (num_entities = hdf5_get_npoints_of_dataset (dset_id));
TRY (entities = h5_calloc (num_entities, sizeof(*entities)));
TRY (read_dataset (
tagset->m,
tagset->m,
tagset->m->f,
dset_id,
&dsinfo,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment