[vtkusers] Unsteady Vector Field Integration using vtkTemporalStreamTracer
Tim Biedert
biedert at cs.uni-kl.de
Wed Apr 2 14:59:59 EDT 2014
Hello,
I’m interested in pathline integration in an unsteady vector field. My idea was to construct a vtkMultiBlockDataSet (each block represents a time step) and use vtkTemporalStreamTracer for the integration.
Problem: How to set the meta information for the time values correctly?
Here's some code:
// Read velocity time steps (in this example reduced to 2 time steps)
vtkSmartPointer<vtkStructuredGridReader> velocityReader0 = vtkSmartPointer<vtkStructuredGridReader>::New();
velocityReader0->SetFileName(path0); // analogous for velocityReader1
// Construct multi block data set
vtkSmartPointer<vtkMultiBlockDataSet> velocityData = vtkSmartPointer<vtkMultiBlockDataSet>::New();
velocityData->SetNumberOfBlocks(2);
velocityData->SetBlock(0, velocityReader0->GetOutput());
velocityData->SetBlock(1, velocityReader1->GetOutput());
// Construct temporal stream tracer
vtkSmartPointer<vtkTemporalStreamTracer> tracer = vtkSmartPointer<vtkTemporalStreamTracer>::New();
tracer->SetInputData(velocityData);
tracer->SetSourceConnection(points->GetOutputPort()); // some points where the integration should start
double timeSteps[] = {0.0, 1.0};
tracer->GetInputInformation()->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), timeSteps, 2);
Using the above code I get a runtime error stating “vtkTemporalStreamTracer: No time step info”.
The vtkTemporalStreamTracer.cxx source code suggests I have to set the vtkDataObject::DATA_TIME_STEP information.
By trial and error, I got the error gone by for example:
tracer->GetInputInformation()->Set(vtkDataObject::DATA_TIME_STEP(), 0.0);
However, I don’t understand why the vtkTemporalStreamTracer wants to read a single time step value from the input data (which is a multi block data set). Besides that the tracer should already know all time values from the vtkStreamingDemandDrivenPipeline::TIME_STEPS() information key, it does not make sense for me why I should assign a single time step to the multi block container, instead of assigning each block data the respective time value.
Of course, the application still crashes with runtime error "vtkTemporalStreamTracer: InitializeInterpolator failed”.
Thank you very much!
Best,
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140402/06f0eb2e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4663 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140402/06f0eb2e/attachment.bin>
More information about the vtkusers
mailing list