updates for AL version of spectral solver

This commit is contained in:
Pratheek Shanthraj 2012-08-06 08:53:12 +00:00
parent 4795fe61fa
commit e2a2621235
4 changed files with 541 additions and 580 deletions

View File

@ -62,7 +62,7 @@ program DAMASK_spectral_Driver
debugGeneral
use DAMASK_spectral_SolverBasic
!use DAMASK_spectral_SolverAL
use DAMASK_spectral_SolverAL
implicit none
@ -286,8 +286,8 @@ program DAMASK_spectral_Driver
case (DAMASK_spectral_SolverBasic_label)
call basic_init()
!case (DAMASK_spectral_SolverAL_label)
! call AL_init()
case (DAMASK_spectral_SolverAL_label)
call AL_init()
end select
!--------------------------------------------------------------------------------------------------
@ -369,15 +369,13 @@ program DAMASK_spectral_Driver
temperature_bc = loadCases(currentLoadCase)%temperature, &
rotation_BC = loadCases(currentLoadCase)%rotation)
! case (DAMASK_spectral_SolverAL_label)
! solres = AL_solution (&
! guessmode,timeinc,timeinc_old, &
! P_BC = loadCases(currentLoadCase)%stress, &
! F_BC = loadCases(currentLoadCase)%deformation, &
! ! temperature_bc = loadCases(currentLoadCase)%temperature, &
! mask_stressVector = loadCases(currentLoadCase)%maskStressVector, &
! velgrad = loadCases(currentLoadCase)%velGradApplied, &
! rotation_BC = loadCases(currentLoadCase)%rotation)
case (DAMASK_spectral_SolverAL_label)
solres = AL_solution (&
guessmode,timeinc,timeinc_old, &
P_BC = loadCases(currentLoadCase)%P, &
F_BC = loadCases(currentLoadCase)%deformation, &
temperature_bc = loadCases(currentLoadCase)%temperature, &
rotation_BC = loadCases(currentLoadCase)%rotation)
end select
@ -408,9 +406,9 @@ program DAMASK_spectral_Driver
case (DAMASK_spectral_SolverBasic_label)
call basic_destroy()
! case (DAMASK_spectral_SolverAL_label)
! call AL_destroy()
!
case (DAMASK_spectral_SolverAL_label)
call AL_destroy()
end select
write(6,'(a)') ''

File diff suppressed because it is too large Load Diff

View File

@ -268,7 +268,7 @@ type(solutionState) function basic_solution(guessmode,timeinc,timeinc_old,P_BC,F
F(i,j,k,1:3,1:3) = F(i,j,k,1:3,1:3) - field_real(i,j,k,1:3,1:3) ! F(x)^(n+1) = F(x)^(n) + correction; *wgt: correcting for missing normalization
enddo; enddo; enddo
basic_solution%converged = basic_Convergeced(err_div,P_av,err_stress,P_av)
basic_solution%converged = basic_Converged(err_div,P_av,err_stress,P_av)
if (basic_solution%converged .and. iter > itmin) exit
enddo convergenceLoop
@ -279,7 +279,7 @@ end function basic_solution
!--------------------------------------------------------------------------------------------------
!> @brief convergence check for basic scheme based on div of P and deviation from stress aim
!--------------------------------------------------------------------------------------------------
logical function basic_Convergeced(err_div,pAvgDiv,err_stress,pAvgStress)
logical function basic_Converged(err_div,pAvgDiv,err_stress,pAvgStress)
use numerics, only: &
itmin, &
@ -311,7 +311,7 @@ logical function basic_Convergeced(err_div,pAvgDiv,err_stress,pAvgStress)
pAvgDivL2 = sqrt(maxval(math_eigenvalues33(math_mul33x33(pAvgDiv,math_transpose33(pAvgDiv))))) ! L_2 norm of average stress (http://mathworld.wolfram.com/SpectralNorm.html)
err_stress_tol = min(maxval(abs(pAvgStress))*err_stress_tolrel,err_stress_tolabs)
basic_Convergeced = all([ err_div/pAvgDivL2/err_div_tol,&
basic_Converged = all([ err_div/pAvgDivL2/err_div_tol,&
err_stress/err_stress_tol ] < 1.0_pReal)
write(6,'(a,f6.2,a,es11.4,a)') 'error divergence = ', err_div/pAvgDivL2/err_div_tol,&
@ -319,7 +319,7 @@ logical function basic_Convergeced(err_div,pAvgDiv,err_stress,pAvgStress)
write(6,'(a,f6.2,a,es11.4,a)') 'error stress = ', err_stress/err_stress_tol, &
' (',err_stress,' Pa)'
end function basic_Convergeced
end function basic_Converged
subroutine basic_destroy()

View File

@ -77,6 +77,8 @@ integer(pInt) :: DAMASK_NumThreadsInt = 0_pInt
real(pReal) :: err_div_tol = 0.1_pReal, & ! Div(P)/avg(P)*meter
err_stress_tolrel = 0.01_pReal, & ! relative tolerance for fullfillment of stress BC, Default: 0.01 allowing deviation of 1% of maximum stress
err_stress_tolabs = huge(1.0_pReal), & ! absolute tolerance for fullfillment of stress BC, Default: 0.01 allowing deviation of 1% of maximum stress
err_f_tol = 1e-6_pReal, &
err_p_tol = 1e-5_pReal, &
fftw_timelimit = -1.0_pReal, & ! sets the timelimit of plan creation for FFTW, see manual on www.fftw.org, Default -1.0: disable timelimit
rotation_tol = 1.0e-12_pReal ! tolerance of rotation specified in loadcase, Default 1.0e-12: first guess
character(len=64) :: fftw_plan_mode = 'FFTW_PATIENT', & ! reads the planing-rigor flag, see manual on www.fftw.org, Default FFTW_PATIENT: use patient planner flag
@ -238,6 +240,10 @@ subroutine numerics_init
err_stress_tolrel = IO_floatValue(line,positions,2_pInt)
case ('err_stress_tolabs')
err_stress_tolabs = IO_floatValue(line,positions,2_pInt)
case ('err_f_tol')
err_f_tol = IO_floatValue(line,positions,2_pInt)
case ('err_p_tol')
err_p_tol = IO_floatValue(line,positions,2_pInt)
case ('itmax')
itmax = IO_intValue(line,positions,2_pInt)
case ('itmin')
@ -342,6 +348,8 @@ subroutine numerics_init
write(6,'(a24,1x,es8.1)') ' err_div_tol: ',err_div_tol
write(6,'(a24,1x,es8.1)') ' err_stress_tolrel: ',err_stress_tolrel
write(6,'(a24,1x,es8.1)') ' err_stress_tolabs: ',err_stress_tolabs
write(6,'(a24,1x,es8.1)') ' err_f_tol: ',err_f_tol
write(6,'(a24,1x,es8.1)') ' err_p_tol: ',err_p_tol
write(6,'(a24,1x,i8)') ' itmax: ',itmax
write(6,'(a24,1x,i8)') ' itmin: ',itmin
write(6,'(a24,1x,L8)') ' memory_efficient: ',memory_efficient