View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014453VTK(No Category)public2013-12-10 07:432013-12-20 15:57
ReporterJorge 
Assigned ToBerk Geveci 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version6.0.0 
Target VersionFixed in Version6.1.0 
Summary0014453: error with TerminalSpeed parameter in vtkStreamTracer
DescriptionI have an StructuredPoints data-set with a vector field on points. In order to generate streamlines on it I use vtkStreamTracer. The range of the velocity goes from 0 to 150. I have found that if I set the TerminalSpeed to a number greater than 1 (for instance 1.5) then no streamline is generated even if the velocity at the starting point is above 90.

Tracing the code at vtkStreamTracer.cxx I reach the point where the problem seems to be:

// It is not enough to use the starting point for stagnation calculation
// Use delX/stepSize to calculate speed and check if it is below
// stagnation threshold
double disp[3];
for (i=0; i<3; i++)
  {
  disp[i] = point2[i] - point1[i];
  }
if ( (stepSize.Interval == 0) ||
     (vtkMath::Norm(disp) / fabs(stepSize.Interval) <= this->TerminalSpeed) )
  {
  retVal = STAGNATION;
  break;
  }

The problem I have seen is that stepSize.Interval is in LENGTH_UNIT and it is almost similar to vtkMath::Norm(disp).

I have changed the test to:

//////////////JOSP//////////////////
double timeTaken = stepTaken / speed;
//////////////JOSP//////////////////
if ( (stepSize.Interval == 0) ||
     (vtkMath::Norm(disp) / timeTaken <= this->TerminalSpeed) )
  {
  retVal = STAGNATION;
  break;
  }

accumTime += timeTaken;

The previous change "seems" to fix the problem. I'm not sure if this change could have other implication but in our application it works as expected. I would like to contribute with a fix if this is really a bug.
TagsNo tags attached.
ProjectKitware
Typeincorrect functionality
Attached Filespng file icon TerminalSpeedEqualTo0.1.png [^] (32,236 bytes) 2013-12-10 07:54


png file icon TerminalSpeedEqualTo10.png [^] (24,289 bytes) 2013-12-10 07:56


png file icon TerminalSpeedEqualTo10_Gerrit.png [^] (28,354 bytes) 2013-12-18 03:52


rar file icon dataset_velocity_2.rar [^] (4,830,996 bytes) 2013-12-18 04:35

 Relationships

  Notes
(0031918)
Jorge (reporter)
2013-12-10 07:58
edited on: 2013-12-10 07:58

I have uploaded two results obtained after applying the fix.

TerminalSpeed=0.1 ==> TerminalSpeedEqualTo0.1.png

TerminaSpeed=10 ==> TerminalSpeedEqualTo10.png

Without the fix the picture TerminalSpeedEqualTo10.png has no streamline.

(0031965)
Dave DeMarle (administrator)
2013-12-16 18:17

suggested patch is in for gerrit review

http://review.source.kitware.com/#/t/3734 [^]
(0031995)
Berk Geveci (administrator)
2013-12-17 20:45

I uploaded an alternative implementation that should be slightly better. http://review.source.kitware.com/#/c/13833/ [^]
Can you please give it a try? Or send a dataset to try with?
(0032016)
Jorge (reporter)
2013-12-18 04:20

I have checked the change and it works. It does not generate exactly the same results as expected because the speed to check STAGNATION is now computed in a different way as a mean velocity instead of uniform velocity as s/t. I think the results are correct. I have uploaded a picture of the new results obtained with the code from the gerrit review.
(0032017)
Jorge (reporter)
2013-12-18 04:36

The uploaded file dataset_velocity_2.rar could be used to try.
(0032044)
Berk Geveci (administrator)
2013-12-20 15:56

Fix merged to master.

 Issue History
Date Modified Username Field Change
2013-12-10 07:43 Jorge New Issue
2013-12-10 07:54 Jorge File Added: TerminalSpeedEqualTo0.1.png
2013-12-10 07:56 Jorge File Added: TerminalSpeedEqualTo10.png
2013-12-10 07:58 Jorge Note Added: 0031918
2013-12-10 07:58 Jorge Note Edited: 0031918
2013-12-16 18:17 Dave DeMarle Note Added: 0031965
2013-12-16 18:17 Dave DeMarle Status backlog => gerrit review
2013-12-16 18:17 Dave DeMarle Fixed in Version => 6.1.0
2013-12-17 20:45 Berk Geveci Note Added: 0031995
2013-12-18 03:52 Jorge File Added: TerminalSpeedEqualTo10_Gerrit.png
2013-12-18 04:20 Jorge Note Added: 0032016
2013-12-18 04:35 Jorge File Added: dataset_velocity_2.rar
2013-12-18 04:36 Jorge Note Added: 0032017
2013-12-20 15:56 Berk Geveci Note Added: 0032044
2013-12-20 15:57 Berk Geveci Status gerrit review => closed
2013-12-20 15:57 Berk Geveci Assigned To => Berk Geveci
2013-12-20 15:57 Berk Geveci Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team