tadd color to vtk files - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
HTML git clone git://src.adamsgaard.dk/sphere
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
DIR commit 6d7378e8949c392dece9dbb1aec3d30bf8ef6c96
DIR parent 5c4f97d059e56e77b8455060aafacd54f2674c03
HTML Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Thu, 19 Jun 2014 10:43:39 +0200
add color to vtk files
Diffstat:
M python/sphere.py | 9 +++++++++
1 file changed, 9 insertions(+), 0 deletions(-)
---
DIR diff --git a/python/sphere.py b/python/sphere.py
t@@ -1352,7 +1352,16 @@ class sim:
fh.write('\n')
fh.write(' </DataArray>\n')
+ # Color
+ fh.write(' <DataArray type="Int32" Name="Color" '
+ + 'format="ascii">\n')
+ fh.write(' ')
+ for i in range(self.np):
+ fh.write('{} '.format(self.color[i]))
+ fh.write('\n')
+ fh.write(' </DataArray>\n')
+ # Footer
fh.write(' </PointData>\n')
fh.write(' <Cells>\n')
fh.write(' <DataArray type="Int32" Name="connectivity" '