Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8c84a3bff | |||
| 30cf451716 | |||
| c1eadeb678 | |||
| 8030a7246b | |||
| 81f7f7716f | |||
| 7baf635bef | |||
| 87eae5c238 |
@@ -368,12 +368,6 @@ src/C++/Makefile.am -text
|
||||
src/C/H5.c -text
|
||||
src/C/H5Block.c -text
|
||||
src/C/H5Block_readwrite.c -text
|
||||
src/C/H5Fed.c -text
|
||||
src/C/H5Fed_adjacency.c -text
|
||||
src/C/H5Fed_inquiry.c -text
|
||||
src/C/H5Fed_retrieve.c -text
|
||||
src/C/H5Fed_store.c -text
|
||||
src/C/H5Fed_tags.c -text
|
||||
src/C/H5Part.c -text
|
||||
src/C/H5_attachments.c -text
|
||||
src/C/H5_attribs.c -text
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
Copyright 2007-2009
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
|
||||
h5_err_t
|
||||
H5FedCloseMesh (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_close_mesh (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedSetLevel (
|
||||
h5_file_t* const f,
|
||||
const h5t_lvl_idx_t level_id
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, level_id=%d", f, level_id);
|
||||
H5_API_RETURN (h5t_set_level (f, level_id));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedLinkMeshToStep (
|
||||
h5_file_t* const f,
|
||||
const h5_id_t mesh_id
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, mesh_id=%lld", f, (long long)mesh_id);
|
||||
H5_API_RETURN (h5_error_not_implemented ());
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
Copyright 2006-2010
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
/****** UPWARD ADJACENCY routines *********************************************/
|
||||
|
||||
/*!
|
||||
\return number of upward adjacent edges
|
||||
*/
|
||||
h5_err_t
|
||||
H5FedGetAdjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
H5_API_ENTER4 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, dim=%d, list=0x%p",
|
||||
f, (long long)entity_id, dim, list);
|
||||
H5_API_RETURN (h5t_get_adjacencies (f, entity_id, dim, list));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedReleaseListOfAdjacencies (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t,
|
||||
"f=0x%p, list=0x%p",
|
||||
f, list);
|
||||
H5_API_RETURN (h5t_release_list_of_adjacencies (f, list));
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
Copyright 2007-2008
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
\defgroup h5fed_mesh_inquiry
|
||||
*/
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
|
||||
/*!
|
||||
Get the number of hierarchical mesh levels.
|
||||
|
||||
\param[in] f File handle
|
||||
|
||||
\return Number of hierarchical mesh levels or error code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5FedGetNumLevels (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_leaf_levels (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
Get current mesh levels.
|
||||
|
||||
\param[in] f File handle
|
||||
|
||||
\return ID of current mesh levels or error code.
|
||||
*/
|
||||
h5t_lvl_idx_t
|
||||
H5FedGetLevel (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5t_lvl_idx_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_level (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of vertices used for defining the (sub-)mesh
|
||||
at current level on this compute node.
|
||||
|
||||
\param[in] f file handle
|
||||
|
||||
\return Number of vertices or error code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5FedGetNumVertices (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_vertices (f, -1));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of vertices used for defining the (sub-)mesh
|
||||
at current level on compute node \c cnode.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] cnode compute node
|
||||
|
||||
\return Number of vertices or error code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5FedGetNumVerticesCnode (
|
||||
h5_file_t* const f,
|
||||
const int cnode
|
||||
) {
|
||||
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, cnode=%d", f, cnode);
|
||||
H5_API_RETURN (h5t_get_num_vertices (f, cnode));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of vertices used for defining the (sub-)mesh
|
||||
at current level overl all compute nodes.
|
||||
|
||||
\param[in] f file handle
|
||||
|
||||
\return Total number of vertices or error code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5FedGetNumVerticesTotal (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_vertices (f, -1));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of elements present in the (sub-)mesh
|
||||
at current level on this compute node.
|
||||
|
||||
\param[in] f file handle
|
||||
|
||||
\return Number of elements or error code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5FedGetNumElements (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
// MLH: can't use field from opaque h5_file_t!
|
||||
//h5_ssize_t num = h5t_get_num_elems (f, f->myproc);
|
||||
H5_API_RETURN (h5t_get_num_elems (f, -1));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of elements present in the (sub-)mesh
|
||||
at current level on compute node \c cnode.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] cnode Compute node
|
||||
|
||||
\return Number of elements or error code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5FedGetNumElementsCnode (
|
||||
h5_file_t* const f,
|
||||
const int cnode
|
||||
) {
|
||||
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, cnode=%d", f, cnode);
|
||||
H5_API_RETURN (h5t_get_num_elems (f, cnode));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of elements present in the mesh
|
||||
at current level over all compute nodes.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return Number of elements or error code.
|
||||
*/
|
||||
h5_ssize_t
|
||||
H5FedGetNumElementsTotal (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_elems (f, -1));
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
/****** RETRIEVAL routines **************************************************/
|
||||
/*
|
||||
Copyright 2007-2008
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
/*!
|
||||
Begin traverse over all entities on this compute node.
|
||||
Initialize internal data structures.
|
||||
|
||||
\remark
|
||||
Entities might be on processor boundaries! Therefore the same entity might be
|
||||
processed on several compute nodes.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] codim co-dimension of entity to traverse
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
|
||||
h5t_iterator_p
|
||||
H5FedBeginTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
const int codim
|
||||
) {
|
||||
H5_API_ENTER2 (h5t_iterator_p, "f=0x%p, codim=%d", f, codim);
|
||||
h5t_iterator_p iter;
|
||||
TRY2 (iter = h5_calloc (1, sizeof (*iter)));
|
||||
TRY2 (h5t_init_leaf_iterator (f, iter, codim));
|
||||
H5_API_RETURN (iter);
|
||||
}
|
||||
|
||||
h5t_iterator_p
|
||||
H5FedBeginTraverseBoundaryFaces (
|
||||
h5_file_t* const f,
|
||||
const int codim
|
||||
) {
|
||||
H5_API_ENTER2 (h5t_iterator_p, "f=0x%p, codim=%d", f, codim);
|
||||
h5t_iterator_p iter;
|
||||
TRY2 (iter = h5_calloc (1, sizeof (*iter)));
|
||||
TRY2 (h5t_init_boundary_face_iterator (f, iter, codim));
|
||||
H5_API_RETURN (iter);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get next local entity ID.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in/out] iter iterator
|
||||
|
||||
\return Local entity ID
|
||||
\return -1, if done
|
||||
\return error code on error
|
||||
*/
|
||||
h5_loc_id_t
|
||||
H5FedTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
h5t_iterator_t* iter
|
||||
) {
|
||||
H5_API_ENTER2 (h5_loc_id_t, "f=0x%p, iter=0x%p", f, iter);
|
||||
H5_API_RETURN (h5t_iterate_entities (f, iter));
|
||||
}
|
||||
|
||||
/*!
|
||||
End of traversing. Release internal data structures.
|
||||
|
||||
\param[in] f File handle
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
|
||||
*/
|
||||
h5_err_t
|
||||
H5FedEndTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
h5t_iterator_t* iter
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, iter=0x%p", f, iter);
|
||||
H5_API_RETURN (h5t_release_entity_iterator (f, iter));
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Get coordinates of vertex given by local index
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] vertex_idx local index of vertex
|
||||
\param[out] P 3-dimensional coordinates
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
h5_err_t
|
||||
H5FedGetVertexCoordsByIndex (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t vertex_index,
|
||||
h5_float64_t P[3]
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, vertex_index=%lld, P=0x%p",
|
||||
f, (long long)vertex_index, P);
|
||||
H5_API_RETURN (h5t_get_vertex_coords_by_index (f, vertex_index, P));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedGetVertexCoordsByID (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t vertex_id,
|
||||
h5_float64_t P[3]
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, vertex_id=%lld, P=0x%p",
|
||||
f, (long long)vertex_id, P);
|
||||
H5_API_RETURN (h5t_get_vertex_coords_by_id (f, vertex_id, P));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfEdge (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_edge (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfTriangle (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_triangle (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfTet (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_tet (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfEntity (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_entity (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
/*
|
||||
Copyright 2007-2008
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Benedikt Oswald;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Add a new level with \c num_elems elements. The number of elements must be the
|
||||
real number of elements to add the level. If you want to refine \c n tetrahedra
|
||||
\c n*8 elements must be added.
|
||||
|
||||
\param[in] f File handle.
|
||||
\param[in] num_elems_to_refine Number of elements which will be refined.
|
||||
|
||||
\return ID of new level.
|
||||
|
||||
\note
|
||||
values for f->t.num_levels:
|
||||
\c -1 unknown: after opening the file. This is equivalent to
|
||||
"topological data has not been initialized".
|
||||
\c 0 no levels: HDF5 group for meshes may already exist but must not!
|
||||
\c > 0 number of mesh levels
|
||||
|
||||
*/
|
||||
h5t_lvl_idx_t
|
||||
H5FedAddLevel (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5t_lvl_idx_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_add_level (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedBeginStoreVertices (
|
||||
h5_file_t* const f,
|
||||
const h5_size_t num
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t,
|
||||
"f=0x%p, num=%llu",
|
||||
f, (long long unsigned)num);
|
||||
H5_API_RETURN (h5t_begin_store_vertices (f, num));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the the coordinates of a specific vertex at level \c level
|
||||
with id \c vertex_id of the tetrahedral mesh.
|
||||
|
||||
\return local vertex id on success
|
||||
\return errno on error
|
||||
*/
|
||||
h5_loc_idx_t
|
||||
H5FedStoreVertex (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_glb_id_t vertex_id, /*!< id from mesher or -1 */
|
||||
const h5_float64_t P[3] /*!< coordinates */
|
||||
) {
|
||||
H5_API_ENTER3 (h5_loc_idx_t,
|
||||
"f=0x%p, vertex_id=%lld, P=0x%p",
|
||||
f, (long long)vertex_id, P);
|
||||
if (h5t_get_level (f) != 0) {
|
||||
H5_API_LEAVE (
|
||||
h5_error (
|
||||
H5_ERR_INVAL,
|
||||
"Vertices can be added to level 0 only!"));
|
||||
}
|
||||
H5_API_RETURN (h5t_store_vertex (f, vertex_id, P));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedEndStoreVertices (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_end_store_vertices (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedBeginStoreElements (
|
||||
h5_file_t* const f,
|
||||
const h5_size_t num
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t,
|
||||
"f=0x%p, num=%llu",
|
||||
f, (long long unsigned)num);
|
||||
H5_API_RETURN (h5t_begin_store_elems (f, num));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the 4-tuple, that contains the specific indices describing
|
||||
a tetrahedron with id \c tet_id at level \c level of the tetrahedral
|
||||
mesh.
|
||||
|
||||
Errors:
|
||||
* current level not yet defined
|
||||
* to many tets stored on level
|
||||
|
||||
\return local tetrahedron id
|
||||
\return \c errno on error
|
||||
*/
|
||||
h5_loc_idx_t
|
||||
H5FedStoreElement (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_loc_idx_t local_vids[] /*!< tuple with vertex id's */
|
||||
) {
|
||||
H5_API_ENTER2 (h5_loc_idx_t, "f=0x%p, local_vids=0x%p", f, local_vids);
|
||||
if (h5t_get_level (f) != 0) {
|
||||
H5_API_LEAVE (
|
||||
h5_error (
|
||||
H5_ERR_INVAL,
|
||||
"Elements can be added to level 0 only!"));
|
||||
}
|
||||
H5_API_RETURN (h5t_store_elem (f, -1, local_vids));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedEndStoreElements (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_end_store_elems (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedBeginRefineElements (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_begin_refine_elems (f));
|
||||
}
|
||||
|
||||
h5_loc_idx_t
|
||||
H5FedRefineElement (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_loc_id_t local_eid /*!< local element id */
|
||||
) {
|
||||
H5_API_ENTER2 (h5_loc_idx_t,
|
||||
"f=0x%p, local_eid=%lld",
|
||||
f, (long long)local_eid);
|
||||
H5_API_RETURN (h5t_mark_entity (f, local_eid));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedEndRefineElements (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_end_refine_elems (f));
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
Copyright 2007-2011
|
||||
Paul Scherrer Institut, Villigen, Switzerland;
|
||||
Achim Gsell
|
||||
All rights reserved.
|
||||
|
||||
Authors
|
||||
Achim Gsell
|
||||
|
||||
Warning
|
||||
This code is under development.
|
||||
|
||||
*/
|
||||
#include "h5core/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
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", type=%lld",
|
||||
f, name, (long long)type);
|
||||
H5_API_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[]
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, name=\"%s\"", f, name);
|
||||
H5_API_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_ssize_t
|
||||
H5FedGetMTagsets (
|
||||
h5_file_t* const f,
|
||||
char** names[]
|
||||
) {
|
||||
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, names=0x%p", f, names);
|
||||
H5_API_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[]
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, name=\"%s\"", f, name);
|
||||
H5_API_RETURN (h5t_get_mtagset_type_by_name (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_loc_id_t id,
|
||||
const size_t dim,
|
||||
void* buffer
|
||||
) {
|
||||
H5_API_ENTER5 (h5_err_t,
|
||||
"f=0x%p, name=\"%s\", id=%lld, dim=%lld, val=0x%p",
|
||||
f, name, (long long)id, (long long)dim, buffer);
|
||||
H5_API_RETURN (h5t_set_mtag_by_name (f, name, id, dim, buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
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_loc_id_t id,
|
||||
size_t* dim,
|
||||
void* buffer
|
||||
) {
|
||||
H5_API_ENTER5 (h5_err_t,
|
||||
"f=0x%p, name=\"%s\", id=%lld, dim=0x%p, val=0x%p",
|
||||
f, name, (long long)id, dim, buffer);
|
||||
H5_API_RETURN (h5t_get_mtag_by_name (f, name, id, dim, buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
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_loc_id_t id
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", id=%lld",
|
||||
f, name, (long long)id);
|
||||
H5_API_RETURN (h5t_remove_mtag_by_name (f, name, id));
|
||||
}
|
||||
+1
-7
@@ -37,13 +37,7 @@ ___lib_libH5hutC_a_SOURCES = \
|
||||
H5_attachments.c \
|
||||
H5Part.c \
|
||||
H5Block.c \
|
||||
H5Block_readwrite.c \
|
||||
H5Fed.c \
|
||||
H5Fed_adjacency.c \
|
||||
H5Fed_inquiry.c \
|
||||
H5Fed_retrieve.c \
|
||||
H5Fed_store.c \
|
||||
H5Fed_tags.c
|
||||
H5Block_readwrite.c
|
||||
|
||||
all: all-am
|
||||
|
||||
|
||||
@@ -72,15 +72,19 @@ h5t_open_tetrahedral_mesh (
|
||||
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;
|
||||
if (id == -1) { // add new
|
||||
id = 0;
|
||||
t->num_meshes = 1;
|
||||
t->cur_mesh = 0;
|
||||
t->mesh_changed = 0;
|
||||
t->leaf_level = 0;
|
||||
t->num_leaf_levels = 0;
|
||||
TRY (open_tetmesh_group (f, id));
|
||||
} else { // read existing
|
||||
TRY (open_tetmesh_group (f, id));
|
||||
TRY (h5tpriv_read_mesh (f));
|
||||
t->leaf_level = 0;
|
||||
}
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ static struct h5t_methods tri_funcs = {
|
||||
&h5tpriv_trim_adjacency_methods
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Open container of triangle meshes
|
||||
*/
|
||||
static inline h5_err_t
|
||||
open_trimeshes_group (
|
||||
h5_file_t* const f
|
||||
@@ -30,7 +32,7 @@ open_trimeshes_group (
|
||||
}
|
||||
|
||||
/*
|
||||
open HDF5 group with data of specific mesh.
|
||||
Open container of triangle mesh with \c id
|
||||
*/
|
||||
static inline h5_err_t
|
||||
open_trimesh_group (
|
||||
@@ -73,16 +75,20 @@ h5t_open_triangle_mesh (
|
||||
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) { // add new
|
||||
id = t->num_meshes;
|
||||
t->num_meshes++;
|
||||
t->mesh_changed = id;
|
||||
id = 0;
|
||||
t->num_meshes = 1;
|
||||
t->cur_mesh = 0;
|
||||
t->mesh_changed = 0;
|
||||
t->leaf_level = 0;
|
||||
t->num_leaf_levels = 0;
|
||||
TRY (open_trimesh_group (f, 0));
|
||||
} else { // read existing
|
||||
TRY (open_trimesh_group (f, 0));
|
||||
TRY (h5tpriv_read_mesh (f));
|
||||
}
|
||||
t->leaf_level = 0;
|
||||
}
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -124,8 +130,6 @@ h5t_open_triangle_mesh_by_name (
|
||||
|
||||
TRY (h5t_close_mesh (f));
|
||||
|
||||
|
||||
|
||||
t->dsinfo_elems.type_id = t->dtypes.h5_triangle_t;
|
||||
t->methods = tri_funcs;
|
||||
t->ref_elem = &h5t_tri_ref_elem;
|
||||
|
||||
+16
-22
@@ -6,11 +6,10 @@ h5u_get_num_particles (
|
||||
h5_file_t *const f /*!< [in] Handle to open file */
|
||||
) {
|
||||
H5_CORE_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
h5_int64_t nparticles;
|
||||
h5_ssize_t nparticles;
|
||||
|
||||
/* if a view exists, use its size as the number of particles */
|
||||
if ( h5u_has_view ( f ) )
|
||||
{
|
||||
if (h5u_has_view (f)) {
|
||||
TRY (nparticles = hdf5_get_selected_npoints_of_dataspace(
|
||||
f->u->diskshape));
|
||||
h5_debug(
|
||||
@@ -22,8 +21,7 @@ h5u_get_num_particles (
|
||||
h5_debug(
|
||||
"Found %lld particles from previous H5PartSetNumParticles call.",
|
||||
(long long)nparticles );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/* otherwise, report all particles on disk in the first dataset
|
||||
* for this timestep */
|
||||
char dataset_name[H5_DATANAME_LEN];
|
||||
@@ -33,20 +31,20 @@ h5u_get_num_particles (
|
||||
0,
|
||||
dataset_name,
|
||||
H5_DATANAME_LEN);
|
||||
if ( exists < 0 )
|
||||
if (exists < 0)
|
||||
H5_CORE_API_LEAVE (
|
||||
h5_error(
|
||||
h5_error (
|
||||
H5_ERR_INVAL,
|
||||
"Cannot determine the number of particles: "
|
||||
"H5PartSetNumParticles has not been called, "
|
||||
"no view has been set, and there are no "
|
||||
"data sets for this time step!"));
|
||||
TRY( nparticles = hdf5_get_npoints_of_dataset_by_name(
|
||||
f->step_gid,
|
||||
dataset_name) );
|
||||
h5_debug(
|
||||
TRY (nparticles = hdf5_get_npoints_of_dataset_by_name(
|
||||
f->step_gid,
|
||||
dataset_name) );
|
||||
h5_debug (
|
||||
"Found %lld particles in the first data set of this time step.",
|
||||
(long long)nparticles );
|
||||
(long long)nparticles);
|
||||
}
|
||||
|
||||
H5_CORE_API_RETURN (nparticles);
|
||||
@@ -63,21 +61,19 @@ h5u_set_num_particles (
|
||||
f, (long long unsigned)nparticles,
|
||||
(long long unsigned)stride);
|
||||
struct h5u_fdata *u = f->u;
|
||||
hsize_t hstride;
|
||||
hsize_t count;
|
||||
hsize_t start;
|
||||
hsize_t total;
|
||||
hsize_t dmax = H5S_UNLIMITED;
|
||||
|
||||
if ( nparticles <= 0 )
|
||||
if (nparticles <= 0)
|
||||
H5_CORE_API_LEAVE (
|
||||
h5_error(
|
||||
H5_ERR_INVAL,
|
||||
"Invalid number particles: %lld!\n",
|
||||
(long long)nparticles));
|
||||
|
||||
hstride = (hsize_t)stride;
|
||||
if ( hstride > 1 )
|
||||
hsize_t hstride = (hsize_t)stride;
|
||||
if (hstride > 1)
|
||||
h5_debug ("Striding by %lld elements.", (long long)hstride);
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
@@ -100,14 +96,13 @@ h5u_set_num_particles (
|
||||
u->nparticles = (hsize_t)nparticles;
|
||||
|
||||
/* declare local memory datasize with striding */
|
||||
count = u->nparticles * stride;
|
||||
hsize_t count = u->nparticles * stride;
|
||||
TRY (u->memshape = hdf5_create_dataspace (1, &count, &dmax));
|
||||
|
||||
/* we need a hyperslab selection if there is striding
|
||||
* (otherwise, the default H5S_ALL selection is ok)
|
||||
*/
|
||||
if ( hstride > 1 )
|
||||
{
|
||||
if (hstride > 1) {
|
||||
start = 0;
|
||||
count = u->nparticles;
|
||||
TRY (hdf5_select_hyperslab_of_dataspace(
|
||||
@@ -205,7 +200,6 @@ h5u_set_view (
|
||||
f, (long long)start, (long long)end);
|
||||
hsize_t total;
|
||||
hsize_t stride = 1;
|
||||
hsize_t hstart;
|
||||
hsize_t dmax = H5S_UNLIMITED;
|
||||
struct h5u_fdata *u = f->u;
|
||||
|
||||
@@ -260,7 +254,7 @@ h5u_set_view (
|
||||
TRY (u->diskshape = hdf5_create_dataspace ( 1, &total, NULL ));
|
||||
|
||||
total = (hsize_t)u->nparticles;
|
||||
hstart = (size_t)start;
|
||||
hsize_t hstart = (hsize_t)start;
|
||||
|
||||
TRY (hdf5_select_hyperslab_of_dataspace (
|
||||
u->diskshape,
|
||||
|
||||
@@ -36,7 +36,7 @@ h5u_read_data (
|
||||
TRY (ndisk = hdf5_get_npoints_of_dataspace (space_id));
|
||||
|
||||
if (u->diskshape != H5S_ALL) {
|
||||
TRY (nread = hdf5_get_npoints_of_dataspace(u->diskshape));
|
||||
TRY (nread = hdf5_get_selected_npoints_of_dataspace (u->diskshape));
|
||||
|
||||
/* make sure the disk space selected by the view doesn't
|
||||
* exceed the size of the dataset */
|
||||
|
||||
+18
-9
@@ -49,22 +49,31 @@ H5FedOpenTriangleMesh (
|
||||
H5_API_RETURN (h5t_open_triangle_mesh (f, mesh_id));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedCloseMesh (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_close_mesh (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedSetLevel (
|
||||
h5_file_t * f,
|
||||
h5_file_t* const f,
|
||||
const h5t_lvl_idx_t level_id
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, level_id=%d", f, level_id);
|
||||
H5_API_RETURN (h5t_set_level (f, level_id));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedLinkMeshToStep (
|
||||
h5_file_t * f,
|
||||
h5_file_t* const f,
|
||||
const h5_id_t mesh_id
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, mesh_id=%lld", f, (long long)mesh_id);
|
||||
H5_API_RETURN (h5_error_not_implemented ());
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -5,19 +5,29 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedGetAdjacencies (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_id_t entity_id,
|
||||
const h5_int32_t dim,
|
||||
h5_loc_idlist_t** list
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER4 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, dim=%d, list=0x%p",
|
||||
f, (long long)entity_id, dim, list);
|
||||
H5_API_RETURN (h5t_get_adjacencies (f, entity_id, dim, list));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedReleaseListOfAdjacencies (
|
||||
h5_file_t * const f,
|
||||
h5_loc_idlist_t **list
|
||||
);
|
||||
h5_file_t* const f,
|
||||
h5_loc_idlist_t** list
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t,
|
||||
"f=0x%p, list=0x%p",
|
||||
f, list);
|
||||
H5_API_RETURN (h5t_release_list_of_adjacencies (f, list));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+131
-8
@@ -46,14 +46,137 @@ H5FedGetNumTriangleMeshes (
|
||||
H5_API_RETURN (h5t_get_num_trimeshes (f));
|
||||
}
|
||||
|
||||
h5_ssize_t H5FedGetNumLevels ( h5_file_t * const f );
|
||||
h5t_lvl_idx_t H5FedGetLevel ( h5_file_t * const f );
|
||||
h5_ssize_t H5FedGetNumVertices ( h5_file_t * const f );
|
||||
h5_ssize_t H5FedGetNumVerticesCnode ( h5_file_t * const f, const int cnode );
|
||||
h5_ssize_t H5FedGetNumVerticesTotal ( h5_file_t * const f );
|
||||
h5_ssize_t H5FedGetNumElements ( h5_file_t * const f );
|
||||
h5_ssize_t H5FedGetNumElementsCnode ( h5_file_t * const f, const int cnode );
|
||||
h5_ssize_t H5FedGetNumElementsTotal ( h5_file_t * const f );
|
||||
/*!
|
||||
Get the number of hierarchical mesh levels.
|
||||
|
||||
\param[in] f File handle
|
||||
|
||||
\return Number of hierarchical mesh levels or error code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetNumLevels (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_leaf_levels (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
Get current mesh levels.
|
||||
|
||||
\param[in] f File handle
|
||||
|
||||
\return ID of current mesh levels or error code.
|
||||
*/
|
||||
static inline h5t_lvl_idx_t
|
||||
H5FedGetLevel (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5t_lvl_idx_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_level (f));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of vertices used for defining the (sub-)mesh
|
||||
at current level on this compute node.
|
||||
|
||||
\param[in] f file handle
|
||||
|
||||
\return Number of vertices or error code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetNumVertices (
|
||||
h5_file_t* const f /*!< file handle */
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_vertices (f, -1));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of vertices used for defining the (sub-)mesh
|
||||
at current level on compute node \c cnode.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] cnode compute node
|
||||
|
||||
\return Number of vertices or error code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetNumVerticesCnode (
|
||||
h5_file_t* const f,
|
||||
const int cnode
|
||||
) {
|
||||
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, cnode=%d", f, cnode);
|
||||
H5_API_RETURN (h5t_get_num_vertices (f, cnode));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of vertices used for defining the (sub-)mesh
|
||||
at current level overl all compute nodes.
|
||||
|
||||
\param[in] f file handle
|
||||
|
||||
\return Total number of vertices or error code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetNumVerticesTotal (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_vertices (f, -1));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of elements present in the (sub-)mesh
|
||||
at current level on this compute node.
|
||||
|
||||
\param[in] f file handle
|
||||
|
||||
\return Number of elements or error code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetNumElements (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
// MLH: can't use field from opaque h5_file_t!
|
||||
//h5_ssize_t num = h5t_get_num_elems (f, f->myproc);
|
||||
H5_API_RETURN (h5t_get_num_elems (f, -1));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of elements present in the (sub-)mesh
|
||||
at current level on compute node \c cnode.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] cnode Compute node
|
||||
|
||||
\return Number of elements or error code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetNumElementsCnode (
|
||||
h5_file_t* const f,
|
||||
const int cnode
|
||||
) {
|
||||
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, cnode=%d", f, cnode);
|
||||
H5_API_RETURN (h5t_get_num_elems (f, cnode));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of elements present in the mesh
|
||||
at current level over all compute nodes.
|
||||
|
||||
\param[in] f File handle.
|
||||
|
||||
\return Number of elements or error code.
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetNumElementsTotal (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_ssize_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_get_num_elems (f, -1));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+122
-33
@@ -19,73 +19,162 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5t_iterator_t*
|
||||
|
||||
/*!
|
||||
Begin traverse over all entities on this compute node.
|
||||
Initialize internal data structures.
|
||||
|
||||
\remark
|
||||
Entities might be on processor boundaries! Therefore the same entity might be
|
||||
processed on several compute nodes.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] codim co-dimension of entity to traverse
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
|
||||
static inline h5t_iterator_p
|
||||
H5FedBeginTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
int codim
|
||||
);
|
||||
h5t_iterator_t*
|
||||
const int codim
|
||||
) {
|
||||
H5_API_ENTER2 (h5t_iterator_p, "f=0x%p, codim=%d", f, codim);
|
||||
h5t_iterator_p iter;
|
||||
TRY3 (h5t_iterator_p, iter = (h5t_iterator_p)h5_calloc (1, sizeof (*iter)));
|
||||
TRY3 (h5t_iterator_p, h5t_init_leaf_iterator (f, iter, codim));
|
||||
H5_API_RETURN (iter);
|
||||
}
|
||||
|
||||
static inline h5t_iterator_p
|
||||
H5FedBeginTraverseBoundaryFaces (
|
||||
h5_file_t* const f,
|
||||
int codim
|
||||
);
|
||||
h5_loc_id_t
|
||||
const int codim
|
||||
) {
|
||||
H5_API_ENTER2 (h5t_iterator_p, "f=0x%p, codim=%d", f, codim);
|
||||
h5t_iterator_p iter;
|
||||
TRY3 (h5t_iterator_p, iter = (h5t_iterator_p)h5_calloc (1, sizeof (*iter)));
|
||||
TRY3 (h5t_iterator_p, h5t_init_boundary_face_iterator (f, iter, codim));
|
||||
H5_API_RETURN (iter);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get next local entity ID.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in/out] iter iterator
|
||||
|
||||
\return Local entity ID
|
||||
\return -1, if done
|
||||
\return error code on error
|
||||
*/
|
||||
static inline h5_loc_id_t
|
||||
H5FedTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
h5t_iterator_t* iter
|
||||
);
|
||||
h5_err_t
|
||||
) {
|
||||
H5_API_ENTER2 (h5_loc_id_t, "f=0x%p, iter=0x%p", f, iter);
|
||||
H5_API_RETURN (h5t_iterate_entities (f, iter));
|
||||
}
|
||||
|
||||
/*!
|
||||
End of traversing. Release internal data structures.
|
||||
|
||||
\param[in] f File handle
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5FedEndTraverseEntities (
|
||||
h5_file_t* const f,
|
||||
h5t_iterator_t* iter
|
||||
);
|
||||
h5_err_t
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, iter=0x%p", f, iter);
|
||||
H5_API_RETURN (h5t_release_entity_iterator (f, iter));
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Get coordinates of vertex given by local index
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] vertex_idx local index of vertex
|
||||
\param[out] P 3-dimensional coordinates
|
||||
|
||||
\return H5_SUCCESS or error code
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5FedGetVertexCoordsByIndex (
|
||||
h5_file_t* const f,
|
||||
h5_loc_idx_t vertex_index,
|
||||
h5_float64_t P[3]
|
||||
);
|
||||
h5_err_t
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, vertex_index=%lld, P=0x%p",
|
||||
f, (long long)vertex_index, P);
|
||||
H5_API_RETURN (h5t_get_vertex_coords_by_index (f, vertex_index, P));
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
H5FedGetVertexCoordsByID (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t vertex_id,
|
||||
h5_float64_t P[3]
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, vertex_id=%lld, P=0x%p",
|
||||
f, (long long)vertex_id, P);
|
||||
H5_API_RETURN (h5t_get_vertex_coords_by_id (f, vertex_id, P));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedGetVertexIndicesOfEdge (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* const vertex_indices
|
||||
);
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_edge (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedGetVertexIndicesOfTriangle (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* const vertex_indices
|
||||
);
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_triangle (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
H5FedGetVertexIndicesOfTriangleCClockwise (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* const vertex_indices
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedGetVertexIndicesOfTet (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* const vertex_indices
|
||||
);
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_tet (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedGetVertexIndicesOfEntity (
|
||||
h5_file_t* const f,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* const vertex_indices
|
||||
);
|
||||
h5_loc_idx_t* vertex_indices
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, entity_id=%lld, vertex_indices=0x%p",
|
||||
f, (long long)entity_id, vertex_indices);
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_entity (f, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+136
-44
@@ -39,62 +39,154 @@ H5FedAddTriangleMesh (
|
||||
H5_API_RETURN (h5t_add_triangle_mesh (f));
|
||||
}
|
||||
|
||||
h5t_lvl_idx_t
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Add a new level with \c num_elems elements. The number of elements must be the
|
||||
real number of elements to add the level. If you want to refine \c n tetrahedra
|
||||
\c n*8 elements must be added.
|
||||
|
||||
\param[in] f File handle.
|
||||
\param[in] num_elems_to_refine Number of elements which will be refined.
|
||||
|
||||
\return ID of new level.
|
||||
|
||||
\note
|
||||
values for f->t.num_levels:
|
||||
\c -1 unknown: after opening the file. This is equivalent to
|
||||
"topological data has not been initialized".
|
||||
\c 0 no levels: HDF5 group for meshes may already exist but must not!
|
||||
\c > 0 number of mesh levels
|
||||
|
||||
*/
|
||||
static inline h5t_lvl_idx_t
|
||||
H5FedAddLevel (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5t_lvl_idx_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_add_level (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedBeginStoreVertices (
|
||||
h5_file_t * const f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
h5_loc_idx_t
|
||||
H5FedStoreVertex (
|
||||
h5_file_t * const f,
|
||||
const h5_glb_idx_t id,
|
||||
const h5_float64_t P[3]
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedEndStoreVertices (
|
||||
h5_file_t * const f
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
H5FedBeginStoreElements (
|
||||
h5_file_t * const f,
|
||||
const h5_size_t num
|
||||
);
|
||||
|
||||
|
||||
h5_loc_idx_t
|
||||
H5FedStoreElement (
|
||||
h5_file_t* const f,
|
||||
const h5_loc_idx_t local_vids[]
|
||||
);
|
||||
const h5_size_t num
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t,
|
||||
"f=0x%p, num=%llu",
|
||||
f, (long long unsigned)num);
|
||||
H5_API_RETURN (h5t_begin_store_vertices (f, num));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the the coordinates of a specific vertex at level \c level
|
||||
with id \c vertex_id of the tetrahedral mesh.
|
||||
|
||||
\return local vertex id on success
|
||||
\return errno on error
|
||||
*/
|
||||
static inline h5_loc_idx_t
|
||||
H5FedStoreVertex (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_glb_id_t vertex_id, /*!< id from mesher or -1 */
|
||||
const h5_float64_t P[3] /*!< coordinates */
|
||||
) {
|
||||
H5_API_ENTER3 (h5_loc_idx_t,
|
||||
"f=0x%p, vertex_id=%lld, P=0x%p",
|
||||
f, (long long)vertex_id, P);
|
||||
if (h5t_get_level (f) != 0) {
|
||||
H5_API_LEAVE (
|
||||
h5_error (
|
||||
H5_ERR_INVAL,
|
||||
"Vertices can be added to level 0 only!"));
|
||||
}
|
||||
H5_API_RETURN (h5t_store_vertex (f, vertex_id, P));
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
H5FedEndStoreVertices (
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_end_store_vertices (f));
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
H5FedBeginStoreElements (
|
||||
h5_file_t* const f,
|
||||
const h5_size_t num
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t,
|
||||
"f=0x%p, num=%llu",
|
||||
f, (long long unsigned)num);
|
||||
H5_API_RETURN (h5t_begin_store_elems (f, num));
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Stores the 4-tuple, that contains the specific indices describing
|
||||
a tetrahedron with id \c tet_id at level \c level of the tetrahedral
|
||||
mesh.
|
||||
|
||||
Errors:
|
||||
* current level not yet defined
|
||||
* to many tets stored on level
|
||||
|
||||
\return local tetrahedron id
|
||||
\return \c errno on error
|
||||
*/
|
||||
static inline h5_loc_idx_t
|
||||
H5FedStoreElement (
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_loc_idx_t local_vids[] /*!< tuple with vertex id's */
|
||||
) {
|
||||
H5_API_ENTER2 (h5_loc_idx_t, "f=0x%p, local_vids=0x%p", f, local_vids);
|
||||
if (h5t_get_level (f) != 0) {
|
||||
H5_API_LEAVE (
|
||||
h5_error (
|
||||
H5_ERR_INVAL,
|
||||
"Elements can be added to level 0 only!"));
|
||||
}
|
||||
H5_API_RETURN (h5t_store_elem (f, -1, local_vids));
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
H5FedEndStoreElements (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_end_store_elems (f));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedBeginRefineElements (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_begin_refine_elems (f));
|
||||
}
|
||||
|
||||
h5_loc_idx_t
|
||||
static inline h5_loc_idx_t
|
||||
H5FedRefineElement (
|
||||
h5_file_t * const f,
|
||||
const h5_loc_idx_t elem_idx
|
||||
);
|
||||
h5_file_t* const f, /*!< file handle */
|
||||
const h5_loc_id_t local_eid /*!< local element id */
|
||||
) {
|
||||
H5_API_ENTER2 (h5_loc_idx_t,
|
||||
"f=0x%p, local_eid=%lld",
|
||||
f, (long long)local_eid);
|
||||
H5_API_RETURN (h5t_mark_entity (f, local_eid));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
static inline h5_err_t
|
||||
H5FedEndRefineElements (
|
||||
h5_file_t * const f
|
||||
);
|
||||
h5_file_t* const f
|
||||
) {
|
||||
H5_API_ENTER1 (h5_err_t, "f=0x%p", f);
|
||||
H5_API_RETURN (h5t_end_refine_elems (f));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+115
-20
@@ -5,49 +5,144 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
/*!
|
||||
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
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5FedAddMTagset (
|
||||
h5_file_t* const f,
|
||||
char* name,
|
||||
h5_id_t type
|
||||
);
|
||||
h5_err_t
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", type=%lld",
|
||||
f, name, (long long)type);
|
||||
H5_API_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
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5FedRemoveMTagset (
|
||||
h5_file_t* const f,
|
||||
char name[]
|
||||
);
|
||||
h5_ssize_t
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, name=\"%s\"", f, name);
|
||||
H5_API_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
|
||||
*/
|
||||
static inline h5_ssize_t
|
||||
H5FedGetMTagsets (
|
||||
h5_file_t* const f,
|
||||
char** names[]
|
||||
);
|
||||
h5_id_t
|
||||
) {
|
||||
H5_API_ENTER2 (h5_ssize_t, "f=0x%p, names=0x%p", f, names);
|
||||
H5_API_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
|
||||
*/
|
||||
static inline h5_id_t
|
||||
H5FedGetTypeOfMTagset (
|
||||
h5_file_t* const f,
|
||||
char name[]
|
||||
);
|
||||
h5_err_t
|
||||
) {
|
||||
H5_API_ENTER2 (h5_err_t, "f=0x%p, name=\"%s\"", f, name);
|
||||
H5_API_RETURN (h5t_get_mtagset_type_by_name (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
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5FedSetMTag (
|
||||
h5_file_t* const f,
|
||||
char name[],
|
||||
h5_loc_id_t entity_id,
|
||||
const size_t dims,
|
||||
void* val
|
||||
);
|
||||
h5_err_t
|
||||
h5_loc_id_t id,
|
||||
const size_t dim,
|
||||
void* buffer
|
||||
) {
|
||||
H5_API_ENTER5 (h5_err_t,
|
||||
"f=0x%p, name=\"%s\", id=%lld, dim=%lld, val=0x%p",
|
||||
f, name, (long long)id, (long long)dim, buffer);
|
||||
H5_API_RETURN (h5t_set_mtag_by_name (f, name, id, dim, buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
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
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5FedGetMTag (
|
||||
h5_file_t* const f,
|
||||
const char name[],
|
||||
const h5_loc_id_t id,
|
||||
size_t* dims,
|
||||
void* val
|
||||
);
|
||||
h5_err_t
|
||||
const h5_loc_id_t id,
|
||||
size_t* dim,
|
||||
void* buffer
|
||||
) {
|
||||
H5_API_ENTER5 (h5_err_t,
|
||||
"f=0x%p, name=\"%s\", id=%lld, dim=0x%p, val=0x%p",
|
||||
f, name, (long long)id, dim, buffer);
|
||||
H5_API_RETURN (h5t_get_mtag_by_name (f, name, id, dim, buffer));
|
||||
}
|
||||
|
||||
/*!
|
||||
Remove tag for entity in current mesh.
|
||||
|
||||
\param[in] f file handle
|
||||
\param[in] name names of tagset
|
||||
\param[in] id id of entity
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5FedRemoveMTag (
|
||||
h5_file_t* const f,
|
||||
const char name[],
|
||||
const h5_loc_id_t id
|
||||
);
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", id=%lld",
|
||||
f, name, (long long)id);
|
||||
H5_API_RETURN (h5t_remove_mtag_by_name (f, name, id));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -180,12 +180,11 @@ done: \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define TRY3( expr, ret_val ) \
|
||||
#define TRY3( type, expr ) \
|
||||
if ((int64_t)(ptrdiff_t)(expr) <= (int64_t)H5_ERR) { \
|
||||
ret_value = ret_val; \
|
||||
ret_value = (type) H5_ERR; \
|
||||
goto done; \
|
||||
}
|
||||
#define ON_ERROR
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user