From 0c6fde97f9bed2ea1b7476240b0eabccbdb33d15 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 13 Apr 2019 00:42:05 +0200 Subject: [PATCH] wrong positions for point visualization - now the cell centers are at the centers of the cells for cell visualization --- processing/post/addDisplacement.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index aa12ba2b1..53311ce9e 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -40,9 +40,10 @@ def displacementAvgFFT(F,grid,size,nodal=False,transformed=False): np.linspace(0,size[0],1+grid[0]), indexing = 'ij') else: - x, y, z = np.meshgrid(np.linspace(0,size[2],grid[2],endpoint=False), - np.linspace(0,size[1],grid[1],endpoint=False), - np.linspace(0,size[0],grid[0],endpoint=False), + delta = size/grid*0.5 + x, y, z = np.meshgrid(np.linspace(delta[2],size[2]-delta[2],grid[2]), + np.linspace(delta[1],size[1]-delta[1],grid[1]), + np.linspace(delta[0],size[0]-delta[0],grid[0]), indexing = 'ij') origCoords = np.concatenate((z[:,:,:,None],y[:,:,:,None],x[:,:,:,None]),axis = 3)