Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 59d9dff893 | |||
| d8a8b4030c | |||
| aac94b38e8 | |||
| 3e918f8001 | |||
| 0be5518252 | |||
| 9fa5becf1e | |||
| 8d04bca079 |
@@ -1,3 +1,11 @@
|
|||||||
|
*.o
|
||||||
|
*.lo
|
||||||
|
*.la
|
||||||
|
*~
|
||||||
|
*.h5
|
||||||
|
*.vtk
|
||||||
|
.deps
|
||||||
|
.libs
|
||||||
/H5hut
|
/H5hut
|
||||||
/INSTALL
|
/INSTALL
|
||||||
/Makefile
|
/Makefile
|
||||||
@@ -5,6 +13,7 @@
|
|||||||
/aclocal.m4
|
/aclocal.m4
|
||||||
/autom4te.cache
|
/autom4te.cache
|
||||||
/build
|
/build
|
||||||
|
/compile
|
||||||
/config.guess
|
/config.guess
|
||||||
/config.h
|
/config.h
|
||||||
/config.h.in
|
/config.h.in
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT([H5hut], [1.99.12], [h5part@lists.psi.ch], H5hut)
|
AC_INIT([H5hut], [1.99.13], [h5part@lists.psi.ch], H5hut)
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
AC_CONFIG_HEADERS(config.h)
|
AC_CONFIG_HEADERS(config.h)
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ LDFLAGS += -L${abs_top_builddir}/src/lib
|
|||||||
|
|
||||||
LDADD =
|
LDADD =
|
||||||
|
|
||||||
LDADD += -lH5hut -lvtkIO -lvtkFiltering -lvtkCommon -lvtksys
|
LDADD += -lH5hut -lvtkIO -lvtkFiltering -lvtkCommon -lvtksys -lpthread -ldl
|
||||||
|
|
||||||
|
|
||||||
bin_PROGRAMS =
|
bin_PROGRAMS =
|
||||||
|
|||||||
@@ -14,9 +14,21 @@
|
|||||||
|
|
||||||
#include "H5hut.h"
|
#include "H5hut.h"
|
||||||
|
|
||||||
|
#if !defined (PARALLEL_IO)
|
||||||
|
#define MPI_Init(argc, argv)
|
||||||
|
#define MPI_Comm_size(comm, nprocs) { *nprocs = 1; }
|
||||||
|
#define MPI_Comm_rank(comm, myproc) { *myproc = 0; }
|
||||||
|
#define MPI_Finalize()
|
||||||
|
#define MPI_COMM_WORLD (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
const char* version = "0.1.0";
|
const char* version = "0.1.0";
|
||||||
int convert_boundary = 1;
|
int convert_boundary = 1;
|
||||||
int convert_volume = 0;
|
int convert_volume = 0;
|
||||||
|
double x_shift = 0.0;
|
||||||
|
double y_shift = 0.0;
|
||||||
|
double z_shift = 0.0;
|
||||||
|
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{"version", no_argument, 0, 'v'},
|
{"version", no_argument, 0, 'v'},
|
||||||
{"help", no_argument, 0, 'h'},
|
{"help", no_argument, 0, 'h'},
|
||||||
@@ -24,6 +36,7 @@ const struct option longopts[] = {
|
|||||||
{"volume", no_argument, &convert_volume, 1},
|
{"volume", no_argument, &convert_volume, 1},
|
||||||
{"no-boundary", no_argument, &convert_boundary, 0},
|
{"no-boundary", no_argument, &convert_boundary, 0},
|
||||||
{"no-volume", no_argument, &convert_volume, 0},
|
{"no-volume", no_argument, &convert_volume, 0},
|
||||||
|
{"shift", required_argument, 0, 's'},
|
||||||
{0,0,0,0},
|
{0,0,0,0},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -40,6 +53,7 @@ usage (
|
|||||||
std::cout << " default is yes" << std::endl;
|
std::cout << " default is yes" << std::endl;
|
||||||
std::cout << " --(no-)volume do (not) convert volume mesh." << std::endl;
|
std::cout << " --(no-)volume do (not) convert volume mesh." << std::endl;
|
||||||
std::cout << " default is no" << std::endl;
|
std::cout << " default is no" << std::endl;
|
||||||
|
std::cout << " --shift x,y,z shift all points by x,y,z" << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
@@ -75,6 +89,10 @@ init (
|
|||||||
case 'v':
|
case 'v':
|
||||||
print_version (argv[0]);
|
print_version (argv[0]);
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
sscanf (optarg, "%lf,%lf,%lf", &x_shift, &y_shift, &z_shift);
|
||||||
|
cout << "shift = (" << x_shift << ", " << y_shift << ", " << z_shift << ")" << endl;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return argc - optind;
|
return argc - optind;
|
||||||
@@ -106,6 +124,9 @@ convert_vtk2h5grid (
|
|||||||
// add point to H5hut mesh
|
// add point to H5hut mesh
|
||||||
double pt[3];
|
double pt[3];
|
||||||
vtk_grid->GetPoint (pts[i], pt);
|
vtk_grid->GetPoint (pts[i], pt);
|
||||||
|
pt[0] += x_shift;
|
||||||
|
pt[1] += y_shift;
|
||||||
|
pt[2] += z_shift;
|
||||||
H5FedStoreVertex (h5_grid, -1, pt);
|
H5FedStoreVertex (h5_grid, -1, pt);
|
||||||
// map pt index in vtk file to pt index in H5hut file
|
// map pt index in vtk file to pt index in H5hut file
|
||||||
idmap.insert (IdMap::value_type (pts[i], h5_vertex_idx));
|
idmap.insert (IdMap::value_type (pts[i], h5_vertex_idx));
|
||||||
@@ -145,6 +166,10 @@ main (
|
|||||||
int argc,
|
int argc,
|
||||||
char* argv[]
|
char* argv[]
|
||||||
) {
|
) {
|
||||||
|
MPI_Init (&argc, &argv);
|
||||||
|
MPI_Comm comm = MPI_COMM_WORLD;
|
||||||
|
int comm_size;
|
||||||
|
MPI_Comm_size (comm,&comm_size);
|
||||||
|
|
||||||
argc = init (argc, argv);
|
argc = init (argc, argv);
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
@@ -200,5 +225,6 @@ main (
|
|||||||
}
|
}
|
||||||
H5CloseFile (f);
|
H5CloseFile (f);
|
||||||
}
|
}
|
||||||
|
MPI_Finalize ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user