tag implementation, bugfixes ...

This commit is contained in:
2009-11-13 21:46:53 +00:00
parent 22a1fa33eb
commit 57a9c11948
3 changed files with 243 additions and 0 deletions
+2
View File
@@ -363,6 +363,8 @@ src/H5Fed_retrieve.c -text
src/H5Fed_retrieve.h -text
src/H5Fed_store.c -text
src/H5Fed_store.h -text
src/H5Fed_tags.c -text
src/H5Fed_tags.h -text
src/H5Part.c -text
src/H5Part.h -text
src/H5_inquiry.c -text
+201
View File
@@ -0,0 +1,201 @@
/*
Copyright 2007-2009
Paul Scherrer Institut, Villigen, Switzerland;
Achim Gsell
All rights reserved.
Authors
Achim Gsell
Warning
This code is under development.
*/
#include <hdf5.h>
#include "h5_core/h5_core.h"
#include "H5Fed.h"
/*!
Add a tagset to the current mesh.
\param[in] f file handle
\param[in] name name of tagset
\param[in] type data type of tagset
\return H5_SUCCESS or error code
*/
h5_err_t
H5FedAddMTagset (
h5_file_t * const f,
char * name,
h5_id_t type
) {
SET_FNAME ( f, __func__ );
return h5t_add_mtagset ( f, name, type );
}
/*!
Remove a tagset from the current mesh.
\param[in] f file handle
\param[in] name name of tagset to remove
\return H5_SUCCESS or error code
*/
h5_err_t
H5FedRemoveMTagset (
h5_file_t *const f,
char name[]
) {
SET_FNAME ( f, __func__ );
return h5t_remove_mtagset (f, name );
}
/*!
Get available tagsets in current mesh.
\param[in] f file handle
\param[out] names names of available tagsets
\return Number of tagsets or error code
*/
h5_size_t
H5FedGetMTagsets (
h5_file_t *const f,
char **names[]
) {
SET_FNAME ( f, __func__ );
return h5t_get_mtagsets ( f, names );
}
/*!
Get type of tagset in current mesh.
\param[in] f file handle
\param[in] name name of tagset
\return H5_SUCCESS or error code
*/
h5_id_t
H5FedGetTypeOfMTagset (
h5_file_t *const f,
char name[]
) {
SET_FNAME ( f, __func__ );
return h5t_get_mtagset_type ( f, name );
}
/*!
Set tag for entity in current mesh.
\param[in] f file handle
\param[in] name names of tagset
\param[in] id id of entity
\param[in] dim dimension of value
\param[in] val tag value
\return H5_SUCCESS or error code
*/
h5_err_t
H5FedSetMTag (
h5_file_t *const f,
char name[],
h5_id_t id,
const size_t dims,
void *val
) {
SET_FNAME ( f, __func__ );
return h5t_set_mtag ( f, name, id, dims, val );
}
h5_err_t
H5FedSetMTagToVertex (
h5_file_t *const f,
char name[],
h5_id_t id,
const size_t dims,
void *val
) {
SET_FNAME ( f, __func__ );
id = _h5t_set_entity_type ( H5T_ETYPE_VERTEX, id );
return h5t_set_mtag ( f, name, id, dims, val );
}
h5_err_t
H5FedSetMTagToEdge (
h5_file_t *const f,
char name[],
h5_id_t id,
const size_t dims,
void *val
) {
SET_FNAME ( f, __func__ );
id = _h5t_set_entity_type ( H5T_ETYPE_EDGE, id );
return h5t_set_mtag ( f, name, id, dims, val );
}
h5_err_t
H5FedSetMTagToTriangle (
h5_file_t *const f,
char name[],
h5_id_t id,
const size_t dims,
void *val
) {
SET_FNAME ( f, __func__ );
id = _h5t_set_entity_type ( H5T_ETYPE_TRIANGLE, id );
return h5t_set_mtag ( f, name, id, dims, val );
}
h5_err_t
H5FedSetMTagToTet (
h5_file_t *const f,
char name[],
h5_id_t id,
const size_t dims,
void *val
) {
SET_FNAME ( f, __func__ );
id = _h5t_set_entity_type ( H5T_ETYPE_TET, id );
return h5t_set_mtag ( f, name, id, dims, val );
}
/*!
Set tag for entity in current mesh.
\param[in] f file handle
\param[in] name names of tagset
\param[in] id id of entity
\param[out] dim dimension of value
\param[out] val tag value
\return H5_SUCCESS or error code
*/
h5_err_t
H5FedGetMTag (
h5_file_t *const f,
const char name[],
const h5_id_t id,
size_t *dims,
void *val
) {
SET_FNAME ( f, __func__ );
return h5t_get_mtag ( f, name, id, dims, val );
}
/*!
Remove tag for entity in current mesh.
\param[in] f file handle
\param[in] name names of tagset
\param[in] id id of entity
*/
h5_err_t
H5FedRemoveMTag (
h5_file_t *const f,
const char name[],
const h5_id_t id
) {
SET_FNAME ( f, __func__ );
return h5t_remove_mtag ( f, name, id );
}
+40
View File
@@ -0,0 +1,40 @@
#ifndef __H5FED_TAGS_H
#define __H5FED_TAGS_H
h5_err_t H5FedAddMTagset ( h5_file_t * const f,
char * name,
h5_id_t type );
h5_err_t H5FedRemoveMTagset ( h5_file_t *const f,
char name[] );
h5_size_t H5FedGetMTagsets ( h5_file_t *const f,
char **names[] );
h5_id_t H5FedGetTypeOfMTagset ( h5_file_t *const f,
char name[] );
h5_err_t H5FedSetMTag ( h5_file_t *const f,
char name[], h5_id_t id,
const size_t dims, void *val );
h5_err_t H5FedSetMTagToVertex ( h5_file_t *const f,
char name[], h5_id_t id,
const size_t dims, void *val );
h5_err_t H5FedSetMTagToEdge ( h5_file_t *const f,
char name[], h5_id_t id,
const size_t dims, void *val );
h5_err_t H5FedSetMTagToTriangle ( h5_file_t *const f,
char name[], h5_id_t id,
const size_t dims, void *val );
h5_err_t H5FedSetMTagToTet ( h5_file_t *const f,
char name[], h5_id_t id,
const size_t dims, void *val );
h5_err_t H5FedGetMTag ( h5_file_t *const f,
const char name[], const h5_id_t id,
size_t *dims, void *val );
h5_err_t H5FedRemoveMTag ( h5_file_t *const f,
const char name[], const h5_id_t id );
/*
Get descriptor for a tagset
Get tag value by descriptor
get size of value
Get tagset names for specific entity
*/
#endif