spectral solver accepting NaN in SNES converged reason as this might happen for homogeneous microstructures

This commit is contained in:
Martin Diehl 2015-12-01 22:36:19 +00:00
parent 0ffcb7fdaf
commit 22a9d65825
3 changed files with 16 additions and 15 deletions

View File

@ -298,8 +298,6 @@ type(tSolutionState) function &
S_scale = math_invSym3333(C_minMaxAvg)
endif
AL_solution%converged =.false.
!--------------------------------------------------------------------------------------------------
! set module wide availabe data
mask_stress = P_BC%maskFloat
@ -320,7 +318,8 @@ type(tSolutionState) function &
AL_solution%termIll = terminallyIll
terminallyIll = .false.
AL_solution%converged = .true.
if (reason < 1 ) AL_solution%converged = .false.
if (reason < 1 .and. reason /= -4) AL_solution%converged = .false. ! reason -4 (SNES_DIVERGED_FNORM_NAN) happens in case of homogeneous solution
AL_solution%iterationsNeeded = totalIter
end function AL_solution

View File

@ -265,7 +265,6 @@ type(tSolutionState) function basicPETSc_solution( &
S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C_volAvg)
if (update_gamma) call Utilities_updateGamma(C_minmaxAvg,restartWrite)
BasicPETSc_solution%converged =.false.
!--------------------------------------------------------------------------------------------------
! set module wide availabe data
@ -275,18 +274,21 @@ type(tSolutionState) function basicPETSc_solution( &
params%timeinc = timeinc
params%timeincOld = timeinc_old
call SNESSolve(snes,PETSC_NULL_OBJECT,solution_vec,ierr); CHKERRQ(ierr)
call SNESGetConvergedReason(snes,reason,ierr); CHKERRQ(ierr)
!--------------------------------------------------------------------------------------------------
! solve BVP
call SNESSolve(snes,PETSC_NULL_OBJECT,solution_vec,ierr)
CHKERRQ(ierr)
!--------------------------------------------------------------------------------------------------
! check convergence
call SNESGetConvergedReason(snes,reason,ierr)
CHKERRQ(ierr)
basicPETSc_solution%termIll = terminallyIll
terminallyIll = .false.
BasicPETSc_solution%converged =.true.
if (reason < 1) then
basicPETSC_solution%converged = .false.
basicPETSC_solution%iterationsNeeded = itmax
else
basicPETSC_solution%converged = .true.
basicPETSC_solution%iterationsNeeded = totalIter
endif
if (reason < 1 .and. reason /= -4) basicPETSC_solution%converged = .false. ! reason -4 (SNES_DIVERGED_FNORM_NAN) happens in case of homogeneous solution
basicPETSC_solution%iterationsNeeded = totalIter
end function BasicPETSc_solution

View File

@ -296,7 +296,6 @@ type(tSolutionState) function &
C_scale = C_minMaxAvg
S_scale = math_invSym3333(C_minMaxAvg)
endif
Polarisation_solution%converged =.false.
!--------------------------------------------------------------------------------------------------
! set module wide availabe data
@ -318,7 +317,8 @@ type(tSolutionState) function &
Polarisation_solution%termIll = terminallyIll
terminallyIll = .false.
Polarisation_solution%converged = .true.
if (reason < 1 ) Polarisation_solution%converged = .false.
if (reason < 1 .and. reason /= -4) Polarisation_solution%converged = .false. ! reason -4 (SNES_DIVERGED_FNORM_NAN) happens in case of homogeneous solution
Polarisation_solution%iterationsNeeded = totalIter
end function Polarisation_solution