[vtkusers] Wrong way of handing a time-dependent dataset? Memory leaks...
Alessandro A. Bellina
bellina at illinois.edu
Sat Feb 14 10:32:31 EST 2009
Hello All,
First let me start by giving you my system info:
--
MacOS Intel Based
VTK 5.0.3
I don't have 5.2 because I get endianness errors while trying to compile.
--
I need the ability to probe spatial points a time-dependent dataset
and output a scalar value as an array to be later analyzed in Matlab.
My data is originally stored as an XMLUnstructuredGrid.
I start by loading the data using vtkXMLUnstructredGridReader I do
this in a function that looks like this:
//int i: the current time step to load. Files are named: "sph_1.vtu,
sph_2.vtu, ..."
void LoadFile (vtkXMLUnstructuredGridReader*, int i){
vtkXMLUnstructuredGridReader *dataSet= vtkXMLUnstructuredGridReader::New();
std::ostringstream ostr;
ostr<<i;
std::string s = ostr.str();
std::string ansysFilename = "sph_"+s+".vtu";
//vtkUnstructuredGridReader for data (src)
dataSet->SetFileName (ansysFilename.c_str());
dataSet->Update();
return dataSet;
}
I call this function in a loop that goes from time step = 0 to
time_step = N, where N is a number on the order of 1,000. I also pass
it through a probeFilter with a vtkFloatArray that has the coordinates
of the spatial points I am interested in.
About half way through, I get a vtk malloc error. Could it be because
I am reading each one of these files and not clearing them? I am just
loading the next file that comes along (not knowing how VTK is
handling this under the hood).
Any help would be greatly appreciated,
Alessandro
--
Alessandro A. Bellina
Graduate Student
Bioacoustics Research Laboratory
Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
More information about the vtkusers
mailing list