From f50d3291f90150b41c4780a3618005729e7d3c42 Mon Sep 17 00:00:00 2001 From: Denny Tjahjanto Date: Thu, 22 Oct 2009 16:59:24 +0000 Subject: [PATCH] sorry, back to the previous version. grain deformation output is part of crystallite.f90, no longer done by homogenization. material.config reflects the changes. --- code/crystallite.f90 | 30 ++++++++++++++++++++---------- code/homogenization.f90 | 21 +++++++++------------ code/homogenization_RGC.f90 | 21 ++------------------- code/material.config | 1 - 4 files changed, 31 insertions(+), 42 deletions(-) diff --git a/code/crystallite.f90 b/code/crystallite.f90 index d135ff774..8411d58f5 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -19,7 +19,7 @@ implicit none ! **************************************************************** ! *** General variables for the crystallite calculation *** ! **************************************************************** -integer(pInt), parameter :: crystallite_Nresults = 5_pInt ! phaseID, volume, Euler angles +integer(pInt), parameter :: crystallite_Nresults = 14_pInt ! phaseID, volume, Euler angles, def gradient real(pReal), dimension (:,:,:), allocatable :: crystallite_dt, & ! requested time increment of each grain crystallite_subdt, & ! substepped time increment of each grain @@ -1201,29 +1201,39 @@ function crystallite_postResults(& real(pReal), intent(in):: dt ! time increment !*** output variables ***! - real(pReal), dimension(crystallite_Nresults + constitutive_sizePostResults(g,i,e)) :: crystallite_postResults + real(pReal), dimension(1+crystallite_Nresults + 1+constitutive_sizePostResults(g,i,e)) :: crystallite_postResults !*** local variables ***! real(pReal), dimension(3,3) :: U, R + integer(pInt) k,l,c logical error - + + c = 0_pInt + crystallite_postResults(c+1) = crystallite_Nresults; c = c+1_pInt ! size of (hardwired) results if (crystallite_Nresults >= 2) then - crystallite_postResults(1) = material_phase(g,i,e) - crystallite_postResults(2) = material_volume(g,i,e) + crystallite_postResults(c+1) = material_phase(g,i,e) + crystallite_postResults(c+2) = material_volume(g,i,e) + c = c+2_pInt endif if (crystallite_Nresults >= 5) then - call math_pDecomposition(crystallite_Fe(:,:,g,i,e),U,R,error) ! polar decomposition of Fe + call math_pDecomposition(crystallite_Fe(:,:,g,i,e),U,R,error) ! polar decomposition of Fe if (error) then call IO_warning(650,e,i,g) - crystallite_postResults(3:5) = (/400.0,400.0,400.0/) ! fake orientation + crystallite_postResults(c+1:c+3) = (/400.0,400.0,400.0/) ! fake orientation else - crystallite_postResults(3:5) = math_RtoEuler(transpose(R))*inDeg ! orientation + crystallite_postResults(c+1:c+3) = math_RtoEuler(transpose(R))*inDeg ! orientation endif + c = c+3_pInt + endif + if (crystallite_Nresults >= 14) then ! deformation gradient + forall (k=0:2,l=0:2) crystallite_postResults(c+1+k*3+l) = crystallite_partionedF(k+1,l+1,g,i,e) + c = c+9_pInt endif - crystallite_postResults(crystallite_Nresults+1:crystallite_Nresults+constitutive_sizePostResults(g,i,e)) = & + crystallite_postResults(c+1) = constitutive_sizePostResults(g,i,e); c = c+1_pInt ! size of constitutive results + crystallite_postResults(c+1:c+constitutive_sizePostResults(g,i,e)) = & constitutive_postResults(crystallite_Tstar_v(:,g,i,e), crystallite_subTstar0_v(:,g,i,e), crystallite_Temperature(g,i,e), & - dt, crystallite_subdt(g,i,e), g, i, e) + dt, crystallite_subdt(g,i,e), g, i, e); c = c+constitutive_sizePostResults(g,i,e) return diff --git a/code/homogenization.f90 b/code/homogenization.f90 index 1e88f063e..af2f95e22 100644 --- a/code/homogenization.f90 +++ b/code/homogenization.f90 @@ -133,7 +133,7 @@ subroutine homogenization_init(Temperature) homogenization_maxSizePostResults = maxval(homogenization_sizePostResults) materialpoint_sizeResults = 1+ 1+homogenization_maxSizePostResults + & ! grain count, homogSize, homogResult - homogenization_maxNgrains*(1+crystallite_Nresults+constitutive_maxSizePostResults) + homogenization_maxNgrains*(1+crystallite_Nresults+1+constitutive_maxSizePostResults) allocate(materialpoint_results( materialpoint_sizeResults, mesh_maxNips,mesh_NcpElems)) @@ -481,9 +481,8 @@ subroutine materialpoint_postResults(dt) materialpoint_results(c+1:c+d,i,e) = & ! tell homogenization results homogenization_postResults(i,e); c = c+d endif - do g = 1,myNgrains ! - d = crystallite_Nresults + constitutive_sizePostResults(g,i,e) - materialpoint_results(c+1,i,e) = d; c = c+1_pInt ! tell size of crystallite results + do g = 1,myNgrains ! loop over all grains + d = 1+crystallite_Nresults + 1+constitutive_sizePostResults(g,i,e) materialpoint_results(c+1:c+d,i,e) = & ! tell crystallite results crystallite_postResults(dt,g,i,e); c = c+d enddo @@ -662,12 +661,11 @@ function homogenization_postResults(& ip, & ! integration point el & ! element ) - use prec, only: pReal,pInt - use mesh, only: mesh_element - use material, only: homogenization_type - use crystallite, only: crystallite_partionedF + use prec, only: pReal,pInt + use mesh, only: mesh_element + use material, only: homogenization_type use homogenization_isostrain - use homogenization_RGC ! RGC homogenization added <<>> + use homogenization_RGC ! RGC homogenization added <<>> implicit none !* Definition of variables @@ -679,10 +677,9 @@ function homogenization_postResults(& !* isostrain case (homogenization_isostrain_label) homogenization_postResults = homogenization_isostrain_postResults(homogenization_state(ip,el),ip,el) -!* RGC homogenization added <<>> +!* RGC homogenization added <<>> case (homogenization_RGC_label) - homogenization_postResults = homogenization_RGC_postResults(crystallite_partionedF(:,:,:,ip,el), & - homogenization_state(ip,el),ip,el) + homogenization_postResults = homogenization_RGC_postResults(homogenization_state(ip,el),ip,el) end select return diff --git a/code/homogenization_RGC.f90 b/code/homogenization_RGC.f90 index 7a55eb400..2d3ea6ea7 100644 --- a/code/homogenization_RGC.f90 +++ b/code/homogenization_RGC.f90 @@ -125,11 +125,6 @@ subroutine homogenization_RGC_init(& case('magnitudemismatch') homogenization_RGC_sizePostResults(i) = & homogenization_RGC_sizePostResults(i) + 1 - case('grainsdeformation') - homogenization_RGC_sizePostResults(i) = & - homogenization_RGC_sizePostResults(i) + 9_pInt*(homogenization_RGC_Ngrains(1,i)* & - homogenization_RGC_Ngrains(2,i)* & - homogenization_RGC_Ngrains(3,i)) end select enddo @@ -657,7 +652,6 @@ endfunction ! return array of homogenization results for post file inclusion !******************************************************************** pure function homogenization_RGC_postResults(& - F, & ! array of current grain deformation gradients state, & ! my state ip, & ! my integration point el & ! my element @@ -665,16 +659,14 @@ pure function homogenization_RGC_postResults(& use prec, only: pReal,pInt,p_vec use mesh, only: mesh_element - use material, only: homogenization_typeInstance,homogenization_Noutput,homogenization_Ngrains, & - homogenization_maxNgrains + use material, only: homogenization_typeInstance,homogenization_Noutput,homogenization_Ngrains implicit none !* Definition of variables - real(pReal), dimension (3,3,homogenization_maxNgrains), intent(in) :: F type(p_vec), intent(in) :: state integer(pInt), intent(in) :: ip,el ! - integer(pInt) homID,o,c,nIntFaceTot,i,j,k + integer(pInt) homID,o,c,nIntFaceTot real(pReal), dimension(homogenization_RGC_sizePostResults(homogenization_typeInstance(mesh_element(3,el)))) :: & homogenization_RGC_postResults @@ -696,15 +688,6 @@ pure function homogenization_RGC_postResults(& case('magnitudemismatch') homogenization_RGC_postResults(c+1) = state%p(3*nIntFaceTot+3) c = c + 1 - case('grainsdeformation') - do k = 1,homogenization_RGC_Ngrains(1,homID)*homogenization_RGC_Ngrains(2,homID)*homogenization_RGC_Ngrains(3,homID) - do i = 1,3 - do j = 1,3 - homogenization_RGC_postResults(c+1) = F(i,j,k) - c = c + 1 - enddo - enddo - enddo end select enddo diff --git a/code/material.config b/code/material.config index fa2dd1790..655bc8005 100644 --- a/code/material.config +++ b/code/material.config @@ -17,7 +17,6 @@ overproportionality 1.6e+0 1.6e+0 1.6e+0 (output) constitutivework (output) penaltyenergy (output) magnitudemismatch -(output) grainsdeformation # warning: tensorial output, size = ngrains x 3 x 3 components [Taylor2] type isostrain