2009-08-31 20:39:15 +05:30
|
|
|
!* $Id$
|
2009-06-15 18:41:21 +05:30
|
|
|
!##############################################################
|
|
|
|
MODULE numerics
|
|
|
|
!##############################################################
|
|
|
|
|
|
|
|
use prec, only: pInt, pReal
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
character(len=64), parameter :: numerics_configFile = 'numerics.config' ! name of configuration file
|
|
|
|
integer(pInt) iJacoStiffness, & ! frequency of stiffness update
|
|
|
|
iJacoLpresiduum, & ! frequency of Jacobian update of residuum in Lp
|
2009-10-26 22:13:43 +05:30
|
|
|
nHomog, & ! homogenization loop limit (only for debugging info, loop limit is determined by "subStepMinHomog")
|
2009-08-11 22:01:57 +05:30
|
|
|
nMPstate, & ! materialpoint state loop limit
|
2009-10-26 22:13:43 +05:30
|
|
|
nCryst, & ! crystallite loop limit (only for debugging info, loop limit is determined by "subStepMinCryst")
|
2009-06-15 18:41:21 +05:30
|
|
|
nState, & ! state loop limit
|
2009-07-31 17:32:20 +05:30
|
|
|
nStress ! stress loop limit
|
2009-06-15 18:41:21 +05:30
|
|
|
real(pReal) relevantStrain, & ! strain increment considered significant
|
|
|
|
pert_Fg, & ! strain perturbation for FEM Jacobi
|
2009-10-26 22:13:43 +05:30
|
|
|
subStepMinCryst, & ! minimum (relative) size of sub-step allowed during cutback in crystallite
|
|
|
|
subStepMinHomog, & ! minimum (relative) size of sub-step allowed during cutback in homogenization
|
2009-07-22 21:37:19 +05:30
|
|
|
rTol_crystalliteState, & ! relative tolerance in crystallite state loop
|
|
|
|
rTol_crystalliteTemperature, & ! relative tolerance in crystallite temperature loop
|
2009-06-15 18:41:21 +05:30
|
|
|
rTol_crystalliteStress, & ! relative tolerance in crystallite stress loop
|
|
|
|
aTol_crystalliteStress, & ! absolute tolerance in crystallite stress loop
|
2009-07-31 17:32:20 +05:30
|
|
|
|
|
|
|
!* RGC parameters: added <<<updated 31.07.2009>>>
|
|
|
|
absTol_RGC, & ! absolute tolerance of RGC residuum
|
|
|
|
relTol_RGC, & ! relative tolerance of RGC residuum
|
|
|
|
absMax_RGC, & ! absolute maximum of RGC residuum
|
|
|
|
relMax_RGC, & ! relative maximum of RGC residuum
|
|
|
|
pPert_RGC, & ! perturbation for computing RGC penalty tangent
|
|
|
|
xSmoo_RGC ! RGC penalty smoothing parameter (hyperbolic tangent)
|
2009-06-15 18:41:21 +05:30
|
|
|
|
2009-08-27 21:00:40 +05:30
|
|
|
!* Random seeding parameters: added <<<updated 27.08.2009>>>
|
|
|
|
integer(pInt) fixedSeed ! fixed seeding for pseudo-random number generator
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
CONTAINS
|
|
|
|
|
|
|
|
!*******************************************
|
|
|
|
! initialization subroutine
|
|
|
|
!*******************************************
|
|
|
|
subroutine numerics_init()
|
|
|
|
|
|
|
|
!*** variables and functions from other modules ***!
|
|
|
|
use prec, only: pInt, &
|
|
|
|
pReal
|
|
|
|
use IO, only: IO_error, &
|
|
|
|
IO_open_file, &
|
|
|
|
IO_isBlank, &
|
|
|
|
IO_stringPos, &
|
|
|
|
IO_stringValue, &
|
|
|
|
IO_lc, &
|
|
|
|
IO_floatValue, &
|
|
|
|
IO_intValue
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
!*** input variables ***!
|
|
|
|
|
|
|
|
!*** output variables ***!
|
|
|
|
|
|
|
|
!*** local variables ***!
|
|
|
|
integer(pInt), parameter :: fileunit = 300
|
|
|
|
integer(pInt), parameter :: maxNchunks = 2
|
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
|
|
|
character(len=64) tag
|
|
|
|
character(len=1024) line
|
|
|
|
|
2009-06-18 19:58:02 +05:30
|
|
|
write(6,*)
|
|
|
|
write(6,*) '<<<+- numerics init -+>>>'
|
2009-08-31 20:39:15 +05:30
|
|
|
write(6,*) '$Id$'
|
2009-06-18 19:58:02 +05:30
|
|
|
write(6,*)
|
|
|
|
|
|
|
|
! initialize all parameters with standard values
|
2009-07-31 17:32:20 +05:30
|
|
|
relevantStrain = 1.0e-7_pReal
|
|
|
|
iJacoStiffness = 1_pInt
|
|
|
|
iJacoLpresiduum = 1_pInt
|
|
|
|
pert_Fg = 1.0e-6_pReal
|
2009-08-11 22:01:57 +05:30
|
|
|
nHomog = 20_pInt
|
2009-10-26 22:13:43 +05:30
|
|
|
subStepMinHomog = 1.0e-3_pReal
|
2009-08-11 22:01:57 +05:30
|
|
|
nMPstate = 10_pInt
|
2009-07-31 17:32:20 +05:30
|
|
|
nCryst = 20_pInt
|
2009-10-26 22:13:43 +05:30
|
|
|
subStepMinCryst = 1.0e-3_pReal
|
2009-07-31 17:32:20 +05:30
|
|
|
nState = 10_pInt
|
|
|
|
nStress = 40_pInt
|
|
|
|
rTol_crystalliteState = 1.0e-6_pReal
|
2009-07-22 21:37:19 +05:30
|
|
|
rTol_crystalliteTemperature = 1.0e-6_pReal
|
2009-07-31 17:32:20 +05:30
|
|
|
rTol_crystalliteStress = 1.0e-6_pReal
|
2009-10-19 18:23:56 +05:30
|
|
|
aTol_crystalliteStress = 1.0e-8_pReal ! residuum is in Lp (hence strain on the order of 1e-8 here)
|
2009-07-31 17:32:20 +05:30
|
|
|
|
2009-10-30 15:24:52 +05:30
|
|
|
!* RGC parameters: added <<<updated 31.07.2009>>> with moderate setting
|
|
|
|
absTol_RGC = 1.0e+4
|
2009-07-31 17:32:20 +05:30
|
|
|
relTol_RGC = 1.0e-3
|
2009-10-30 15:24:52 +05:30
|
|
|
absMax_RGC = 1.0e+10
|
2009-07-31 17:32:20 +05:30
|
|
|
relMax_RGC = 1.0e+2
|
2009-10-30 15:24:52 +05:30
|
|
|
pPert_RGC = 1.0e-7
|
2009-07-31 17:32:20 +05:30
|
|
|
xSmoo_RGC = 1.0e-5
|
2009-06-15 18:41:21 +05:30
|
|
|
|
2009-08-27 21:00:40 +05:30
|
|
|
!* Random seeding parameters: added <<<updated 27.08.2009>>>
|
|
|
|
fixedSeed = 0_pInt
|
|
|
|
|
2009-06-18 19:58:02 +05:30
|
|
|
! try to open the config file
|
|
|
|
if(IO_open_file(fileunit,numerics_configFile)) then
|
|
|
|
|
|
|
|
write(6,*) ' ... using values from config file'
|
|
|
|
write(6,*)
|
|
|
|
|
|
|
|
line = ''
|
|
|
|
! read variables from config file and overwrite parameters
|
|
|
|
do
|
|
|
|
read(fileunit,'(a1024)',END=100) line
|
|
|
|
if (IO_isBlank(line)) cycle ! skip empty lines
|
|
|
|
positions = IO_stringPos(line,maxNchunks)
|
|
|
|
tag = IO_lc(IO_stringValue(line,positions,1)) ! extract key
|
|
|
|
select case(tag)
|
|
|
|
case ('relevantstrain')
|
|
|
|
relevantStrain = IO_floatValue(line,positions,2)
|
|
|
|
case ('ijacostiffness')
|
|
|
|
iJacoStiffness = IO_intValue(line,positions,2)
|
|
|
|
case ('ijacolpresiduum')
|
|
|
|
iJacoLpresiduum = IO_intValue(line,positions,2)
|
|
|
|
case ('pert_fg')
|
|
|
|
pert_Fg = IO_floatValue(line,positions,2)
|
|
|
|
case ('nhomog')
|
|
|
|
nHomog = IO_intValue(line,positions,2)
|
2009-08-11 22:01:57 +05:30
|
|
|
case ('nmpstate')
|
|
|
|
nMPstate = IO_intValue(line,positions,2)
|
2009-06-18 19:58:02 +05:30
|
|
|
case ('ncryst')
|
|
|
|
nCryst = IO_intValue(line,positions,2)
|
|
|
|
case ('nstate')
|
|
|
|
nState = IO_intValue(line,positions,2)
|
|
|
|
case ('nstress')
|
|
|
|
nStress = IO_intValue(line,positions,2)
|
2009-10-26 22:13:43 +05:30
|
|
|
case ('substepmincryst')
|
|
|
|
subStepMinCryst = IO_floatValue(line,positions,2)
|
|
|
|
case ('substepminhomog')
|
|
|
|
subStepMinHomog = IO_floatValue(line,positions,2)
|
2009-06-18 19:58:02 +05:30
|
|
|
case ('rtol_crystallitestate')
|
2009-07-22 21:37:19 +05:30
|
|
|
rTol_crystalliteState = IO_floatValue(line,positions,2)
|
|
|
|
case ('rtol_crystallitetemperature')
|
2009-07-01 16:25:31 +05:30
|
|
|
rTol_crystalliteTemperature = IO_floatValue(line,positions,2)
|
2009-06-18 19:58:02 +05:30
|
|
|
case ('rtol_crystallitestress')
|
|
|
|
rTol_crystalliteStress = IO_floatValue(line,positions,2)
|
|
|
|
case ('atol_crystallitestress')
|
|
|
|
aTol_crystalliteStress = IO_floatValue(line,positions,2)
|
2009-07-31 17:32:20 +05:30
|
|
|
|
|
|
|
!* RGC parameters: added <<<updated 31.07.2009>>>
|
|
|
|
case ('atol_rgc')
|
|
|
|
absTol_RGC = IO_floatValue(line,positions,2)
|
|
|
|
case ('rtol_rgc')
|
|
|
|
relTol_RGC = IO_floatValue(line,positions,2)
|
|
|
|
case ('amax_rgc')
|
|
|
|
absMax_RGC = IO_floatValue(line,positions,2)
|
|
|
|
case ('rmax_rgc')
|
|
|
|
relMax_RGC = IO_floatValue(line,positions,2)
|
|
|
|
case ('perturbpenalty_rgc')
|
|
|
|
pPert_RGC = IO_floatValue(line,positions,2)
|
|
|
|
case ('relevantmismatch_rgc')
|
|
|
|
xSmoo_RGC = IO_floatValue(line,positions,2)
|
|
|
|
|
2009-08-27 21:00:40 +05:30
|
|
|
!* Random seeding parameters: added <<<updated 27.08.2009>>>
|
|
|
|
case ('fixed_seed')
|
|
|
|
fixedSeed = IO_floatValue(line,positions,2)
|
2009-06-18 19:58:02 +05:30
|
|
|
endselect
|
|
|
|
enddo
|
|
|
|
100 close(fileunit)
|
|
|
|
|
|
|
|
! no config file, so we use standard values
|
|
|
|
else
|
|
|
|
|
|
|
|
write(6,*) ' ... using standard values'
|
|
|
|
write(6,*)
|
|
|
|
|
|
|
|
endif
|
2009-06-15 18:41:21 +05:30
|
|
|
|
2009-06-18 19:58:02 +05:30
|
|
|
! writing parameters to output file
|
|
|
|
write(6,'(a24,x,e8.1)') 'relevantStrain: ',relevantStrain
|
|
|
|
write(6,'(a24,x,i8)') 'iJacoStiffness: ',iJacoStiffness
|
|
|
|
write(6,'(a24,x,i8)') 'iJacoLpresiduum: ',iJacoLpresiduum
|
|
|
|
write(6,'(a24,x,e8.1)') 'pert_Fg: ',pert_Fg
|
|
|
|
write(6,'(a24,x,i8)') 'nHomog: ',nHomog
|
2009-10-26 22:13:43 +05:30
|
|
|
write(6,'(a24,x,e8.1)') 'subStepMinHomog: ',subStepMinHomog
|
2009-08-11 22:01:57 +05:30
|
|
|
write(6,'(a24,x,i8)') 'nMPstate: ',nMPstate
|
2009-06-18 19:58:02 +05:30
|
|
|
write(6,'(a24,x,i8)') 'nCryst: ',nCryst
|
2009-10-26 22:13:43 +05:30
|
|
|
write(6,'(a24,x,e8.1)') 'subStepMinCryst: ',subStepMinCryst
|
2009-06-18 19:58:02 +05:30
|
|
|
write(6,'(a24,x,i8)') 'nState: ',nState
|
|
|
|
write(6,'(a24,x,i8)') 'nStress: ',nStress
|
2009-07-22 21:37:19 +05:30
|
|
|
write(6,'(a24,x,e8.1)') 'rTol_crystalliteState: ',rTol_crystalliteState
|
2009-07-01 16:25:31 +05:30
|
|
|
write(6,'(a24,x,e8.1)') 'rTol_crystalliteTemp: ',rTol_crystalliteTemperature
|
2009-06-18 19:58:02 +05:30
|
|
|
write(6,'(a24,x,e8.1)') 'rTol_crystalliteStress: ',rTol_crystalliteStress
|
|
|
|
write(6,'(a24,x,e8.1)') 'aTol_crystalliteStress: ',aTol_crystalliteStress
|
2009-07-31 17:32:20 +05:30
|
|
|
|
|
|
|
!* RGC parameters: added <<<updated 31.07.2009>>>
|
|
|
|
write(6,'(a24,x,e8.1)') 'aTol_RGC: ',absTol_RGC
|
|
|
|
write(6,'(a24,x,e8.1)') 'rTol_RGC: ',relTol_RGC
|
|
|
|
write(6,'(a24,x,e8.1)') 'aMax_RGC: ',absMax_RGC
|
|
|
|
write(6,'(a24,x,e8.1)') 'rMax_RGC: ',relMax_RGC
|
|
|
|
write(6,'(a24,x,e8.1)') 'perturbPenalty_RGC: ',pPert_RGC
|
|
|
|
write(6,'(a24,x,e8.1)') 'relevantMismatch_RGC: ',xSmoo_RGC
|
2009-08-27 21:00:40 +05:30
|
|
|
|
|
|
|
!* Random seeding parameters: added <<<updated 27.08.2009>>>
|
|
|
|
write(6,'(a24,x,i8)') 'fixed_seed: ',fixedSeed
|
2009-06-18 19:58:02 +05:30
|
|
|
write(6,*)
|
|
|
|
|
2009-07-31 17:32:20 +05:30
|
|
|
! sanity check
|
|
|
|
if (relevantStrain <= 0.0_pReal) call IO_error(260)
|
|
|
|
if (iJacoStiffness < 1_pInt) call IO_error(261)
|
|
|
|
if (iJacoLpresiduum < 1_pInt) call IO_error(262)
|
|
|
|
if (pert_Fg <= 0.0_pReal) call IO_error(263)
|
|
|
|
if (nHomog < 1_pInt) call IO_error(264)
|
2009-08-11 22:01:57 +05:30
|
|
|
if (nMPstate < 1_pInt) call IO_error(279) !! missing in IO !!
|
2009-07-31 17:32:20 +05:30
|
|
|
if (nCryst < 1_pInt) call IO_error(265)
|
|
|
|
if (nState < 1_pInt) call IO_error(266)
|
|
|
|
if (nStress < 1_pInt) call IO_error(267)
|
2009-10-26 22:13:43 +05:30
|
|
|
if (subStepMinCryst <= 0.0_pReal) call IO_error(268)
|
|
|
|
if (subStepMinHomog <= 0.0_pReal) call IO_error(268)
|
2009-07-31 17:32:20 +05:30
|
|
|
if (rTol_crystalliteState <= 0.0_pReal) call IO_error(269)
|
2009-08-11 22:01:57 +05:30
|
|
|
if (rTol_crystalliteTemperature <= 0.0_pReal) call IO_error(276) !! oops !!
|
2009-07-31 17:32:20 +05:30
|
|
|
if (rTol_crystalliteStress <= 0.0_pReal) call IO_error(270)
|
|
|
|
if (aTol_crystalliteStress <= 0.0_pReal) call IO_error(271)
|
|
|
|
|
|
|
|
!* RGC parameters: added <<<updated 31.07.2009>>>
|
|
|
|
if (absTol_RGC <= 0.0_pReal) call IO_error(272)
|
|
|
|
if (relTol_RGC <= 0.0_pReal) call IO_error(273)
|
|
|
|
if (absMax_RGC <= 0.0_pReal) call IO_error(274)
|
|
|
|
if (relMax_RGC <= 0.0_pReal) call IO_error(275)
|
2009-08-11 22:01:57 +05:30
|
|
|
if (pPert_RGC <= 0.0_pReal) call IO_error(276) !! oops !!
|
2009-07-31 17:32:20 +05:30
|
|
|
if (xSmoo_RGC <= 0.0_pReal) call IO_error(277)
|
2009-06-15 18:41:21 +05:30
|
|
|
|
2009-08-27 21:00:40 +05:30
|
|
|
if (fixedSeed <= 0_pInt) write(6,'(a)') 'Random is random!'
|
2009-06-15 18:41:21 +05:30
|
|
|
endsubroutine
|
|
|
|
|
2009-07-31 17:32:20 +05:30
|
|
|
END MODULE numerics
|