From 2a8dc1bff13743228ac84c2ffb4b7de98c806637 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 22 May 2011 14:01:18 +0000 Subject: [PATCH] Fixed a bug introduced in the last revision. Datatype keywords (SCALARS, VECTORS, ...) were not written in plural form into VTK file, thus had not been recognized by ParaView. --- processing/post/3Dvisualize | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/processing/post/3Dvisualize b/processing/post/3Dvisualize index 994563a83..bc388f356 100755 --- a/processing/post/3Dvisualize +++ b/processing/post/3Dvisualize @@ -145,9 +145,10 @@ def vtk_writeASCII_mesh(mesh,data,res): ] for type in data: + plural = {True:'',False:'S'}[type.lower().endswith('s')] for item in data[type]: cmds += [\ - '%s %s float'%(type.upper(),item), + '%s %s float'%(type.upper()+plural,item), 'LOOKUP_TABLE default', [[['\t'.join(map(str,data[type][item][:,j,k]))] for j in range(res[1])] for k in range(res[2])], ] @@ -209,9 +210,10 @@ def gmsh_writeASCII_mesh(mesh,data,res): ] for type in data: + plural = {True:'',False:'S'}[type.lower().endswith('s')] for item in data[type]: cmds += [\ - '%s %s float'%(type.upper(),item), + '%s %s float'%(type.upper()+plural,item), 'LOOKUP_TABLE default', [[['\t'.join(map(str,data[type][item][:,j,k]))] for j in range(res[1])] for k in range(res[2])], ] @@ -243,9 +245,10 @@ def vtk_writeASCII_points(coordinates,data,res): ] for type in data: + plural = {True:'',False:'S'}[type.lower().endswith('s')] for item in data[type]: cmds += [\ - '%s %s float'%(type.upper(),item), + '%s %s float'%(type.upper()+plural,item), 'LOOKUP_TABLE default', [[['\t'.join(map(str,data[type][item][:,j,k]))] for j in range(res[1])] for k in range(res[2])] ]