From 6e03a3ca1719576c5630f5041e8e9e405ca6c9c1 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 15 Feb 2013 14:29:57 +0000 Subject: [PATCH] bugfix in vtk2h5grid --- tools/vtk2h5grid/vtk2h5grid.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/vtk2h5grid/vtk2h5grid.cc b/tools/vtk2h5grid/vtk2h5grid.cc index a86121d..87275e5 100644 --- a/tools/vtk2h5grid/vtk2h5grid.cc +++ b/tools/vtk2h5grid/vtk2h5grid.cc @@ -88,10 +88,11 @@ convert_vtk2h5grid ( ) { IdMap idmap; vtkIdType num_vtk_cells = vtk_grid->GetNumberOfCells (); + vtkIdType num_vtk_pts = vtk_grid->GetNumberOfPoints (); h5_loc_idx_t (*cells)[4] = new h5_loc_idx_t[num_vtk_cells][4]; int h5_cell_idx = 0; int h5_vertex_idx = 0; - H5FedBeginStoreVertices (h5_grid, num_vtk_cells); + H5FedBeginStoreVertices (h5_grid, num_vtk_pts); for (vtkIdType vtk_cell_id = 0; vtk_cell_id < num_vtk_cells; vtk_cell_id++) { if (vtk_grid->GetCellType (vtk_cell_id) != cell_type) continue; @@ -120,8 +121,8 @@ convert_vtk2h5grid ( int num_h5_cells = h5_cell_idx; cout << " number of points in mesh: " << num_h5_vertices << endl; cout << " number of cells in mesh: " << num_h5_cells << endl; - // add tetrahedra to H5hut file - H5FedBeginStoreElements (h5_grid, num_vtk_cells); + // add cells to H5hut file + H5FedBeginStoreElements (h5_grid, num_h5_cells); for (int i = 0; i < num_h5_cells; i++) { H5FedStoreElement (h5_grid, cells[i]); }