better avoid initialization of residuum_old with huge, since it posed problems in Abaqus

This commit is contained in:
Christoph Kords 2012-11-08 13:26:22 +00:00
parent 07fd2681c6
commit c775edaa6d
1 changed files with 13 additions and 13 deletions

View File

@ -2838,7 +2838,7 @@ NiterationStress = 0_pInt
jacoCounter = 0_pInt jacoCounter = 0_pInt
steplength0 = 1.0_pReal steplength0 = 1.0_pReal
steplength = steplength0 steplength = steplength0
residuum_old = huge(1.0_pReal) residuum_old = 0.0_pReal
LpLoop: do LpLoop: do
NiterationStress = NiterationStress + 1_pInt NiterationStress = NiterationStress + 1_pInt
@ -2898,11 +2898,11 @@ LpLoop: do
!* update current residuum and check for convergence of loop !* update current residuum and check for convergence of loop
aTol = max(rTol_crystalliteStress * max(math_norm33(Lpguess),math_norm33(Lp_constitutive)), & ! absolute tolerance from largest acceptable relative error aTol = max(rTol_crystalliteStress * max(math_norm33(Lpguess),math_norm33(Lp_constitutive)), & ! absolute tolerance from largest acceptable relative error
aTol_crystalliteStress) ! minimum lower cutoff aTol_crystalliteStress) ! minimum lower cutoff
residuum = Lpguess - Lp_constitutive residuum = Lpguess - Lp_constitutive
if (any(residuum /= residuum)) then ! NaN in residuum... if (any(residuum /= residuum)) then ! NaN in residuum...
#ifndef _OPENMP #ifndef _OPENMP
if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then
write(6,'(a,i8,1x,i2,1x,i3,a,i3,a)') '<< CRYST >> integrateStress encountered NaN at el ip g ',e,i,g,& write(6,'(a,i8,1x,i2,1x,i3,a,i3,a)') '<< CRYST >> integrateStress encountered NaN at el ip g ',e,i,g,&
@ -2910,17 +2910,17 @@ LpLoop: do
' >> returning..!' ' >> returning..!'
endif endif
#endif #endif
return ! ...me = .false. to inform integrator about problem return ! ...me = .false. to inform integrator about problem
elseif (math_norm33(residuum) < aTol) then ! converged if below absolute tolerance elseif (math_norm33(residuum) < aTol) then ! converged if below absolute tolerance
exit LpLoop ! ...leave iteration loop exit LpLoop ! ...leave iteration loop
elseif (math_norm33(residuum) > math_norm33(residuum_old)) then ! not converged and worse residuum... elseif (math_norm33(residuum) < math_norm33(residuum_old) .or. NiterationStress == 1_pInt ) then ! not converged, but improved norm of residuum (always proceed in first iteration)...
steplength = 0.5_pReal * steplength ! ...try with smaller step length in same direction residuum_old = residuum ! ...remember old values and...
Lpguess_old = Lpguess
steplength = steplength0 ! ...proceed with normal step length (calculate new search direction)
else ! not converged and residuum not improved...
steplength = 0.5_pReal * steplength ! ...try with smaller step length in same direction
Lpguess = Lpguess_old + steplength * deltaLp Lpguess = Lpguess_old + steplength * deltaLp
cycle LpLoop cycle LpLoop
else ! not converged, but improved norm of residuum...
residuum_old = residuum ! ...remember old values and...
Lpguess_old = Lpguess
steplength = steplength0 ! ...proceed with normal step length (calculate new search direction)
endif endif