Commit e6375220 authored by gsell's avatar gsell

example/H5Fed

- fixes
- adapted to new API
parent ec9626a0
......@@ -3,15 +3,9 @@ FFLAGS += -cpp $(AM_CPPFLAGS)
AM_LDFLAGS += -L${abs_top_builddir}/src/h5core/.libs
LDADD =
if ENABLE_FORTRAN
LDADD += -lH5hutF
endif
LDADD += -lH5hut
if ENABLE_EXAMPLES
if ENABLE_EXPERIMENTAL
noinst_PROGRAMS = \
tetmesh_write \
tetmesh_write1 \
......@@ -44,7 +38,6 @@ EXTRA_DIST = \
trimesh_2gnuplot.c \
trimesh_write_dunetest.c
endif
endif
# map_tet2globalid.c \
# map_triangle2globalid.c \
# $(bin_SCRIPTS)
......
......@@ -546,8 +546,9 @@ main (
/* abort program on error, so we don't have to handle them */
H5SetErrorHandler (H5AbortErrorhandler);
H5SetVerbosityLevel (2);
//H5SetVerbosityLevel (H5_DEBUG_ALL);
H5SetVerbosityLevel (0);
/* open file and get number of meshes */
h5_file_t f = H5OpenFile (FNAME, H5_O_RDONLY, 0);
h5_size_t num_meshes = H5FedGetNumTetrahedralMeshes (f);
......
......@@ -336,20 +336,13 @@ main (
int argc,
char* argv[]
) {
MPI_Comm comm = MPI_COMM_WORLD;
int myproc;
int nprocs;
MPI_Init (&argc, &argv);
MPI_Comm_size (comm, &nprocs);
MPI_Comm_rank (comm, &myproc);
/* abort program on error, so we don't have to handle them */
H5SetErrorHandler (H5AbortErrorhandler);
H5SetVerbosityLevel (2);
H5SetVerbosityLevel (0);
/* open file and get number of meshes */
h5_file_t f = H5OpenFile (FNAME, H5_O_RDONLY, comm);
h5_file_t f = H5OpenFile (FNAME, H5_O_RDONLY, H5_PROP_DEFAULT);
h5_size_t num_meshes = H5FedGetNumTetrahedralMeshes (f);
printf (" Number of meshes: %lld\n", (long long)num_meshes);
......
......@@ -44,20 +44,13 @@ main (
int argc,
char* argv[]
) {
MPI_Comm comm = MPI_COMM_WORLD;
int myproc;
int nprocs;
MPI_Init (&argc, &argv);
MPI_Comm_size (comm, &nprocs);
MPI_Comm_rank (comm, &myproc);
/* abort program on errors in library */
H5SetErrorHandler (H5AbortErrorhandler);
H5SetVerbosityLevel (5);
/* open file and add mesh */
h5_file_t const f = H5OpenFile (FNAME, H5_O_WRONLY, comm);
h5_file_t const f = H5OpenFile (FNAME, H5_O_WRONLY, H5_PROP_DEFAULT);
h5t_mesh_t* mesh;
H5FedAddTetrahedralMesh (f, "0", &mesh);
......
......@@ -57,12 +57,6 @@ main (
char* argv[]
) {
#if defined (PARALLEL_IO)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Init (&argc, &argv);
#else
MPI_Comm comm = 0;
#endif
if (argc < 2 || argc > 3) {
fprintf (stderr, "Usage: %s FILE [LEVEL]\n", argv[0]);
exit (42);
......@@ -73,7 +67,7 @@ main (
H5SetVerbosityLevel (0);
/* open file and get number of meshes */
h5_file_t f = H5OpenFile (argv[1], H5_O_RDONLY, comm);
h5_file_t f = H5OpenFile (argv[1], H5_O_RDONLY, H5_PROP_DEFAULT);
h5t_mesh_t* m;
H5FedOpenTriangleMeshByIndex (f, 0, &m);
int num_levels = H5FedGetNumLevels (m);
......
......@@ -243,7 +243,7 @@ traverse_elems (
clock_t t_min = CLOCKS_PER_SEC;
clock_t t_max = 0;
clock_t t = 0;
printf ("\nAdjacencies to tetrahedra\n");
printf ("\nAdjacencies to triangles\n");
h5t_iterator_t* iter = H5FedBeginTraverseEntities (m, 0);
while ((local_id = H5FedTraverseEntities (iter)) >= 0) {
print_adjacencies_of_elem (m, local_id, &t);
......
......@@ -236,19 +236,12 @@ main (
char* argv[]
) {
#if defined (PARALLEL_IO)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Init (&argc, &argv);
#else
MPI_Comm comm = 0;
#endif
/* abort program on error, so we don't have to handle them */
H5SetErrorHandler (H5AbortErrorhandler);
H5SetVerbosityLevel (0);
H5SetVerbosityLevel (H5_DEBUG_ALL);
/* open file and get number of meshes */
h5_file_t f = H5OpenFile (FNAME, H5_O_RDONLY, comm);
h5_file_t f = H5OpenFile (FNAME, H5_O_RDONLY, H5_PROP_DEFAULT);
h5_size_t num_meshes = H5FedGetNumTriangleMeshes (f);
printf (" Number of meshes: %lld\n", (long long)num_meshes);
......
......@@ -29,7 +29,6 @@ main (
// initialize MPI & H5hut
MPI_Init (&argc, &argv);
MPI_Comm comm = MPI_COMM_WORLD;
int comm_size = 1;
MPI_Comm_size (comm, &comm_size);
int comm_rank = 0;
......@@ -58,6 +57,7 @@ main (
// cleanup
free (data);
H5CloseFile (file);
return MPI_Finalize ();
MPI_Finalize ();
return H5_SUCCESS;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment