[vtkusers] Streamlines in VTK: issues

Berk Geveci berk.geveci at kitware.com
Wed Dec 19 17:28:34 EST 2001


Thanks to Christian Poecher who provided a sample data file and script, I could
verify that in certain cases vtkStreamLine can produce tremendously large
outputs and seemingly run forever. Here is the problem:

 > The step length used in the integrations has units of current cell length
(vtkStreamer::SetIntegrationStepLength()),

 > The step length used in generating the final polyline (i.e. the polyline
generated by vtkStreamLine, this is generated from the results of the streamline
integration and can have more or less points than produced during that
stage, vtkStreamLine::SetStepLength()) has units of time,

 > The maximum length of the streamlines is determined by MaximumPropagationTime
which has units of time,

 > Now consider a case where the integration step length is 1.0, step length is
0.1, maximum propagation time is 100. We start the integration at a cell of
length 1.0. This cell is near a stagnation point and the velocity at the
starting point is 1.0E-12. The first DeltaT used in the
Runge-Kutta integation will be
IntegationStepLength*CellLength/Velocity = 1.0 * 1.0 / 1.0E-12 = 1.0E12
The second point will be calculated using this DeltaT and the integation will
terminate since 1.0E12 > MaximumPropagationTime.
Now, vtkStreamLine has two points to generate the polyline from. However,
we asked that it uses a step of 0.1 (in time units) in generating this line.
Therefore, it will create 1.0E12/0.1 = 1.0E13 points between the first
two. Voila, we have a calculation which will exhaust the memory of
almost any computer and which will take a very long time.

The solution: re-work vtkStreamer, vtkStreamLine (and similar classes). I
will be working on a new (distributed parallel) implementation of a VTK stream-
line filter. Anybody who did not stop reading or fall asleep so far should
feel free to send recommendations/requests/ideas. The standing issues:

* How should the user specify the integration step length ? In units of time,
length or accuracy (I will implement an adaptive step length integrator) ?

* How should the user specify the termination condition ? Time, length,
intersection with a polygon or plane, magnitude of velocity ... ?

* How should the user specify the number of points to be used in the final
polygon ? Maximum number of points, function
of gradient of speed, rate of change of direction, vorticity ?

-Berk




More information about the vtkusers mailing list