h5t_openclose* renamed to h5t_model*, some functions moved from file to files

This commit is contained in:
2011-05-20 13:01:14 +00:00
parent f79b06ef4d
commit a7b9621850
11 changed files with 231 additions and 228 deletions
+5 -3
View File
@@ -444,8 +444,10 @@ src/h5core/h5t_hsearch_private.h -text
src/h5core/h5t_inquiry.c -text
src/h5core/h5t_map.c -text
src/h5core/h5t_map_private.h -text
src/h5core/h5t_openclose.c -text
src/h5core/h5t_openclose_private.h -text
src/h5core/h5t_model.c -text
src/h5core/h5t_model_private.h -text
src/h5core/h5t_model_tetm.c -text
src/h5core/h5t_model_trim.c -text
src/h5core/h5t_readwrite.c -text
src/h5core/h5t_readwrite_private.h -text
src/h5core/h5t_readwrite_tetm.c -text
@@ -500,7 +502,7 @@ src/include/h5core/h5t_adjacencies.h -text
src/include/h5core/h5t_core.h -text
src/include/h5core/h5t_inquiry.h -text
src/include/h5core/h5t_map.h -text
src/include/h5core/h5t_openclose.h -text
src/include/h5core/h5t_model.h -text
src/include/h5core/h5t_readwrite.h -text
src/include/h5core/h5t_ref_elements.h -text
src/include/h5core/h5t_retrieve.h -text
+5 -5
View File
@@ -26,7 +26,7 @@ EXTRA_HEADERS = \
../include/h5core/h5t_core.h \
../include/h5core/h5t_inquiry.h \
../include/h5core/h5t_map.h \
../include/h5core/h5t_openclose.h \
../include/h5core/h5t_model.h \
../include/h5core/h5t_readwrite.h \
../include/h5core/h5t_ref_elements.h \
../include/h5core/h5t_retrieve.h \
@@ -50,12 +50,11 @@ EXTRA_HEADERS = \
h5b_types_private.h \
h5t_access_private.h \
h5t_adjacencies_private.h \
h5t_consts_private.h \
h5t_core_private.h \
h5t_errorhandling_private.h \
h5t_hsearch_private.h \
h5t_map_private.h \
h5t_openclose_private.h \
h5t_model_private.h \
h5t_readwrite_private.h \
h5t_ref_elements_private.h \
h5t_retrieve_private.h \
@@ -101,12 +100,13 @@ ___lib_libH5hut_a_SOURCES = \
h5t_adjacencies.c \
h5t_adjacencies_tetm.c \
h5t_adjacencies_trim.c \
h5t_consts.c \
h5t_errorhandling.c \
h5t_hsearch.c \
h5t_inquiry.c \
h5t_map.c \
h5t_openclose.c \
h5t_model.c \
h5t_model_tetm.c \
h5t_model_trim.c \
h5t_readwrite.c \
h5t_readwrite_trim.c \
h5t_readwrite_tetm.c \
+1 -1
View File
@@ -13,7 +13,7 @@
#include "h5t_adjacencies_private.h"
#include "h5t_hsearch_private.h"
#include "h5t_map_private.h"
#include "h5t_openclose_private.h"
#include "h5t_model_private.h"
#include "h5t_ref_elements_private.h"
#include "h5t_readwrite_private.h"
#include "h5t_retrieve_private.h"
@@ -3,22 +3,6 @@
#include "h5core/h5_core.h"
#include "h5_core_private.h"
static struct h5t_methods tet_funcs = {
&h5tpriv_read_tetm_methods,
&h5tpriv_tetm_store_methods,
&h5tpriv_tetm_retrieve_methods,
&h5tpriv_access_tetm_methods,
&h5tpriv_tetm_adjacency_methods
};
static struct h5t_methods tri_funcs = {
&h5tpriv_read_trim_methods,
&h5tpriv_trim_store_methods,
&h5tpriv_trim_retrieve_methods,
&h5tpriv_access_trim_methods,
&h5tpriv_trim_adjacency_methods
};
/*
create several HDF5 types
*/
@@ -362,169 +346,10 @@ h5tpriv_close_step (
H5_PRIV_API_RETURN (H5_SUCCESS);
}
static inline h5_err_t
open_topo_group (
h5_file_t * const f
) {
h5t_fdata_t* t = f->t;
if (t->topo_gid == 0 || t->topo_gid == -1) {
return (t->topo_gid = h5priv_open_group (f, f->root_gid, H5T_CONTAINER_GRPNAME));
}
return (t->topo_gid);
}
static inline h5_err_t
open_tetmeshes_group (
h5_file_t* const f
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->topo_gid < 0) {
TRY (open_topo_group (f));
}
TRY (t->meshes_gid = h5priv_open_group (
f,
t->topo_gid,
TETRAHEDRAL_MESHES_GRPNAME));
t->mesh_type = H5_OID_TETRAHEDRON;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
}
static inline h5_err_t
open_trimeshes_group (
h5_file_t* const f
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->topo_gid < 0) {
TRY (open_topo_group (f));
}
TRY (t->meshes_gid = h5priv_open_group (
f,
t->topo_gid,
TRIANGLE_MESHES_GRPNAME));
t->mesh_type = H5_OID_TRIANGLE;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
}
/*
Open HDF5 group with specific mesh
*/
static inline h5_err_t
open_tetmesh_group (
h5_file_t* const f,
const h5_id_t id
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->meshes_gid < 0) {
TRY (open_tetmeshes_group (f));
}
snprintf (t->mesh_name, sizeof (t->mesh_name), "%lld", (long long)id);
TRY (t->mesh_gid = h5priv_open_group (
f,
t->meshes_gid,
t->mesh_name));
t->cur_mesh = id;
H5_PRIV_API_RETURN (H5_SUCCESS);
}
static inline h5_err_t
open_trimesh_group (
h5_file_t* const f,
const h5_id_t id
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->meshes_gid < 0) {
TRY (open_trimeshes_group (f));
}
snprintf (t->mesh_name, sizeof (t->mesh_name), "%lld", (long long)id);
TRY (t->mesh_gid = h5priv_open_group (
f,
t->meshes_gid,
t->mesh_name));
t->cur_mesh = id;
H5_PRIV_API_RETURN (H5_SUCCESS);
}
/*
If the value of parameter \c id is \c -1, a new mesh will be appended.
*/
h5_err_t
h5t_open_tetrahedral_mesh (
h5_file_t* const f,
h5_id_t id
) {
H5_CORE_API_ENTER2 (h5_err_t, "f=0x%p, id=%lld", f, (long long)id);
h5t_fdata_t* t = f->t;
TRY (h5t_close_mesh (f));
if (t->num_meshes < 0) {
h5_size_t result = h5t_get_num_tetmeshes (f);
t->num_meshes = (result > 0 ? result : 0);
}
if ((id < -1) || (id >= t->num_meshes)) {
H5_CORE_API_LEAVE (HANDLE_H5_OUT_OF_RANGE_ERR ("mesh", id));
}
t->dsinfo_elems.type_id = t->dtypes.h5_tet_t;
t->methods = tet_funcs;
t->ref_elem = &h5t_tet_ref_elem;
TRY (open_tetmesh_group (f, id));
if (id == -1) { // append new
id = t->num_meshes;
t->num_meshes++;
t->mesh_changed = id;
t->num_leaf_levels = 0;
} else { // read existing
TRY (h5tpriv_read_mesh (f));
}
H5_CORE_API_RETURN (H5_SUCCESS);
}
h5_err_t
h5t_open_triangle_mesh (
h5_file_t* const f,
h5_id_t id
) {
H5_CORE_API_ENTER2 (h5_err_t, "f=0x%p, id=%lld", f, (long long)id);
h5t_fdata_t* t = f->t;
TRY (h5t_close_mesh (f));
if (t->num_meshes < 0) {
h5_size_t result = h5t_get_num_trimeshes (f);
t->num_meshes = (result > 0 ? result : 0);
}
if ((id < -1) || (id >= t->num_meshes)) {
H5_CORE_API_LEAVE (HANDLE_H5_OUT_OF_RANGE_ERR ("mesh", id));
}
t->dsinfo_elems.type_id = t->dtypes.h5_triangle_t;
t->methods = tri_funcs;
t->ref_elem = &h5t_tri_ref_elem;
TRY (open_trimesh_group (f, id));
if (id == -1) { // append new
id = t->num_meshes;
t->num_meshes++;
t->mesh_changed = id;
t->num_leaf_levels = 0;
} else { // read existing
TRY (h5tpriv_read_mesh (f));
}
H5_CORE_API_RETURN (H5_SUCCESS);
}
static h5_err_t
release_elems (
h5_file_t* const f
@@ -1,5 +1,5 @@
#ifndef __H5T_OPENCLOSE_PRIVATE_H
#define __H5T_OPENCLOSE_PRIVATE_H
#ifndef __H5T_MODEL_PRIVATE_H
#define __H5T_MODEL_PRIVATE_H
h5_err_t
h5tpriv_open_file (
+103
View File
@@ -0,0 +1,103 @@
#include "h5core/h5_core.h"
#include "h5_core_private.h"
static struct h5t_methods tet_funcs = {
&h5tpriv_read_tetm_methods,
&h5tpriv_tetm_store_methods,
&h5tpriv_tetm_retrieve_methods,
&h5tpriv_access_tetm_methods,
&h5tpriv_tetm_adjacency_methods
};
static inline h5_err_t
open_tetmeshes_group (
h5_file_t* const f
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->topo_gid == 0 || t->topo_gid == -1) {
TRY (t->topo_gid = h5priv_open_group (
f, f->root_gid, H5T_CONTAINER_GRPNAME));
}
TRY (t->meshes_gid = h5priv_open_group (
f,
t->topo_gid,
TETRAHEDRAL_MESHES_GRPNAME));
t->mesh_type = H5_OID_TETRAHEDRON;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
}
static inline h5_err_t
open_tetmesh_group (
h5_file_t* const f,
const h5_id_t id
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->meshes_gid < 0) {
TRY (open_tetmeshes_group (f));
}
snprintf (t->mesh_name, sizeof (t->mesh_name), "%lld", (long long)id);
TRY (t->mesh_gid = h5priv_open_group (
f,
t->meshes_gid,
t->mesh_name));
t->cur_mesh = id;
H5_PRIV_API_RETURN (H5_SUCCESS);
}
/*
If the value of parameter \c id is \c -1, a new mesh will be appended.
*/
h5_err_t
h5t_open_tetrahedral_mesh (
h5_file_t* const f,
h5_id_t id
) {
H5_CORE_API_ENTER2 (h5_err_t, "f=0x%p, id=%lld", f, (long long)id);
h5t_fdata_t* t = f->t;
TRY (h5t_close_mesh (f));
if (t->num_meshes < 0) {
h5_size_t result = h5t_get_num_tetmeshes (f);
t->num_meshes = (result > 0 ? result : 0);
}
if ((id < -1) || (id >= t->num_meshes)) {
H5_CORE_API_LEAVE (HANDLE_H5_OUT_OF_RANGE_ERR ("mesh", id));
}
t->dsinfo_elems.type_id = t->dtypes.h5_tet_t;
t->methods = tet_funcs;
t->ref_elem = &h5t_tet_ref_elem;
TRY (open_tetmesh_group (f, id));
if (id == -1) { // append new
id = t->num_meshes;
t->num_meshes++;
t->mesh_changed = id;
t->num_leaf_levels = 0;
} else { // read existing
TRY (h5tpriv_read_mesh (f));
}
H5_CORE_API_RETURN (H5_SUCCESS);
}
/*!
Add new mesh
\return mesh id
*/
h5_id_t
h5t_add_tetrahedral_mesh (
h5_file_t* const f
) {
H5_CORE_API_ENTER1 (h5_id_t, "f=0x%p", f);
h5_id_t mesh_id = 0;
TRY (mesh_id = h5t_open_tetrahedral_mesh (f, -1));
TRY (h5t_add_level (f));
f->t->mesh_changed = 1;
H5_CORE_API_RETURN (mesh_id);
}
+102
View File
@@ -0,0 +1,102 @@
#include "h5core/h5_core.h"
#include "h5_core_private.h"
static struct h5t_methods tri_funcs = {
&h5tpriv_read_trim_methods,
&h5tpriv_trim_store_methods,
&h5tpriv_trim_retrieve_methods,
&h5tpriv_access_trim_methods,
&h5tpriv_trim_adjacency_methods
};
static inline h5_err_t
open_trimeshes_group (
h5_file_t* const f
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->topo_gid < 0) {
TRY (open_topo_group (f));
}
TRY (t->meshes_gid = h5priv_open_group (
f,
t->topo_gid,
TRIANGLE_MESHES_GRPNAME));
t->mesh_type = H5_OID_TRIANGLE;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
}
static inline h5_err_t
open_trimesh_group (
h5_file_t* const f,
const h5_id_t id
) {
H5_PRIV_FUNC_ENTER (h5_err_t);
h5t_fdata_t* t = f->t;
if (t->topo_gid == 0 || t->topo_gid == -1) {
TRY (t->topo_gid = h5priv_open_group (
f, f->root_gid, H5T_CONTAINER_GRPNAME));
}
snprintf (t->mesh_name, sizeof (t->mesh_name), "%lld", (long long)id);
TRY (t->mesh_gid = h5priv_open_group (
f,
t->meshes_gid,
t->mesh_name));
t->cur_mesh = id;
H5_PRIV_API_RETURN (H5_SUCCESS);
}
h5_err_t
h5t_open_triangle_mesh (
h5_file_t* const f,
h5_id_t id
) {
H5_CORE_API_ENTER2 (h5_err_t, "f=0x%p, id=%lld", f, (long long)id);
h5t_fdata_t* t = f->t;
TRY (h5t_close_mesh (f));
if (t->num_meshes < 0) {
h5_size_t result = h5t_get_num_trimeshes (f);
t->num_meshes = (result > 0 ? result : 0);
}
if ((id < -1) || (id >= t->num_meshes)) {
H5_CORE_API_LEAVE (HANDLE_H5_OUT_OF_RANGE_ERR ("mesh", id));
}
t->dsinfo_elems.type_id = t->dtypes.h5_triangle_t;
t->methods = tri_funcs;
t->ref_elem = &h5t_tri_ref_elem;
TRY (open_trimesh_group (f, id));
if (id == -1) { // append new
id = t->num_meshes;
t->num_meshes++;
t->mesh_changed = id;
t->num_leaf_levels = 0;
} else { // read existing
TRY (h5tpriv_read_mesh (f));
}
H5_CORE_API_RETURN (H5_SUCCESS);
}
/*!
Add new mesh
\return mesh id
*/
h5_id_t
h5t_add_triangle_mesh (
h5_file_t* const f
) {
H5_CORE_API_ENTER1 (h5_id_t, "f=0x%p", f);
h5_id_t mesh_id = 0;
TRY (mesh_id = h5t_open_triangle_mesh (f, -1));
TRY (h5t_add_level (f));
f->t->mesh_changed = 1;
H5_CORE_API_RETURN (mesh_id);
}
-29
View File
@@ -3,35 +3,6 @@
#include "h5core/h5_core.h"
#include "h5_core_private.h"
/*!
Add new mesh
\return mesh id
*/
h5_id_t
h5t_add_tetrahedral_mesh (
h5_file_t* const f
) {
H5_CORE_API_ENTER1 (h5_id_t, "f=0x%p", f);
h5_id_t mesh_id = 0;
TRY (mesh_id = h5t_open_tetrahedral_mesh (f, -1));
TRY (h5t_add_level (f));
f->t->mesh_changed = 1;
H5_CORE_API_RETURN (mesh_id);
}
h5_id_t
h5t_add_triangle_mesh (
h5_file_t* const f
) {
H5_CORE_API_ENTER1 (h5_id_t, "f=0x%p", f);
h5_id_t mesh_id = 0;
TRY (mesh_id = h5t_open_triangle_mesh (f, -1));
TRY (h5t_add_level (f));
f->t->mesh_changed = 1;
H5_CORE_API_RETURN (mesh_id);
}
/*
Assign unique global indices to vertices.
*/
+1 -1
View File
@@ -7,7 +7,7 @@
#include "h5t_adjacencies.h"
#include "h5t_inquiry.h"
#include "h5t_map.h"
#include "h5t_openclose.h"
#include "h5t_model.h"
#include "h5t_readwrite.h"
#include "h5t_ref_elements.h"
#include "h5t_retrieve.h"
@@ -1,5 +1,5 @@
#ifndef __H5T_OPENCLOSE_H
#define __H5T_OPENCLOSE_H
#ifndef __H5T_MODEL_H
#define __H5T_MODEL_H
h5_err_t h5t_open_tetrahedral_mesh (
h5_file_t * const f,
@@ -11,6 +11,16 @@ h5_err_t h5t_open_triangle_mesh (
const h5_id_t id
);
h5_id_t
h5t_add_tetrahedral_mesh (
h5_file_t * const f
);
h5_id_t
h5t_add_triangle_mesh (
h5_file_t * const f
);
h5_err_t h5t_set_level (
h5_file_t * const f,
const h5t_lvl_idx_t id
-10
View File
@@ -1,16 +1,6 @@
#ifndef __H5T_STOREMESH_H
#define __H5T_STOREMESH_H
h5_id_t
h5t_add_tetrahedral_mesh (
h5_file_t * const f
);
h5_id_t
h5t_add_triangle_mesh (
h5_file_t * const f
);
h5t_lvl_idx_t
h5t_add_level (
h5_file_t * const f