changesets -3740 merged from sandbox
This commit is contained in:
+74
-152
@@ -21,181 +21,103 @@ extern "C" {
|
||||
|
||||
extern char* h5_rfmts[];
|
||||
|
||||
#define __FUNC_ENTER(type) \
|
||||
h5_call_stack_push (__func__,e_##type); \
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// function enter macro
|
||||
#if defined(NDEBUG)
|
||||
|
||||
#define __API_ENTER(type, mask, fmt, ...) \
|
||||
h5_call_stack_init (__func__,e_##type); \
|
||||
type ret_value = (type)H5_ERR;
|
||||
|
||||
#if defined(NDEBUG)
|
||||
|
||||
#define __FUNC_ARGS0(mask)
|
||||
#define __FUNC_ARGS1(fmt, a1, mask)
|
||||
#define __FUNC_ARGS2(fmt, a1, a2, mask)
|
||||
#define __FUNC_ARGS3(fmt, a1, a2, a3, mask)
|
||||
#define __FUNC_ARGS4(fmt, a1, a2, a3, a4, mask)
|
||||
#define __FUNC_ARGS5(fmt, a1, a2, a3, a4, a5, mask)
|
||||
#define __FUNC_ARGS6(fmt, a1, a2, a3, a4, a5, a6, mask)
|
||||
#define __FUNC_ARGS7(fmt, a1, a2, a3, a4, a5, a6, a7, mask)
|
||||
#define __FUNC_ARGS8(fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask)
|
||||
#define __FUNC_ENTER(type, mask, fmt, ...) \
|
||||
type ret_value = (type)H5_ERR;
|
||||
|
||||
#else
|
||||
|
||||
#define __FUNC_ARGS0(mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(void)"); \
|
||||
#define __API_ENTER(type, mask, fmt, ...) \
|
||||
h5_call_stack_push (__func__,e_##type); \
|
||||
type ret_value = (type)H5_ERR; \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", __VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define __FUNC_ARGS1(fmt, a1, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1); \
|
||||
}
|
||||
#define __FUNC_ENTER(type, mask, fmt, ...) \
|
||||
type ret_value = (type)H5_ERR; \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_call_stack_push (__func__,e_##type); \
|
||||
h5_debug ("(" fmt ")", __VA_ARGS__); \
|
||||
} \
|
||||
|
||||
#define __FUNC_ARGS2(fmt, a1, a2, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1, a2); \
|
||||
}
|
||||
|
||||
#define __FUNC_ARGS3(fmt, a1, a2, a3, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1, a2, a3); \
|
||||
}
|
||||
|
||||
#define __FUNC_ARGS4(fmt, a1, a2, a3, a4, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1, a2, a3, a4); \
|
||||
}
|
||||
|
||||
#define __FUNC_ARGS5(fmt, a1, a2, a3, a4, a5, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5); \
|
||||
}
|
||||
|
||||
#define __FUNC_ARGS6(fmt, a1, a2, a3, a4, a5, a6, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5, a6); \
|
||||
}
|
||||
|
||||
#define __FUNC_ARGS7(fmt, a1, a2, a3, a4, a5, a6, a7, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5, a6, a7); \
|
||||
}
|
||||
|
||||
#define __FUNC_ARGS8(fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask) \
|
||||
if (h5_debug_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", a1, a2, a3, a4, a5, a6, a7, a8); \
|
||||
}
|
||||
#endif
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define __FUNC_ENTER0(type, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS0(mask);
|
||||
#define __API_LEAVE(expr) { \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define __FUNC_ENTER1(type, fmt, a1, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS1(fmt, a1, mask);
|
||||
|
||||
#define __FUNC_ENTER2(type, fmt, a1, a2, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS2(fmt, a1, a2, mask);
|
||||
|
||||
#define __FUNC_ENTER3(type, fmt, a1, a2, a3, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS3(fmt, a1, a2, a3, mask);
|
||||
|
||||
#define __FUNC_ENTER4(type, fmt, a1, a2, a3, a4, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS4(fmt, a1, a2, a3, a4, mask);
|
||||
|
||||
#define __FUNC_ENTER5(type, fmt, a1, a2, a3, a4, a5, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS5(fmt, a1, a2, a3, a4, a5, mask);
|
||||
|
||||
#define __FUNC_ENTER6(type, fmt, a1, a2, a3, a4, a5, a6, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS6(fmt, a1, a2, a3, a4, a5, a6, mask);
|
||||
|
||||
#define __FUNC_ENTER7(type, fmt, a1, a2, a3, a4, a5, a6, a7, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS7(fmt, a1, a2, a3, a4, a5, a6, a7, mask);
|
||||
|
||||
#define __FUNC_ENTER8(type, fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask) \
|
||||
__FUNC_ENTER(type); \
|
||||
__FUNC_ARGS8(fmt, a1, a2, a3, a4, a5, a6, a7, a8, mask);
|
||||
|
||||
#define __FUNC_LEAVE(expr) { \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
#define __FUNC_LEAVE(expr) { \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// function return macro
|
||||
#if defined(NDEBUG)
|
||||
|
||||
#define __FUNC_RETURN(expr, mask) \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
h5_call_stack_pop(); \
|
||||
#define __API_RETURN(expr, mask) \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
h5_call_stack_reset (); \
|
||||
return ret_value;
|
||||
|
||||
#define __FUNC_RETURN(expr, mask) \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
return ret_value;
|
||||
|
||||
#else
|
||||
|
||||
#define __FUNC_RETURN(expr, mask) \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
if (h5_debug_level & mask ) { \
|
||||
char fmt[256]; \
|
||||
snprintf (fmt, sizeof(fmt), "return: %s", \
|
||||
h5_rfmts[h5_call_stack_get_type()]); \
|
||||
h5_debug (fmt, ret_value); \
|
||||
} \
|
||||
h5_call_stack_pop(); \
|
||||
#define __API_RETURN(expr, mask) \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
if (h5_debug_level & mask ) { \
|
||||
char fmt[256]; \
|
||||
snprintf (fmt, sizeof(fmt), "return: %s", \
|
||||
h5_rfmts[h5_call_stack_get_type()]); \
|
||||
h5_debug (fmt, ret_value); \
|
||||
} \
|
||||
h5_call_stack_reset (); \
|
||||
return ret_value;
|
||||
|
||||
#define __FUNC_RETURN(expr, mask) \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
if (h5_debug_level & mask ) { \
|
||||
char fmt[256]; \
|
||||
snprintf (fmt, sizeof(fmt), "return: %s", \
|
||||
h5_rfmts[h5_call_stack_get_type()]); \
|
||||
h5_debug (fmt, ret_value); \
|
||||
h5_call_stack_pop(); \
|
||||
} \
|
||||
return ret_value;
|
||||
|
||||
#endif
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define H5_API_ENTER_(type) \
|
||||
if (!h5_initialized) { \
|
||||
h5_initialize(); \
|
||||
} \
|
||||
__FUNC_ENTER(type);
|
||||
|
||||
#define H5_API_ENTER0(type) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS0(H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER1(type, fmt, a1) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS1(fmt, a1, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER2(type, fmt, a1, a2) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS2(fmt, a1,a2, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER3(type, fmt, a1, a2, a3) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS3(fmt, a1,a2,a3, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER4(type, fmt, a1, a2, a3, a4) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS4(fmt, a1,a2,a3, a4, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER5(type, fmt, a1, a2, a3, a4, a5) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS5(fmt, a1,a2,a3, a4, a5, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER6(type, fmt, a1, a2, a3, a4, a5, a6) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS6(fmt, a1,a2,a3, a4, a5, a6, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER7(type, fmt, a1, a2, a3, a4, a5, a6, a7) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS7(fmt, a1,a2,a3, a4, a5, a6, a7, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_ENTER8(type, fmt, a1, a2, a3, a4, a5, a6, a7, a8) \
|
||||
H5_API_ENTER_(type); \
|
||||
__FUNC_ARGS8(fmt, a1,a2,a3, a4, a5, a6, a7, a8, H5_DEBUG_API)
|
||||
|
||||
#define H5_API_LEAVE(expr) __FUNC_LEAVE(expr)
|
||||
#define H5_API_RETURN(expr) __FUNC_RETURN(expr, H5_DEBUG_API);
|
||||
#define H5_API_ENTER(type, fmt, ...) \
|
||||
if (!h5_initialized) { \
|
||||
h5_initialize(); \
|
||||
} \
|
||||
__API_ENTER(type, H5_DEBUG_API, fmt, __VA_ARGS__)
|
||||
#define H5_API_LEAVE(expr) __API_LEAVE(expr)
|
||||
#define H5_API_RETURN(expr) __API_RETURN(expr, H5_DEBUG_API);
|
||||
|
||||
|
||||
#define TRY( func ) \
|
||||
|
||||
@@ -58,6 +58,9 @@ h5_initialize (
|
||||
H5_ERR_INVAL, \
|
||||
"Attempting to write to read-only file" );
|
||||
|
||||
#define is_writable(f) (f->mode != H5_O_RDONLY)
|
||||
|
||||
|
||||
#define CHECK_READONLY_MODE( f ) \
|
||||
if ( ! f->mode==H5_O_RDONLY ) \
|
||||
return h5_error ( \
|
||||
@@ -73,7 +76,7 @@ h5_initialize (
|
||||
#define h5_error_not_implemented() \
|
||||
h5_error( \
|
||||
H5_ERR_NOT_IMPLEMENTED, \
|
||||
"%s: Function \"%s\", line %d not yet implemented!", \
|
||||
"%s: Function '%s', line %d not yet implemented!", \
|
||||
__FILE__, __func__, __LINE__);
|
||||
|
||||
#define h5_error_internal() \
|
||||
|
||||
@@ -9,7 +9,8 @@ h5_file_t *
|
||||
h5_open_file (
|
||||
const char *filename,
|
||||
h5_int32_t flags,
|
||||
MPI_Comm comm
|
||||
MPI_Comm comm,
|
||||
h5_size_t alignment
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -1,26 +1,71 @@
|
||||
#ifndef __H5_SYSCALL_H
|
||||
#define __H5_SYSCALL_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "h5_errorhandling.h"
|
||||
|
||||
#define MALLOC_WRAPPER_ENTER(type, fmt, ...) \
|
||||
__FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__)
|
||||
#define MALLOC_WRAPPER_LEAVE(value) __FUNC_LEAVE(value)
|
||||
#define MALLOC_WRAPPER_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_MALLOC)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void*
|
||||
static inline void_p
|
||||
h5_alloc (
|
||||
void* ptr,
|
||||
const size_t size
|
||||
);
|
||||
) {
|
||||
MALLOC_WRAPPER_ENTER (void_p, "ptr=%p, size=%lu", ptr, size);
|
||||
ptr = realloc (ptr, size);
|
||||
if (ptr == NULL) {
|
||||
MALLOC_WRAPPER_LEAVE (
|
||||
(void_p)h5_error (H5_ERR_NOMEM, "Out of memory."));
|
||||
}
|
||||
MALLOC_WRAPPER_RETURN (ptr);
|
||||
}
|
||||
|
||||
void*
|
||||
static inline void_p
|
||||
h5_calloc (
|
||||
const size_t count,
|
||||
const size_t size
|
||||
);
|
||||
) {
|
||||
MALLOC_WRAPPER_ENTER (void_p, "count=%zu , size=%zu", count, size);
|
||||
void* ptr = calloc (count, size);
|
||||
if (ptr == NULL) {
|
||||
MALLOC_WRAPPER_LEAVE (
|
||||
(void_p)h5_error (H5_ERR_NOMEM, "Out of memory."));
|
||||
}
|
||||
MALLOC_WRAPPER_RETURN (ptr);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
h5_free (
|
||||
void* ptr
|
||||
);
|
||||
) {
|
||||
MALLOC_WRAPPER_ENTER (h5_err_t, "ptr=%p", ptr);
|
||||
if (ptr) {
|
||||
free (ptr);
|
||||
}
|
||||
MALLOC_WRAPPER_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline char_p
|
||||
h5_strdup (
|
||||
const char* s1
|
||||
) {
|
||||
MALLOC_WRAPPER_ENTER (char_p, "s='%s'", s1);
|
||||
|
||||
char_p s2 = h5_calloc (1, strlen (s1)+1 );
|
||||
if (s2 == NULL) {
|
||||
MALLOC_WRAPPER_LEAVE (
|
||||
(char_p)h5_error (H5_ERR_NOMEM, "Out of memory."));
|
||||
}
|
||||
MALLOC_WRAPPER_RETURN (strcpy (s2, s1));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -16,21 +16,26 @@ extern "C" {
|
||||
H5_O_RDWR: dataset may exist
|
||||
*/
|
||||
|
||||
#define H5_O_RDWR 0x01
|
||||
#define H5_O_RDONLY 0x02
|
||||
#define H5_O_WRONLY 0x04
|
||||
#define H5_O_APPEND 0x08
|
||||
#define H5_O_RDWR 0x001
|
||||
#define H5_O_RDONLY 0x002
|
||||
#define H5_O_WRONLY 0x004
|
||||
#define H5_O_APPEND 0x008
|
||||
|
||||
#define H5_VFD_MPIPOSIX 0x10
|
||||
#define H5_VFD_INDEPENDENT 0x20
|
||||
#define H5_VFD_MPIPOSIX 0x010
|
||||
#define H5_VFD_INDEPENDENT 0x020
|
||||
|
||||
#define H5_O_FLUSHSTEP 0x40
|
||||
#define H5_FLUSH_FILE 0x040
|
||||
#define H5_FLUSH_STEP 0x080
|
||||
#define H5_FLUSH_DATASET 0x100
|
||||
|
||||
#define H5_FS_LUSTRE 0x200
|
||||
|
||||
#define H5_ID_T H5T_NATIVE_INT64
|
||||
#define H5_FLOAT64_T H5T_NATIVE_DOUBLE
|
||||
#define H5_FLOAT32_T H5T_NATIVE_FLOAT
|
||||
#define H5_INT64_T H5T_NATIVE_INT64
|
||||
#define H5_INT32_T H5T_NATIVE_INT32
|
||||
#define H5_INT16_T H5T_NATIVE_INT16
|
||||
#define H5_STRING_T H5T_NATIVE_CHAR
|
||||
#define H5_COMPOUND_T H5T_COMPOUND
|
||||
|
||||
@@ -72,6 +77,10 @@ struct h5_file;
|
||||
typedef struct h5_file h5_file_t;
|
||||
typedef h5_file_t* h5_file_p;
|
||||
|
||||
struct h5t_mesh;
|
||||
typedef struct h5t_mesh h5t_mesh_t;
|
||||
typedef h5t_mesh_t* h5t_mesh_p;
|
||||
|
||||
typedef h5_err_t (*h5_errorhandler_t)(
|
||||
const char*,
|
||||
va_list ap );
|
||||
|
||||
@@ -7,7 +7,7 @@ extern "C" {
|
||||
|
||||
h5_err_t
|
||||
h5t_get_adjacencies (
|
||||
h5_file_t * const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_loc_idlist_t **list
|
||||
@@ -15,13 +15,13 @@ h5t_get_adjacencies (
|
||||
|
||||
h5_err_t
|
||||
h5t_release_list_of_adjacencies (
|
||||
h5_file_t * const f,
|
||||
h5t_mesh_t* const m,
|
||||
h5_loc_idlist_t **list
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_find_te2 (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
h5_loc_idx_t face_idx,
|
||||
h5_loc_idx_t elem_idx,
|
||||
h5_loc_idlist_t** retval
|
||||
|
||||
@@ -17,24 +17,24 @@ h5t_get_num_trimeshes (
|
||||
|
||||
h5_ssize_t
|
||||
h5t_get_num_leaf_levels (
|
||||
h5_file_t * const f
|
||||
h5t_mesh_t* const m
|
||||
);
|
||||
|
||||
h5_ssize_t
|
||||
h5t_get_num_elems (
|
||||
h5_file_t * const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_id_t cnode
|
||||
);
|
||||
|
||||
h5_ssize_t
|
||||
h5t_get_num_vertices (
|
||||
h5_file_t * const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_id_t cnode
|
||||
);
|
||||
|
||||
h5t_lvl_idx_t
|
||||
h5t_get_level (
|
||||
h5_file_t * const f
|
||||
h5t_mesh_t* const m
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -7,13 +7,13 @@ extern "C" {
|
||||
|
||||
h5_loc_idx_t
|
||||
h5t_map_global_vertex_idx2local (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
h5_glb_idx_t glb_idx
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_map_global_vertex_indices2local (
|
||||
h5_file_t* f,
|
||||
h5t_mesh_t* f,
|
||||
const h5_glb_id_t* const glb_indices,
|
||||
const h5_size_t size,
|
||||
h5_loc_idx_t* const loc_indices
|
||||
@@ -21,13 +21,13 @@ h5t_map_global_vertex_indices2local (
|
||||
|
||||
h5_loc_idx_t
|
||||
h5t_map_glb_elem_idx2loc (
|
||||
h5_file_t * const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_glb_idx_t glb_idx
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_map_glb_elem_indices2loc (
|
||||
h5_file_t * const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_glb_idx_t* glb_indices,
|
||||
const h5_size_t size,
|
||||
h5_loc_idx_t* loc_indices
|
||||
@@ -35,14 +35,14 @@ h5t_map_glb_elem_indices2loc (
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_index_of_vertex (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_index
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_index_of_vertex2 (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_idx_t face_idx,
|
||||
const h5_loc_idx_t elem_idx,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
@@ -50,14 +50,14 @@ h5t_get_vertex_index_of_vertex2 (
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_edge (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t *vertex_indices
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_edge2 (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_idx_t face_idx,
|
||||
const h5_loc_idx_t elem_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
@@ -65,14 +65,14 @@ h5t_get_vertex_indices_of_edge2 (
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_triangle (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_triangle2 (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_idx_t face_idx,
|
||||
const h5_loc_idx_t elem_idx,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
@@ -80,21 +80,21 @@ h5t_get_vertex_indices_of_triangle2 (
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_tet (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t *vertex_indices
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_entity (
|
||||
h5_file_t * const f,
|
||||
h5t_mesh_t* const m,
|
||||
const h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t *vertex_indices
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_indices_of_entity2 (
|
||||
h5_file_t* const f,
|
||||
h5t_mesh_t* const m,
|
||||
const int dim,
|
||||
const h5_loc_idx_t face_idx,
|
||||
const h5_loc_idx_t elem_idx,
|
||||
|
||||
@@ -5,33 +5,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_err_t h5t_open_tetrahedral_mesh (
|
||||
h5_file_t * const f,
|
||||
const h5_id_t id
|
||||
);
|
||||
h5_err_t h5t_open_tetrahedral_mesh (h5_file_t* const, const char*, h5t_mesh_t**);
|
||||
h5_err_t h5t_open_tetrahedral_mesh_by_idx (h5_file_t* const, const h5_id_t, h5t_mesh_t**);
|
||||
|
||||
h5_err_t h5t_open_triangle_mesh (
|
||||
h5_file_t * const f,
|
||||
const h5_id_t id
|
||||
);
|
||||
h5_err_t h5t_open_triangle_mesh (h5_file_t* const, const char*, h5t_mesh_t**);
|
||||
h5_err_t h5t_open_triangle_mesh_by_idx (h5_file_t* const, const h5_id_t, h5t_mesh_t**);
|
||||
|
||||
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_id_t h5t_add_tetrahedral_mesh (h5_file_t* const, const char* name, h5t_mesh_t**);
|
||||
|
||||
h5_err_t h5t_set_level (
|
||||
h5_file_t * const f,
|
||||
const h5t_lvl_idx_t id
|
||||
);
|
||||
h5_err_t h5t_close_mesh (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_id_t h5t_add_triangle_mesh (h5_file_t* const, const char*, h5t_mesh_t**);
|
||||
|
||||
h5_err_t h5t_set_level (h5t_mesh_t* const, const h5t_lvl_idx_t);
|
||||
|
||||
h5_err_t h5t_close_mesh (h5t_mesh_t* const);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -9,29 +9,31 @@ struct h5t_tagset;
|
||||
union h5t_iterator;
|
||||
|
||||
typedef struct {
|
||||
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
|
||||
h5t_mesh_t* mesh;
|
||||
h5_loc_id_t (*iter)(union h5t_iterator*);
|
||||
h5t_lvl_idx_t leaf_level;
|
||||
const h5t_ref_elem_t* ref_elem;
|
||||
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_loc_id_t face_idx,
|
||||
h5_loc_id_t elem_idx, h5_loc_idlist_t **retval);
|
||||
h5_err_t (*find)(h5t_mesh_t *const, h5_loc_id_t, h5_loc_id_t, h5_loc_idlist_t**);
|
||||
} h5t_leaf_iterator_t;
|
||||
|
||||
typedef struct {
|
||||
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
|
||||
h5t_mesh_t* mesh;
|
||||
h5_loc_id_t (*iter)(union h5t_iterator* iter);
|
||||
h5t_lvl_idx_t refinement_level;
|
||||
const h5t_ref_elem_t* ref_elem;
|
||||
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_loc_id_t face_idx,
|
||||
h5_err_t (*find)(h5t_mesh_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 {
|
||||
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
|
||||
h5t_mesh_t* mesh;
|
||||
h5_loc_id_t (*iter)(union h5t_iterator* iter);
|
||||
h5t_lvl_idx_t level_idx;
|
||||
struct h5t_tagset* tagset;
|
||||
h5_loc_idx_t elem_idx;
|
||||
@@ -39,7 +41,8 @@ typedef struct {
|
||||
} h5t_tag_iterator_t;
|
||||
|
||||
typedef struct h5t_generic_iterator {
|
||||
h5_loc_id_t (*iter)(h5_file_t *const f, union h5t_iterator* iter);
|
||||
h5t_mesh_t* mesh;
|
||||
h5_loc_id_t (*iter)(union h5t_iterator* iter);
|
||||
} h5t_generic_iterator_t;
|
||||
|
||||
typedef union h5t_iterator {
|
||||
@@ -52,58 +55,28 @@ typedef union h5t_iterator {
|
||||
typedef h5t_iterator_t* h5t_iterator_p;
|
||||
|
||||
h5_err_t
|
||||
h5t_init_leaf_iterator (
|
||||
h5_file_t* f,
|
||||
h5t_iterator_t* iter,
|
||||
const int codim
|
||||
);
|
||||
h5t_init_leaf_iterator (h5t_iterator_t*, h5t_mesh_t*, const int);
|
||||
|
||||
h5_err_t
|
||||
h5t_init_boundary_face_iterator (
|
||||
h5_file_t* f,
|
||||
h5t_iterator_t* iter,
|
||||
const int codim
|
||||
);
|
||||
h5t_init_boundary_face_iterator (h5t_iterator_t*, h5t_mesh_t*, const int);
|
||||
|
||||
h5_err_t
|
||||
h5t_init_mtag_iterator (
|
||||
h5_file_t* f,
|
||||
h5t_iterator_t* iter,
|
||||
const char* name
|
||||
);
|
||||
h5t_init_mtag_iterator (h5t_iterator_t*, h5t_mesh_t*, const char*);
|
||||
|
||||
h5_err_t
|
||||
h5t_release_entity_iterator (
|
||||
h5_file_t* const f,
|
||||
h5t_iterator_t* iter
|
||||
);
|
||||
h5t_release_entity_iterator (h5t_iterator_t*);
|
||||
|
||||
h5_loc_id_t
|
||||
h5t_iterate_entities (
|
||||
h5_file_t * const f,
|
||||
h5t_iterator_t *iter
|
||||
);
|
||||
h5t_iterate_entities (h5t_iterator_t*);
|
||||
|
||||
h5_err_t
|
||||
h5t_end_iterate_entities (
|
||||
h5_file_t * const f,
|
||||
h5t_iterator_t *iter
|
||||
);
|
||||
|
||||
h5t_end_iterate_entities (h5t_iterator_t*);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_coords_by_index (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t vertex_idx,
|
||||
h5_float64_t P[3]
|
||||
);
|
||||
h5t_get_vertex_coords_by_index (h5t_mesh_t* const, h5_loc_idx_t, h5_float64_t[3]);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_vertex_coords_by_id (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t vertex_id,
|
||||
h5_float64_t P[3]
|
||||
);
|
||||
h5t_get_vertex_coords_by_id (h5t_mesh_t* const, h5_loc_id_t, h5_float64_t[3]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -6,81 +6,46 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
h5t_lvl_idx_t
|
||||
h5t_add_level (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5t_add_level (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_begin_store_vertices (
|
||||
h5_file_t * const f,
|
||||
const h5_size_t num
|
||||
);
|
||||
h5t_begin_store_vertices (h5t_mesh_t* const, const h5_size_t);
|
||||
|
||||
h5_loc_id_t
|
||||
h5t_store_vertex (
|
||||
h5_file_t * const f,
|
||||
const h5_glb_id_t glb_id,
|
||||
const h5_float64_t P[3]
|
||||
);
|
||||
h5t_store_vertex (h5t_mesh_t* const, const h5_glb_id_t, const h5_float64_t[3]);
|
||||
|
||||
h5_err_t
|
||||
h5t_end_store_vertices (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5t_end_store_vertices (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_begin_store_elems (
|
||||
h5_file_t * const f,
|
||||
const h5_size_t num
|
||||
);
|
||||
h5t_begin_store_elems (h5t_mesh_t* const, const h5_size_t);
|
||||
|
||||
h5_loc_idx_t
|
||||
h5t_store_elem (
|
||||
h5_file_t * const f,
|
||||
const h5_loc_idx_t parent_idx,
|
||||
const h5_loc_idx_t* vertex_indices
|
||||
);
|
||||
h5t_store_elem (h5t_mesh_t* const, const h5_loc_idx_t, const h5_loc_idx_t*);
|
||||
|
||||
h5_err_t
|
||||
h5t_end_store_elems (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5t_end_store_elems (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_begin_refine_elems (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5t_begin_refine_elems (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_refine_marked_elems (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5t_refine_marked_elems (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_end_refine_elems (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5t_end_refine_elems (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_mark_entity (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id
|
||||
);
|
||||
h5t_mark_entity (h5t_mesh_t* const, const h5_loc_id_t);
|
||||
|
||||
h5_err_t
|
||||
h5t_pre_refine (
|
||||
h5_file_t* const f
|
||||
);
|
||||
h5t_pre_refine (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_refine (
|
||||
h5_file_t* const f
|
||||
);
|
||||
h5t_refine (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_post_refine (
|
||||
h5_file_t* const f
|
||||
);
|
||||
h5t_post_refine (h5t_mesh_t* const);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -8,98 +8,36 @@ extern "C" {
|
||||
typedef struct h5t_tagset h5t_tagset_t;
|
||||
typedef struct h5t_tagcontainer h5t_tagcontainer_t;
|
||||
|
||||
h5_err_t
|
||||
h5t_mtagset_exists (
|
||||
h5_file_t* const f,
|
||||
h5t_tagcontainer_t* ctn,
|
||||
char* name
|
||||
);
|
||||
h5_err_t
|
||||
h5t_add_mtagset (
|
||||
h5_file_t* const f,
|
||||
char name[],
|
||||
h5_id_t type
|
||||
);
|
||||
h5_err_t
|
||||
h5t_remove_mtagset (
|
||||
h5_file_t* const f,
|
||||
const char name[]
|
||||
);
|
||||
h5_err_t
|
||||
h5t_open_mtagset (
|
||||
h5_file_t* const f,
|
||||
const char *name,
|
||||
h5t_tagset_t** retval
|
||||
);
|
||||
h5_ssize_t
|
||||
h5t_get_num_mtagsets (
|
||||
h5_file_t* const f
|
||||
);
|
||||
h5_ssize_t
|
||||
h5t_get_mtagsets (
|
||||
h5_file_t* const f,
|
||||
char** names[]
|
||||
);
|
||||
h5_err_t
|
||||
h5t_get_mtagset_info (
|
||||
h5_file_t* const f,
|
||||
const h5_id_t idx,
|
||||
char** names,
|
||||
h5_id_t* type
|
||||
);
|
||||
h5_id_t
|
||||
h5t_get_mtagset_type_by_name (
|
||||
h5_file_t* const f,
|
||||
char name[]
|
||||
);
|
||||
h5t_get_num_mtagsets (h5t_mesh_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_set_mtag_by_name (
|
||||
h5_file_t* const f,
|
||||
char name[],
|
||||
const h5_loc_id_t entity_id,
|
||||
const size_t dim,
|
||||
void* value
|
||||
);
|
||||
h5t_get_mtagset_info (h5t_mesh_t* const, const h5_size_t, char[],
|
||||
const h5_size_t, h5_int64_t* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_mtag_by_name (
|
||||
h5_file_t* const f,
|
||||
const char name[],
|
||||
const h5_loc_id_t entity_id,
|
||||
size_t* dim,
|
||||
void* vals );
|
||||
h5t_mtagset_exists (h5t_mesh_t* const, const char* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_remove_mtag_by_name (
|
||||
h5_file_t* const f,
|
||||
const char name[],
|
||||
const h5_loc_id_t entity_id
|
||||
);
|
||||
|
||||
h5_ssize_t
|
||||
h5t_get_tag (
|
||||
h5_file_t *const f,
|
||||
const h5t_tagset_t *tagset,
|
||||
const h5_loc_id_t entity_id,
|
||||
size_t* const dim,
|
||||
void* const vals
|
||||
);
|
||||
h5t_create_mtagset (h5t_mesh_t* const, const char[], const h5_id_t, h5t_tagset_t**);
|
||||
|
||||
h5_err_t
|
||||
h5t_remove_mtag (
|
||||
h5_file_t* const f,
|
||||
h5t_tagset_t* tagset,
|
||||
const h5_loc_id_t entity_id
|
||||
);
|
||||
h5t_open_mtagset (h5t_mesh_t* const, const char* const, h5t_tagset_t**);
|
||||
|
||||
h5_ssize_t
|
||||
h5t_get_mtagset_names_of_entity (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
char *names[],
|
||||
const h5_size_t dim
|
||||
);
|
||||
h5_err_t
|
||||
h5t_close_mtagset (h5t_tagset_t*);
|
||||
|
||||
h5_err_t
|
||||
h5t_remove_mtagset (h5t_mesh_t* const, const char[]);
|
||||
|
||||
h5_err_t
|
||||
h5t_set_tag (h5t_tagset_t* const, const h5_loc_id_t, const h5_size_t, void*);
|
||||
|
||||
h5_loc_id_t
|
||||
h5t_get_tag (const h5t_tagset_t*, const h5_loc_id_t, h5_size_t* const, void* const);
|
||||
|
||||
h5_err_t
|
||||
h5t_remove_tag (h5t_tagset_t*, const h5_loc_id_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user