fixed reading in of state for restarting

This commit is contained in:
Martin Diehl 2014-07-24 08:38:52 +00:00
parent 56a316a6bb
commit 7afc21f48f
1 changed files with 23 additions and 29 deletions

View File

@ -151,7 +151,9 @@ subroutine CPFEM_init
mesh_maxNips mesh_maxNips
use material, only: & use material, only: &
homogenization_maxNgrains, & homogenization_maxNgrains, &
material_phase material_phase, &
phase_plasticity, &
plasticState
use crystallite, only: & use crystallite, only: &
crystallite_F0, & crystallite_F0, &
crystallite_Fp0, & crystallite_Fp0, &
@ -164,7 +166,7 @@ subroutine CPFEM_init
homogenization_state0 homogenization_state0
implicit none implicit none
integer(pInt) :: i,j,k,l,m integer(pInt) :: i,j,k,l,m,ph
write(6,'(/,a)') ' <<<+- CPFEM init -+>>>' write(6,'(/,a)') ' <<<+- CPFEM init -+>>>'
write(6,'(a)') ' $Id$' write(6,'(a)') ' $Id$'
@ -207,17 +209,16 @@ subroutine CPFEM_init
read (777,rec=1) crystallite_Tstar0_v read (777,rec=1) crystallite_Tstar0_v
close (777) close (777)
#ifdef TODO
call IO_read_realFile(777,'convergedStateConst',modelName) call IO_read_realFile(777,'convergedStateConst',modelName)
m = 0_pInt m = 0_pInt
do i = 1,homogenization_maxNgrains; do j = 1,mesh_maxNips; do k = 1,mesh_NcpElems readInstances: do ph = 1_pInt, size(phase_plasticity)
do l = 1,size(constitutive_state0(i,j,k)%p) do k = 1_pInt, plasticState(ph)%sizeState
do l = 1, size(plasticState(ph)%state(1,:))
m = m+1_pInt m = m+1_pInt
read(777,rec=m) constitutive_state0(i,j,k)%p(l) read(777,rec=m) plasticState(ph)%state0(k,l)
enddo enddo; enddo
enddo; enddo; enddo enddo readInstances
close (777) close (777)
#endif
call IO_read_realFile(777,'convergedStateHomog',modelName) call IO_read_realFile(777,'convergedStateHomog',modelName)
m = 0_pInt m = 0_pInt
@ -229,8 +230,6 @@ subroutine CPFEM_init
enddo; enddo enddo; enddo
close (777) close (777)
call IO_read_realFile(777,'convergeddcsdE',modelName,size(CPFEM_dcsdE)) call IO_read_realFile(777,'convergeddcsdE',modelName,size(CPFEM_dcsdE))
read (777,rec=1) CPFEM_dcsdE read (777,rec=1) CPFEM_dcsdE
close (777) close (777)
@ -303,8 +302,8 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el
damageState, & damageState, &
thermalState, & thermalState, &
mappingConstitutive, & mappingConstitutive, &
material_phase material_phase, &
phase_plasticity
use crystallite, only: & use crystallite, only: &
crystallite_partionedF,& crystallite_partionedF,&
crystallite_F0, & crystallite_F0, &
@ -355,7 +354,7 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el
H, & H, &
jacobian3333 ! jacobian in Matrix notation jacobian3333 ! jacobian in Matrix notation
integer(pInt) elCP, & ! crystal plasticity element number integer(pInt) elCP, & ! crystal plasticity element number
i, j, k, l, m, n i, j, k, l, m, n, ph
logical updateJaco ! flag indicating if JAcobian has to be updated logical updateJaco ! flag indicating if JAcobian has to be updated
@ -442,17 +441,16 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el
write (777,rec=1) crystallite_Tstar0_v write (777,rec=1) crystallite_Tstar0_v
close (777) close (777)
#ifdef TODO
call IO_write_jobRealFile(777,'convergedStateConst') call IO_write_jobRealFile(777,'convergedStateConst')
m = 0_pInt m = 0_pInt
do i = 1,homogenization_maxNgrains; do j = 1,mesh_maxNips; do k = 1,mesh_NcpElems writeInstances: do ph = 1_pInt, size(phase_plasticity)
do l = 1,size(constitutive_state0(i,j,k)%p) do k = 1_pInt, plasticState(ph)%sizeState
do l = 1, size(plasticState(ph)%state(1,:))
m = m+1_pInt m = m+1_pInt
write(777,rec=m) constitutive_state0(i,j,k)%p(l) write(777,rec=m) plasticState(ph)%state0(k,l)
enddo enddo; enddo
enddo; enddo; enddo enddo writeInstances
close (777) close (777)
#endif
call IO_write_jobRealFile(777,'convergedStateHomog') call IO_write_jobRealFile(777,'convergedStateHomog')
m = 0_pInt m = 0_pInt
@ -614,14 +612,10 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el
elCP, ip, transpose(CPFEM_dcsdE(1:6,1:6,ip,elCP))/1.0e9_pReal elCP, ip, transpose(CPFEM_dcsdE(1:6,1:6,ip,elCP))/1.0e9_pReal
flush(6) flush(6)
endif endif
endif endif
!*** warn if stiffness close to zero !*** warn if stiffness close to zero
if (all(abs(CPFEM_dcsdE(1:6,1:6,ip,elCP)) < 1e-10_pReal)) call IO_warning(601,elCP,ip) if (all(abs(CPFEM_dcsdE(1:6,1:6,ip,elCP)) < 1e-10_pReal)) call IO_warning(601,elCP,ip)
!*** copy to output if required (FEM solver) !*** copy to output if required (FEM solver)
if(present(cauchyStress)) cauchyStress = CPFEM_cs (1:6, ip,elCP) if(present(cauchyStress)) cauchyStress = CPFEM_cs (1:6, ip,elCP)
if(present(jacobian)) jacobian = CPFEM_dcsdE(1:6,1:6,ip,elCP) if(present(jacobian)) jacobian = CPFEM_dcsdE(1:6,1:6,ip,elCP)