refactoring
This commit is contained in:
@@ -353,7 +353,10 @@ src/H5Fed.c -text
|
||||
src/H5Fed.h -text
|
||||
src/H5Fed_adjacency.c -text
|
||||
src/H5Fed_dof.c -text
|
||||
src/H5Fed_inquiry.c -text
|
||||
src/H5Fed_retrieve.c -text
|
||||
src/H5Fed_statistics.c -text
|
||||
src/H5Fed_store.c -text
|
||||
src/H5Fed_storeretrieve.c -text
|
||||
src/H5Part.c -text
|
||||
src/H5Part.h -text
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
/*
|
||||
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 <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Check whether a tetrahedral mesh hierarchy exists on level \c level
|
||||
|
||||
\return \c 1 tetrahedral mesh hierarchy exists on given level.
|
||||
\return \c 0 tetrahedral mesh exists, but not on given level.
|
||||
\return \c -1 tetrahedral mesh doesn't exist
|
||||
*/
|
||||
h5_int_t H5FedHasTetrahedralMesh (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to check */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Check whether a triangle mesh hierarchy exists on level \c level
|
||||
|
||||
\return \c 1 boundary mesh hierarchy exists on given level.
|
||||
\return \c 0 boundary mesh hierarchy exists, but not on given level.
|
||||
\return \c -1 boundary mesh doesn't exist.
|
||||
*/
|
||||
h5_int_t H5FedHasTriangleMesh(
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to check */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return -1;
|
||||
}
|
||||
|
||||
h5_size_t
|
||||
H5FedGetNumMeshes (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_meshes ( f );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Get the number of hierarchical mesh levels available in current step.
|
||||
|
||||
\return Number of hierarchical mesh levels
|
||||
\return \c -1 on error
|
||||
*/
|
||||
h5_size_t
|
||||
H5FedGetNumRefinementLevels (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_levels ( f );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Get the total number of vertices used for defining a submesh
|
||||
at level \c level in current step, summed up over all compute nodes.
|
||||
|
||||
\return number of vertices
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumVerticesTotal(
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Returns the number of vertices used for defining a submesh
|
||||
at level \c level for compute node \c cnode.
|
||||
|
||||
\return number of vertices
|
||||
q \return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumVerticesCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Get the number of vertices used for defining a submesh
|
||||
at level \c level for this compute node in current step.
|
||||
|
||||
\return number of vertices
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t
|
||||
H5FedGetNumVertices (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_vertices ( f );
|
||||
}
|
||||
|
||||
/****** EDGE statistics routines ********************************************/
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Returns the number of edges present in the mesh at level \c level,
|
||||
in current step, summed up over all compute nodes
|
||||
|
||||
\return number of edges
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumEdgesTotal (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Returns the number of edges present in the mesh at level \c level
|
||||
on compute node \c cnode
|
||||
|
||||
\return number of edges
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumEdgesCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/****** TRIANGLE statistics routines *****************************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Get the number of triangles present in the mesh at level \c level in
|
||||
current time step summed up over all compute notes.
|
||||
|
||||
\return Number of triangles
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumTrianglesTotal (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Get the number of triangles present in the mesh at level \c level in
|
||||
current time step on compute node \c cnode.
|
||||
|
||||
\return Number of triangles
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumTrianglesCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/****** TETRAHEDRON statistics routines **************************************/
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Returns the number of tetrahedral elements present in the mesh at
|
||||
level \c level in current step summed up over all compute nodes.
|
||||
|
||||
\return number of tetrahedra
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumTetrahedraTotal(
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Returns the number of tetrahedral elements present in the mesh at
|
||||
level \c level in current step on compute nodes \c computenode.
|
||||
|
||||
\return number of tetrahedra
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumTetrahedraCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Returns the number of tetrahedral elements present in the mesh at
|
||||
level \c level in current step on this compute node.
|
||||
|
||||
\return number of tetrahedra
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t
|
||||
H5FedGetNumTetrahedra (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_num_tets ( f );
|
||||
}
|
||||
|
||||
|
||||
/****** BOUNDARY statistics routines ****************************************/
|
||||
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Get the number of boundary triangles present in the mesh at
|
||||
level \c level in current step summed up over all compute nodes.
|
||||
|
||||
\return number of tetrahedras
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumBoundaryTrianglesTotal (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level /*!< mesh level to query */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_mesh_inquiry
|
||||
|
||||
Get the number of boundary triangles present in the mesh at
|
||||
level \c level in current step on compute node \c cnode.
|
||||
|
||||
\return number of tetrahedras
|
||||
\return \c -1 on error.
|
||||
*/
|
||||
h5_size_t H5FedGetNumBoundaryTrianglesCnode (
|
||||
h5_file * fh, /*!< file handle */
|
||||
const h5_id_t level, /*!< mesh level to query */
|
||||
const h5_id_t cnode /*!< compute node */
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/****** 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 <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Get coordinates of next vertex.
|
||||
|
||||
\return local id
|
||||
\return error code (H5_ERR_NOENT means no more vertices on this level)
|
||||
|
||||
*/
|
||||
h5_id_t
|
||||
H5FedGetVertex (
|
||||
h5_file * f, /*!< file handle */
|
||||
h5_id_t * const id, /*!< OUT: global id */
|
||||
h5_float64_t P[3] /*!< OUT: coordinates */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_vertex ( f, id, P );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Get the definition of a specific tetrahedron \c tetra_id, i.e.
|
||||
a 4-tuple containing the specific indices of the 3-dimensional vertex
|
||||
coordinates.
|
||||
|
||||
\return pointer to 4-tuple of vertex id's defining the tetrahedron.
|
||||
\return NULL-pointer on error.
|
||||
*/
|
||||
h5_id_t
|
||||
H5FedGetTetrahedron (
|
||||
h5_file * f, /*!< file handle */
|
||||
h5_id_t * const id, /*!< OUT: global tetrahedron id */
|
||||
h5_id_t * parent_id, /*!< OUT: parent id if level
|
||||
\c >0 else \c -1 */
|
||||
h5_id_t vertex_ids[4] /*!< OUT: vertex id's */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_get_tet ( f, id, parent_id, vertex_ids );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
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 <stdarg.h>
|
||||
#include <hdf5.h>
|
||||
#include "h5/h5.h"
|
||||
#include "h5/h5_private.h"
|
||||
#include "H5Fed.h"
|
||||
|
||||
/*!
|
||||
Add a 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
|
||||
|
||||
\note
|
||||
write new level:
|
||||
H5FedAddLevel( f );
|
||||
H5FedSetNumVertices( f, nv );
|
||||
H5FedSetNumTetrahedra( f, nt );
|
||||
*/
|
||||
|
||||
h5_id_t
|
||||
H5FedAddRefinementLevel (
|
||||
h5_file * f /*!< file handle */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_add_level ( f );
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup h5fed_c_api
|
||||
|
||||
Set number of additional vertices in current step and level
|
||||
|
||||
ERRORS:
|
||||
|
||||
H5_ERR_INVAL: It is not possible to add vertices to an existing mesh due
|
||||
to limitation of the library
|
||||
|
||||
H5_ERR_NOMEM: Couldn't allocate enough memory.
|
||||
|
||||
\return number of vertices
|
||||
\return errno on error
|
||||
*/
|
||||
|
||||
h5_size_t
|
||||
H5FedSetAdditionalNumVerticesToStore (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_size_t num /*!< number of additional vertices */
|
||||
) {
|
||||
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_add_num_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_id_t
|
||||
H5FedStoreVertex (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_id_t id, /*!< global vertex id or -1 */
|
||||
const h5_float64_t P[3] /*!< coordinates */
|
||||
) {
|
||||
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_store_vertex ( f, id, P );
|
||||
}
|
||||
|
||||
/*** T E T R A H E D R A ****************************************************/
|
||||
|
||||
h5_size_t
|
||||
H5FedSetAdditionalNumTetrahedraToStore (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_size_t num /*!< number of additional
|
||||
tetrahedra at level \c level */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
|
||||
return H5t_add_num_tets ( 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_id_t
|
||||
H5FedStoreTetrahedron (
|
||||
h5_file * f, /*!< file handle */
|
||||
const h5_id_t id, /*!< global tetrahedron id */
|
||||
const h5_id_t parent_id, /*!< global parent id
|
||||
if level \c >0 else \c -1 */
|
||||
const h5_id_t vertex_ids[4] /*!< tuple with vertex id's */
|
||||
) {
|
||||
SET_FNAME ( __func__ );
|
||||
return H5t_store_tet ( f, id, parent_id, vertex_ids );
|
||||
}
|
||||
Reference in New Issue
Block a user