[cig-commits] r13350 - short/3D/PyLith/trunk/pylith/utils
brad at geodynamics.org
brad at geodynamics.org
Wed Nov 19 15:02:37 PST 2008
Author: brad
Date: 2008-11-19 15:02:37 -0800 (Wed, 19 Nov 2008)
New Revision: 13350
Modified:
short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py
Log:
Added line2 cell id to VTK reader.
Modified: short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py
===================================================================
--- short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py 2008-11-19 21:35:19 UTC (rev 13349)
+++ short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py 2008-11-19 23:02:37 UTC (rev 13350)
@@ -69,13 +69,15 @@
cells = data.get_cells().to_array()
cellTypes = data.cell_types_array.to_array()
ncells = data.number_of_cells
- id = cellTypes[0]
- if numpy.sum(cellTypes-id) != 0:
+ cellId = cellTypes[0]
+ if numpy.sum(cellTypes-cellId) != 0:
raise ValueError("Expecting cells to all be the same type.")
- if id == 5:
+ if cellId == 5:
ncorners = 3
+ elif cellId == 3:
+ ncorners = 2
else:
- raise ValueError("Unknown VTK cell type '%d'." % id)
+ raise ValueError("Unknown VTK cell type '%d'." % cellId)
cells = cells.reshape( (ncells, 1+ncorners) )[:,1:1+ncorners]
return cells
More information about the CIG-COMMITS
mailing list