From 8c8132bcd73817db58c70491fa5262d871e1a8f5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 27 Jun 2020 23:37:09 +0200 Subject: [PATCH] coordinates should not have random names --- python/damask/_vtk.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index f4855820e..dd8832a5c 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -51,9 +51,11 @@ class VTK: """ geom = vtk.vtkRectilinearGrid() geom.SetDimensions(*(grid+1)) - geom.SetXCoordinates(np_to_vtk(np.linspace(origin[0],origin[0]+size[0],grid[0]+1),deep=True)) - geom.SetYCoordinates(np_to_vtk(np.linspace(origin[1],origin[1]+size[1],grid[1]+1),deep=True)) - geom.SetZCoordinates(np_to_vtk(np.linspace(origin[2],origin[2]+size[2],grid[2]+1),deep=True)) + coord = [np_to_vtk(np.linspace(origin[i],origin[i]+size[i],grid[i]+1),deep=True) for i in [0,1,2]] + [coord[i].SetName(n) for i,n in enumerate(['x','y','z'])] + geom.SetXCoordinates(coord[0]) + geom.SetYCoordinates(coord[1]) + geom.SetZCoordinates(coord[2]) return VTK(geom)