From 794aeb253b8466153eec8c3ffec3fc8c8b0c1f72 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 20 Jan 2011 19:25:45 +0000 Subject: [PATCH] crystallite and CPFEM now print/output tensors in ij notation (used to be, particularly in the t16, ji, i.e. transposed...) math reports random seed used for rnd() generation --- code/CPFEM.f90 | 2 +- code/crystallite.f90 | 46 +++++++++++++++++++++++--------------------- code/math.f90 | 12 +++++++----- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/code/CPFEM.f90 b/code/CPFEM.f90 index effa2b4a1..b7560b278 100644 --- a/code/CPFEM.f90 +++ b/code/CPFEM.f90 @@ -546,7 +546,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt if (selectiveDebugger .and. cp_en == debug_e .and. IP == debug_i .and. mode < 6) then !$OMP CRITICAL (write2out) write(6,'(a,x,i2,x,a,x,i4,/,6(f10.3,x)/)') 'stress/MPa at ip', IP, 'el', cp_en, cauchyStress/1e6 - write(6,'(a,x,i2,x,a,x,i4,/,6(6(f10.3,x)/))') 'jacobian/GPa at ip', IP, 'el', cp_en, jacobian/1e9 + write(6,'(a,x,i2,x,a,x,i4,/,6(6(f10.3,x)/))') 'jacobian/GPa at ip', IP, 'el', cp_en, jacobian(1:6,:)/1e9 call flush(6) !$OMP END CRITICAL (write2out) endif diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 2b351f7f3..b71f10a6b 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -653,9 +653,9 @@ enddo write (6,*) '#############' write (6,*) 'central solution of cryst_StressAndTangent' write (6,*) '#############' - write (6,'(a8,3(x,i4),/,3(3(f12.4,x)/))') ' P of', g, i, e, crystallite_P(1:3,1:3,g,i,e)/1e6 - write (6,'(a8,3(x,i4),/,3(3(f14.9,x)/))') ' Fp of', g, i, e, crystallite_Fp(1:3,1:3,g,i,e) - write (6,'(a8,3(x,i4),/,3(3(f14.9,x)/))') ' Lp of', g, i, e, crystallite_Lp(1:3,1:3,g,i,e) + write (6,'(a8,3(x,i4),/,3(3(f12.4,x)/))') ' P of', g, i, e, crystallite_P(1:3,:,g,i,e)/1e6 + write (6,'(a8,3(x,i4),/,3(3(f14.9,x)/))') ' Fp of', g, i, e, crystallite_Fp(1:3,:,g,i,e) + write (6,'(a8,3(x,i4),/,3(3(f14.9,x)/))') ' Lp of', g, i, e, crystallite_Lp(1:3,:,g,i,e) !$OMP END CRITICAL (write2out) endif enddo @@ -2352,6 +2352,7 @@ function crystallite_integrateStress(& use math, only: math_mul33x33, & math_mul66x6, & math_mul99x99, & + math_transpose3x3, & math_inv3x3, & math_invert3x3, & math_invert, & @@ -2444,7 +2445,7 @@ function crystallite_integrateStress(& !$OMP CRITICAL (write2out) write(6,*) '::: integrateStress failed on invFp_current inversion',g,i,e write(6,*) - write(6,'(a11,i3,x,i2,x,i5,/,3(3(f12.7,x)/))') 'invFp_new at ',g,i,e,invFp_new + write(6,'(a11,i3,x,i2,x,i5,/,3(3(f12.7,x)/))') 'invFp_new at ',g,i,e,invFp_new(1:3,:) !$OMP END CRITICAL (write2out) endif return @@ -2503,8 +2504,8 @@ LpLoop: do !$OMP CRITICAL (write2out) write(6,'(a,i3,x,i2,x,i5,x,a,x,i3)') '::: integrateStress at ' ,g,i,e, ' ; iteration ', NiterationStress write(6,*) - write(6,'(a,/,3(3(e20.7,x)/))') 'Lp_constitutive', Lp_constitutive - write(6,'(a,/,3(3(e20.7,x)/))') 'Lpguess', Lpguess + write(6,'(a,/,3(3(e20.7,x)/))') 'Lp_constitutive', Lp_constitutive(1:3,:) + write(6,'(a,/,3(3(e20.7,x)/))') 'Lpguess', Lpguess(1:3,:) !$OMP END CRITICAL (write2out) endif @@ -2576,10 +2577,10 @@ LpLoop: do write(6,'(a,i3,x,i2,x,i5,x,a,i3)') '::: integrateStress failed on dR/dLp inversion at ',g,i,e, & '; iteration ', NiterationStress write(6,*) - write(6,'(a,/,9(9(e15.3,x)/))') 'dRdLp',dRdLp - write(6,'(a,/,9(9(e15.3,x)/))') 'dLpdT_constitutive',dLpdT_constitutive - write(6,'(a,/,3(3(e20.7,x)/))') 'Lp_constitutive',Lp_constitutive - write(6,'(a,/,3(3(e20.7,x)/))') 'Lpguess',Lpguess + write(6,'(a,/,9(9(e15.3,x)/))') 'dRdLp',dRdLp(1:9,:) + write(6,'(a,/,9(9(e15.3,x)/))') 'dLpdT_constitutive',dLpdT_constitutive(1:9,:) + write(6,'(a,/,3(3(e20.7,x)/))') 'Lp_constitutive',Lp_constitutive(1:3,:) + write(6,'(a,/,3(3(e20.7,x)/))') 'Lpguess',Lpguess(1:3,:) !$OMP END CRITICAL (write2out) endif return @@ -2589,8 +2590,8 @@ LpLoop: do write(6,'(a,i3,x,i2,x,i5,x,a,i3)') '::: integrateStress did dR/dLp inversion at ',g,i,e, & '; iteration ', NiterationStress write(6,*) - write(6,'(a,/,9(9(e15.3,x)/))') 'dRdLp',dRdLp - write(6,'(a,/,9(9(e15.3,x)/))') 'dLpdT_constitutive',dLpdT_constitutive + write(6,'(a,/,9(9(e15.3,x)/))') 'dRdLp',dRdLp(1:9,:) + write(6,'(a,/,9(9(e15.3,x)/))') 'dLpdT_constitutive',dLpdT_constitutive(1:9,:) !$OMP END CRITICAL (write2out) endif endif @@ -2621,7 +2622,7 @@ LpLoop: do write(6,'(a,i3,x,i2,x,i5,x,a,x,i3)') '::: integrateStress failed on invFp_new inversion at ',g,i,e, & ' ; iteration ', NiterationStress write(6,*) - write(6,'(a11,3(i3,x),/,3(3(f12.7,x)/))') 'invFp_new at ',g,i,e,invFp_new + write(6,'(a11,3(i3,x),/,3(3(f12.7,x)/))') 'invFp_new at ',g,i,e,invFp_new(1:3,:) !$OMP END CRITICAL (write2out) endif return @@ -2647,12 +2648,13 @@ LpLoop: do !$OMP CRITICAL (write2out) write(6,'(a,i3,x,i2,x,i5,x,a,x,i3)') '::: integrateStress converged at ',g,i,e,' ; iteration ', NiterationStress write(6,*) - write(6,'(a,/,3(3(f12.7,x)/))') 'P / MPa',crystallite_P(1:3,1:3,g,i,e)/1e6 + write(6,'(a,/,3(3(f12.7,x)/))') 'P / MPa',crystallite_P(1:3,:,g,i,e)/1e6 write(6,'(a,/,3(3(f12.7,x)/))') 'Cauchy / MPa', math_mul33x33(crystallite_P(1:3,1:3,g,i,e),transpose(Fg_new)) & / 1e6 / math_det3x3(Fg_new) - write(6,'(a,/,3(3(f12.7,x)/))') 'Fe Lp Fe^-1',math_mul33x33(Fe_new, math_mul33x33(crystallite_Lp(1:3,1:3,g,i,e), & - math_inv3x3(Fe_new))) - write(6,'(a,/,3(3(f12.7,x)/))') 'Fp',crystallite_Fp(1:3,1:3,g,i,e) + write(6,'(a,/,3(3(f12.7,x)/))') 'Fe Lp Fe^-1',math_transpose3x3( & + math_mul33x33(Fe_new, math_mul33x33(crystallite_Lp(1:3,1:3,g,i,e), & + math_inv3x3(Fe_new)))) ! transpose to get correct print out order + write(6,'(a,/,3(3(f12.7,x)/))') 'Fp',crystallite_Fp(1:3,:,g,i,e) !$OMP END CRITICAL (write2out) endif @@ -2871,24 +2873,24 @@ function crystallite_postResults(& c = c + 4_pInt case ('defgrad','f') mySize = 9_pInt - crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_partionedF(:,:,g,i,e),(/mySize/)) + crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_partionedF(1:3,:,g,i,e),(/mySize/)) c = c + mySize case ('fe') mySize = 9_pInt - crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_Fe(:,:,g,i,e),(/mySize/)) + crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_Fe(1:3,:,g,i,e),(/mySize/)) c = c + mySize case ('ee') Ee = 0.5_pReal * (math_mul33x33(transpose(crystallite_Fe(:,:,g,i,e)), crystallite_Fe(:,:,g,i,e)) - math_I3) mySize = 9_pInt - crystallite_postResults(c+1:c+1+mySize) = reshape(Ee(:,:),(/mySize/)) + crystallite_postResults(c+1:c+1+mySize) = reshape(Ee(1:3,:),(/mySize/)) c = c + mySize case ('fp') mySize = 9_pInt - crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_Fp(:,:,g,i,e),(/mySize/)) + crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_Fp(1:3,:,g,i,e),(/mySize/)) c = c + mySize case ('p','firstpiola','1stpiola') mySize = 9_pInt - crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_P(:,:,g,i,e),(/mySize/)) + crystallite_postResults(c+1:c+1+mySize) = reshape(crystallite_P(1:3,:,g,i,e),(/mySize/)) c = c + mySize case ('s','tstar','secondpiola','2ndpiola') mySize = 9_pInt diff --git a/code/math.f90 b/code/math.f90 index ff5944e80..1b40a691b 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -126,8 +126,9 @@ real(pReal), dimension(4,36), parameter :: math_symOperations = & real(pReal), dimension(3,3) :: R,R2 real(pReal), dimension(3) :: Eulers real(pReal), dimension(4) :: q,q2,axisangle - integer (pInt), dimension(1) :: randInit - integer (pInt) seed + real(pReal), dimension(2) :: rnd + integer(pInt), dimension(1) :: randInit + write(6,*) write(6,*) '<<<+- math init -+>>>' @@ -141,10 +142,11 @@ real(pReal), dimension(4,36), parameter :: math_symOperations = & call random_seed() endif - call get_seed(seed) - if (fixedSeed > 0_pInt) seed = int(dble(fixedSeed)/2.0) + 1_pInt + call random_seed(get=randInit) + write(6,*) 'random seed: ',randInit(1) + write(6,*) - call halton_seed_set(seed) + call halton_seed_set(randInit(1)) call halton_ndim_set(3) ! --- check rotation dictionary ---