[Paraview] Plot over time splitting on IDs

Eric E. Monson emonson at cs.duke.edu
Tue May 27 16:03:48 EDT 2008


Hey again,

I just figured out an easy way to see the effect (and I forgot to  
mention that this build has MPI turned on, but I'm testing with the  
builtin server):

Create a Time Source with some amplitude in X and Y, but don't check  
Analytic or Growing. Follow this with a Python Programmable Filter  
containing the code below (which should reverse the eight Global IDs  
after time 0.5):

Then, create a Global ID type point selection, and use that for a Plot  
Selection Over Time. When I do this it splits the data into two  
Blocks, one which shows the data for time 0-0.444, and the other from  
0.666-1.0 (0.555 is missing for some reason...).

Thanks,
-Eric

# =========================
from vtk import vtkIdTypeArray

pdi = self.GetInput()

pdo = self.GetOutput()
pdo.ShallowCopy(pdi)

pdi.GetPointData().SetActiveScalars('Point Label')
currID = pdi.GetPointData().GetScalars()
idRange = currID.GetRange()

sc = vtkIdTypeArray()
sc.SetName('GlobalNodeID')
sc.SetNumberOfValues(currID.GetNumberOfTuples())
sc.SetNumberOfComponents(1)

time = pdi.GetInformation().Get(pdi.DATA_TIME_STEPS(),0)
for ii in range(currID.GetNumberOfTuples()):
	if time < 0.5:
		sc.SetValue(ii,int(currID.GetTuple1(ii)))
	else:
		sc.SetValue(ii,int(idRange[1]-currID.GetTuple1(ii)))

pdo.GetPointData().SetGlobalIds(sc)
pdo.GetPointData().SetActiveGlobalIds('GlobalNodeID')
# =================



On May 27, 2008, at 2:59 PM, Eric E. Monson wrote:

> Hey All,
>
> I have a collection of vertices that represent biological cells in a  
> simulation, read into ParaView (cvs, OS X) as an unstructured grid.  
> Because the number of cells in the sim changes over time, I have to  
> use a global ID to keep track of cell identities for plotting, etc.  
> Since the Xdmf and XML VTK formats do not assign real Global IDs, I  
> set this using the Python Programmable Filter  
> (GetPointData().SetGlobalIds()).
>
> If I want to plot some scalar over time I select a point, then shift  
> the Selection Type to Global IDs in the Selection Inspector, then  
> Create Selection. I do the Copy Active Selection in Plot (Extract)  
> Selection Over Time and the Copied Selection pane displays the  
> proper Global ID.
>
> The problem is that the Plot Selection over time splits the time  
> series for that Global ID every time the scalar ID (or whatever you  
> call the regular ID or Index) for that vertex changes value. This  
> results in a bunch of blocks listed under Root in the Select Block  
> pane of the Extract Selection Over Time "Display" tab, all of them  
> labeled with the same Global ID (screen cap attached). Checking the  
> box next to any one of them displays the short time series in the  
> plot, during which the scalar "ID" was constant.
>
> So, for some reason the filter seems to be splitting the data into  
> "Blocks" based on scalar ID even when the selection is made based on  
> Global ID, and the data for that Global ID exists for the complete  
> time series.
>
> This seems like a bug to me, but please let me know if I'm just  
> misinterpreting something.
>
> Thanks,
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
>
> <DataSplit.jpg>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview



More information about the ParaView mailing list