[vtkusers] lines and streamlines
Berk Geveci
berk.geveci at kitware.com
Tue Mar 11 14:28:04 EST 2003
> It works fine when the number of initial points is small (like 5). When
> I set the number of initial points to a higher value, like 50, the
> application consumes a lot of memory (1,1 GB) and crashs when the
> operating system swap space finish.
> My question is: why this process takes this amount of memory? The
> problem is on the computation of the trajectories (using Runge-Kutta
> order 2) or with its visualization ?
vtkStreamLine (and it's superclass vtkStreamer) has issues. It keeps
an internal data structure where it stores the intermediate data during
integration and uses it to create lines. Depending on your stepsize
(note that the integration step length is in cell length units), this
structure can become very large. Furthermore, if the step length
you specified for the line is small (this is the distance between
points in the final lines, this might be different than integration
step length), you might even end up with more points. To make things
even more confusing, the unit for the step length is time. There are
also other problems. If you do a search on the mailing list archives,
you can find a lot of messages about this. I recommend using
vtkStreamTracer and adjusting the step length carefully to avoid
lines with a lot of points. vtkStreamTracer resolves a lot of
the issues people ran into with vtkStreamer. Let me know how it goes.
>
> Another question: I can compute on my C++ code the trajectories points.
> What vtk classes I can use to visualize then (i.e, what classes should I
> use to view lines in 3D)?
You can write a polygonal data file where each streamline is a polyline.
See the VTK File Formats documentation on vtk homepage. Here is part
of hello.vtk from VTKData (where each polyline has two points)
# vtk DataFile Version 1.0
Stroked lines spell hello...
ASCII
DATASET POLYDATA
POINTS 22 float
0.0 0.0 0.0
0.0 2.0 0.0
0.0 1.0 0.0
1.0 1.0 0.0
...
LINES 15 45
2 0 1
2 4 5
2 2 3
2 6 8
2 6 7
...
More information about the vtkusers
mailing list