From ea0fe7b40611c24fe442c55d8c3facb018453171 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 6 Dec 2011 17:46:33 +0000 Subject: [PATCH] corrected 3D visualize (math.f90 part was not working) small polishing of voronoi_tessellation.f90 --- code/math.f90 | 9 +++++---- processing/post/3Dvisualize.py | 4 ++-- processing/pre/voronoi_tessellation.f90 | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/math.f90 b/code/math.f90 index 2503199a4..9fd1734a9 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -3019,7 +3019,8 @@ subroutine mesh_regular_grid(res,geomdim,defgrad_av,centroids,nodes) real(pReal), dimension(res(1)+2_pInt,res(2)+2_pInt,res(3)+2_pInt,3) :: wrappedCentroids ! other variables integer(pInt) :: i,j,k,n - integer(pInt), dimension(3) :: diag = 0_pInt , shift = 0_pInt, lookup = 0_pInt, me + integer(pInt), dimension(3), parameter :: diag = 1_pInt + integer(pInt), dimension(3) :: shift = 0_pInt, lookup = 0_pInt, me = 0_pInt integer(pInt), dimension(3,8) :: neighbor = reshape((/ & 0_pInt, 0_pInt, 0_pInt, & 1_pInt, 0_pInt, 0_pInt, & @@ -3058,9 +3059,9 @@ subroutine mesh_regular_grid(res,geomdim,defgrad_av,centroids,nodes) do i = 0_pInt,res(1) do n = 1_pInt,8_pInt nodes(i+1_pInt,j+1_pInt,k+1_pInt,1:3) = & - nodes(i+1_pInt,j+1_pInt,k+1_pInt,3) + wrappedCentroids(i+1_pInt+neighbor(1_pInt,n), & - j+1_pInt+neighbor(2,n), & - k+1_pInt+neighbor(3,n),1:3) + nodes(i+1_pInt,j+1_pInt,k+1_pInt,1:3) + wrappedCentroids(i+1_pInt+neighbor(1_pInt,n), & + j+1_pInt+neighbor(2,n), & + k+1_pInt+neighbor(3,n),1:3) enddo; enddo; enddo; enddo nodes = nodes/8.0_pReal diff --git a/processing/post/3Dvisualize.py b/processing/post/3Dvisualize.py index a4292e84c..e180d31ec 100755 --- a/processing/post/3Dvisualize.py +++ b/processing/post/3Dvisualize.py @@ -337,7 +337,7 @@ for filename in args: m = re.search('(\d+)\shead',content[0],re.I) if m == None: continue - print filename, + print filename,'\n' sys.stdout.flush() headrow = int(m.group(1)) @@ -417,12 +417,12 @@ for filename in args: column['tensor'][options.defgrad]+9], (res[0],res[1],res[2],3,3))) + #centroids = DAMASK.math.deformed_linear(res,dim,defgrad_av, centroids = DAMASK.math.deformed_fft(res,dim,defgrad_av,options.scaling, numpy.reshape(values[:,column['tensor'][options.defgrad]: column['tensor'][options.defgrad]+9], (res[0],res[1],res[2],3,3))) ms = DAMASK.math.mesh_regular_grid(res,dim,defgrad_av,centroids) - fields = {\ 'tensor': {},\ 'vector': {},\ diff --git a/processing/pre/voronoi_tessellation.f90 b/processing/pre/voronoi_tessellation.f90 index 7aaf7c7d8..c3b508381 100644 --- a/processing/pre/voronoi_tessellation.f90 +++ b/processing/pre/voronoi_tessellation.f90 @@ -307,7 +307,7 @@ program voronoi do i = 1, N_Seeds write(20, trim(format1)), '[Grain', i, ']' write(20, trim(format2)), '(gauss) phi1 ', grainEuler(i,1), ' Phi ', grainEuler(i,2), & - &' Phi2 ', grainEuler(i,3), ' scatter 0 fraction 1' + &' Phi2 ', grainEuler(i,3), ' scatter 0.0 fraction 1.0' end do close(20) print*, 'material.config done.'