[vtkusers] Point data with vtkUnstructuredGridReader
Justin Pogacnik
j.pogacnik at auckland.ac.nz
Wed May 8 21:37:30 EDT 2013
Hi all,
I'm trying to use Python to read an unstructured grid file (vtk format) that I wrote for output from a research code. The vtk file loads fine in Paraview, so it should be in order.
The vtk file has 7 scalar arrays of point data and one vector array of point data. However, when I print the point data, only 2 arrays are found -- the first scalar array (elementID) and the last (only) vector array (permeability).
Here is the essential part of my python script:
from vtk import *
filename = 'VTKoutput/FEHM_mesh4_2.vtk'
vtkgrid = vtkUnstructuredGridReader()
name = vtkgrid.SetFileName(filename)
vtkgrid.Update()
print vtkgrid.GetOutput().GetPointData()
I'm happy to pass along the small test vtk file too if it'd be helpful. Also, I'm running vtk-5.10 on Mac OSX 10.7.5.
Thanks in advance,
Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130509/64c1d8f1/attachment.htm>
More information about the vtkusers
mailing list