[Paraview] Temporal shift with Python Programmable Filter

Eric Monson emonson at cs.duke.edu
Mon Feb 4 12:10:38 EST 2008


Hey All,

This may seem like an odd question, but I think the answer may help  
clarify a larger problem I'm having...

I'm trying to calculate the velocity vectors for diffusing particles,  
and the way I'm doing it right now is to feed two copies of my  
Unstructured Grid data into the Python Programmable Filter (PPF). The  
first copy has a time shift of 0, and the second one has Shift = 1.  
These are both Temporal Data Sets, and so I've been accessing the  
underlying Unstructured Grids by doing this:

in0 = self.GetInputDataObject(0,0).GetDataSet(0,0)
in1 = self.GetInputDataObject(0,1).GetDataSet(0,0)

I force the PPF output to vtkUnstructuredGrid, and I have been making  
the output equivalent to one of the input points like so:

out1 = self.GetOutput()
out1.DeepCopy(in1)

(In the complete calculation I later add a vtkFloatArray to "out1"  
containing the calculated velocity vectors.)

The odd thing I see is that if the output is a copy of the Shift = 0  
point, I can increment time forward and backwards (arrow click on Time  
control) and everything looks fine. If the output is a copy of the  
Shift = 1 point, then on every other click it increments, and on the  
other clicks it doesn't move or change its scalar values. (If Shift =  
-1, then it increments properly backwards, but not forwards.)

Is there some sort of update forcing I should be doing that I'm not?  
Is this an unreliable way of accessing the data from within the  
Temporal Data Sets?

(I seemingly randomly get cases where my calculated velocity vector  
goes to zero and won't snap out of it unless I rebuild the whole  
pipeline from scratch, so I'm hoping I'm just doing something wrong  
here...)

Thanks for the help,
-Eric

-----------------------------------------------------
Eric E. Monson
Duke Visualization Technology Group




More information about the ParaView mailing list