I have an application where I am periodically generating one or more vtkUnstructuredGrids, adding scalar data, putting them through a pipeline for slicing and dicing, and outputting them to an xml file. The grid geometries and topologies could change every time this happens, so I have to start from scratch and rebuild the grids each time. If I call the Delete() method and get new instances every time, the code works OK. However, if I attempt to just call the Initialize() method, which is supposed to reset the grid and free associated memory, I get a segfault when I call the InsertNextCell() method. Is there some call I must make after Initialize() to prepare the grid for rebuilding?
Note that the grid is not part of the pipeline at the time all this happens. Also, I've printed an empty grid before and after Initialize(), and the only difference I see is the new grid has NumberOfPieces=1 and Piece = 0, while the Initialized grid has NumberOfPieces=0 and Piece=-1. I am using VTK 4.2.
RAYMOND C. MAPLE, Lt Col USAF
Assistant Professor of Aerospace Engineering
Air Force Institute of Technology
DSN 785-3636 ext 4577
Comm: (937) 255-3636 ext 4577