just a test

This commit is contained in:
Luc Hantcherli 2007-12-14 13:28:41 +00:00
parent 90195fe1c8
commit 3ef451824c
1 changed files with 24 additions and 6 deletions

View File

@ -116,7 +116,7 @@
real(pReal) ffn(3,3), ffn1(3,3), Temperature, CPFEM_dt, CPFEM_stress(CPFEM_ngens), CPFEM_jaco(CPFEM_ngens,CPFEM_ngens) real(pReal) ffn(3,3), ffn1(3,3), Temperature, CPFEM_dt, CPFEM_stress(CPFEM_ngens), CPFEM_jaco(CPFEM_ngens,CPFEM_ngens)
logical CPFEM_stress_recovery logical CPFEM_stress_recovery
! !
Temperature = 293.0_pReal
! calculate only every second cycle ! calculate only every second cycle
if(mod(CPFEM_cn,2)==0) then if(mod(CPFEM_cn,2)==0) then
! really calculate only in first call of new cycle and when in stress recovery ! really calculate only in first call of new cycle and when in stress recovery
@ -128,7 +128,7 @@ if(mod(CPFEM_cn,2)==0) then
call mesh_init() call mesh_init()
call crystal_Init() call crystal_Init()
call constitutive_init() call constitutive_init()
call CPFEM_init() call CPFEM_init()
CPFEM_Temperature = Temperature CPFEM_Temperature = Temperature
CPFEM_first_call = .false. CPFEM_first_call = .false.
endif endif
@ -151,6 +151,7 @@ if(mod(CPFEM_cn,2)==0) then
! this shall be done in a parallel loop in the future ! this shall be done in a parallel loop in the future
do e=1,mesh_NcpElems do e=1,mesh_NcpElems
do i=1,FE_Nips(FE_mapElemtype(mesh_element(2,e))) do i=1,FE_Nips(FE_mapElemtype(mesh_element(2,e)))
write(6,*) 'Debut', e,i
call CPFEM_stressIP(CPFEM_cn, CPFEM_dt, i, e) call CPFEM_stressIP(CPFEM_cn, CPFEM_dt, i, e)
enddo enddo
enddo enddo
@ -329,8 +330,11 @@ if(mod(CPFEM_cn,2)==0) then
real(pReal), dimension(6,6) :: dcs_de real(pReal), dimension(6,6) :: dcs_de
real(pReal), dimension(constitutive_Nstatevars(grain,CPFEM_in,cp_en)) :: state_old,state_new,state_pert real(pReal), dimension(constitutive_Nstatevars(grain,CPFEM_in,cp_en)) :: state_old,state_new,state_pert
write(6,*)
write(6,*) 'SOLUTION'
call CPFEM_timeIntegration(msg,Fp_new,Fe_new,Tstar_v,state_new, & ! def gradients and PK2 at end of time step call CPFEM_timeIntegration(msg,Fp_new,Fe_new,Tstar_v,state_new, & ! def gradients and PK2 at end of time step
dt,cp_en,CPFEM_in,grain,Fg_new,Fp_old,state_old) dt,cp_en,CPFEM_in,grain,Fg_new,Fp_old,state_old)
if (msg /= 'ok') return if (msg /= 'ok') return
cs = CPFEM_CauchyStress(Tstar_v,Fe_new) ! Cauchy stress cs = CPFEM_CauchyStress(Tstar_v,Fe_new) ! Cauchy stress
@ -343,6 +347,8 @@ if(mod(CPFEM_cn,2)==0) then
Fg_pert = Fg_new+matmul(E_pert,Fg_old) ! perturbated Fg Fg_pert = Fg_new+matmul(E_pert,Fg_old) ! perturbated Fg
Tstar_v_pert = Tstar_v ! initial guess from end of time step Tstar_v_pert = Tstar_v ! initial guess from end of time step
state_pert = state_new ! initial guess from end of time step state_pert = state_new ! initial guess from end of time step
write(6,*)
write(6,*) 'CONSISTENT TANGENT', i
call CPFEM_timeIntegration(msg,Fp_pert,Fe_pert,Tstar_v_pert,state_pert, & call CPFEM_timeIntegration(msg,Fp_pert,Fe_pert,Tstar_v_pert,state_pert, &
dt,cp_en,CPFEM_in,grain,Fg_pert,Fp_old,state_old) dt,cp_en,CPFEM_in,grain,Fg_pert,Fp_old,state_old)
if (msg /= 'ok') then if (msg /= 'ok') then
@ -354,6 +360,14 @@ if(mod(CPFEM_cn,2)==0) then
enddo enddo
endif endif
write(6,*) 'OPERATEUR TANGENTE'
write(6,*) dcs_de(1,:)
write(6,*) dcs_de(2,:)
write(6,*) dcs_de(3,:)
write(6,*) dcs_de(4,:)
write(6,*) dcs_de(5,:)
write(6,*) dcs_de(6,:)
return return
END SUBROUTINE END SUBROUTINE
@ -426,6 +440,7 @@ state: do ! outer iteration: state
iStress = 0_pInt iStress = 0_pInt
stress: do ! inner iteration: stress stress: do ! inner iteration: stress
iStress = iStress+1 iStress = iStress+1
write(6,*) 'istate,istress', istate, istress
if (iStress > nStress) then ! too many loops required if (iStress > nStress) then ! too many loops required
msg = 'limit stress iteration' msg = 'limit stress iteration'
return return
@ -447,6 +462,9 @@ stress: do ! inner iteration: stress
dTstar_v=0.5*dTstar_v dTstar_v=0.5*dTstar_v
cycle cycle
endif endif
write(6,*) 'Tstar_v', Tstar_v
write(6,*) 'dTstar_v', dTstar_v
!write(6,*) 'norm stress', maxval(abs(Rstress/maxval(abs(Tstar_v))))
if (iStress > 1 .and. & if (iStress > 1 .and. &
(maxval(abs(Tstar_v)) < abstol_Stress .or. maxval(abs(Rstress/maxval(abs(Tstar_v)))) < reltol_Stress)) exit stress (maxval(abs(Tstar_v)) < abstol_Stress .or. maxval(abs(Rstress/maxval(abs(Tstar_v)))) < reltol_Stress)) exit stress
@ -478,21 +496,21 @@ stress: do ! inner iteration: stress
dTstar_v = matmul(invJacobi,Rstress) ! correction to Tstar dTstar_v = matmul(invJacobi,Rstress) ! correction to Tstar
Rstress_old=Rstress Rstress_old=Rstress
Tstar_v = Tstar_v-dTstar_v Tstar_v = Tstar_v-dTstar_v
! write(999,*) Tstar_v, dTstar_v, Rstress
enddo stress enddo stress
! write(6,*) 'istress', istress
Tstar_v = 0.5_pReal*matmul(C_66,math_Mandel33to6(matmul(transpose(B),AB)-math_I3)) Tstar_v = 0.5_pReal*matmul(C_66,math_Mandel33to6(matmul(transpose(B),AB)-math_I3))
dstate = dt*constitutive_dotState(Tstar_v,state_new,CPFEM_Temperature(CPFEM_in,cp_en),grain,CPFEM_in,cp_en) ! evolution of microstructure dstate = dt*constitutive_dotState(Tstar_v,state_new,CPFEM_Temperature(CPFEM_in,cp_en),grain,CPFEM_in,cp_en) ! evolution of microstructure
Rstate = state_new - (state_old+dstate) Rstate = state_new - (state_old+dstate)
RstateS = 0.0_pReal RstateS = 0.0_pReal
forall (i=1:constitutive_Nstatevars(grain,CPFEM_in,cp_en), state_new(i)/=0.0_pReal) & forall (i=1:constitutive_Nstatevars(grain,CPFEM_in,cp_en), state_new(i)/=0.0_pReal) &
RstateS(i) = Rstate(i)/state_new(i) RstateS(i) = Rstate(i)/state_new(i)
state_new = state_old+dstate state_new = state_old+dstate
write(6,*) 'norm state', maxval(abs(RstateS))
if (maxval(abs(RstateS)) < reltol_State) exit state if (maxval(abs(RstateS)) < reltol_State) exit state
enddo state enddo state
! write(6,*) 'istate', istate
! write(999,*) 'Tstar_v raus', Tstar_v ! write(999,*) 'Tstar_v raus', Tstar_v
! write(999,*) ! write(999,*)