numerics.config is now optional; if this file does not exist in the working directory, standard values from numerics.f90 are used; either way the output file tells which values were taken.
added some output to the init subroutines of debug.f90, FEsolving.f90, lattice.f90, material.f90 and mesh.f90.
This commit is contained in:
parent
904ea78ac5
commit
ef8b672a00
|
@ -32,6 +32,10 @@
|
||||||
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
||||||
character(len=1024) line
|
character(len=1024) line
|
||||||
|
|
||||||
|
write(6,*)
|
||||||
|
write(6,*) '<<<+- FEsolving init -+>>>'
|
||||||
|
write(6,*)
|
||||||
|
|
||||||
if (IO_open_inputFile(fileunit)) then
|
if (IO_open_inputFile(fileunit)) then
|
||||||
|
|
||||||
rewind(fileunit)
|
rewind(fileunit)
|
||||||
|
|
|
@ -26,6 +26,10 @@ subroutine debug_init()
|
||||||
nCryst
|
nCryst
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
write(6,*)
|
||||||
|
write(6,*) '<<<+- debug init -+>>>'
|
||||||
|
write(6,*)
|
||||||
|
|
||||||
allocate(debug_StressLoopDistribution(nStress)) ; debug_StressLoopDistribution = 0_pInt
|
allocate(debug_StressLoopDistribution(nStress)) ; debug_StressLoopDistribution = 0_pInt
|
||||||
allocate(debug_StateLoopDistribution(nState)) ; debug_StateLoopDistribution = 0_pInt
|
allocate(debug_StateLoopDistribution(nState)) ; debug_StateLoopDistribution = 0_pInt
|
||||||
allocate(debug_StiffnessStateLoopDistribution(nState)) ; debug_StiffnessStateLoopDistribution = 0_pInt
|
allocate(debug_StiffnessStateLoopDistribution(nState)) ; debug_StiffnessStateLoopDistribution = 0_pInt
|
||||||
|
|
|
@ -592,6 +592,10 @@ subroutine lattice_init()
|
||||||
integer(pInt), parameter :: fileunit = 200
|
integer(pInt), parameter :: fileunit = 200
|
||||||
integer(pInt) i,Nsections
|
integer(pInt) i,Nsections
|
||||||
|
|
||||||
|
write(6,*)
|
||||||
|
write(6,*) '<<<+- lattice init -+>>>'
|
||||||
|
write(6,*)
|
||||||
|
|
||||||
if(.not. IO_open_file(fileunit,material_configFile)) call IO_error (100) ! corrupt config file
|
if(.not. IO_open_file(fileunit,material_configFile)) call IO_error (100) ! corrupt config file
|
||||||
Nsections = IO_countSections(fileunit,material_partPhase)
|
Nsections = IO_countSections(fileunit,material_partPhase)
|
||||||
lattice_Nstructure = 2_pInt + sum(IO_countTagInPart(fileunit,material_partPhase,'covera_ratio',Nsections)) ! fcc + bcc + all hex
|
lattice_Nstructure = 2_pInt + sum(IO_countTagInPart(fileunit,material_partPhase,'covera_ratio',Nsections)) ! fcc + bcc + all hex
|
||||||
|
|
|
@ -73,6 +73,10 @@ subroutine material_init()
|
||||||
integer(pInt), parameter :: fileunit = 200
|
integer(pInt), parameter :: fileunit = 200
|
||||||
integer(pInt) i
|
integer(pInt) i
|
||||||
|
|
||||||
|
write(6,*)
|
||||||
|
write(6,*) '<<<+- material init -+>>>'
|
||||||
|
write(6,*)
|
||||||
|
|
||||||
if(.not. IO_open_file(fileunit,material_configFile)) call IO_error (100) ! corrupt config file
|
if(.not. IO_open_file(fileunit,material_configFile)) call IO_error (100) ! corrupt config file
|
||||||
call material_parseHomogenization(fileunit,material_partHomogenization)
|
call material_parseHomogenization(fileunit,material_partHomogenization)
|
||||||
call material_parseMicrostructure(fileunit,material_partMicrostructure)
|
call material_parseMicrostructure(fileunit,material_partMicrostructure)
|
||||||
|
|
|
@ -192,6 +192,10 @@
|
||||||
integer(pInt), parameter :: fileUnit = 222
|
integer(pInt), parameter :: fileUnit = 222
|
||||||
integer(pInt) e
|
integer(pInt) e
|
||||||
|
|
||||||
|
write(6,*)
|
||||||
|
write(6,*) '<<<+- mesh init -+>>>'
|
||||||
|
write(6,*)
|
||||||
|
|
||||||
mesh_Nelems = 0_pInt
|
mesh_Nelems = 0_pInt
|
||||||
mesh_NcpElems = 0_pInt
|
mesh_NcpElems = 0_pInt
|
||||||
mesh_Nnodes = 0_pInt
|
mesh_Nnodes = 0_pInt
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
|
|
||||||
relevantStrain 1.0e-7
|
### numerical parameters ###
|
||||||
iJacoStiffness 1
|
|
||||||
iJacoLpresiduum 1
|
|
||||||
pert_Fg 1.0e-6
|
|
||||||
nHomog 10
|
|
||||||
nCryst 20
|
|
||||||
nState 10
|
|
||||||
nStress 40
|
|
||||||
subStepMin 1.0e-3
|
|
||||||
rTol_crystalliteState 1.0e-6
|
|
||||||
rTol_crystalliteStress 1.0e-6
|
|
||||||
aTol_crystalliteStress 1.0e-8
|
|
||||||
|
|
||||||
resToler 1.0e-4
|
relevantStrain 1.0e-7 # strain increment considered significant
|
||||||
resAbsol 1.0e+2
|
iJacoStiffness 1 # frequency of stiffness update
|
||||||
resBound 1.0e+1
|
iJacoLpresiduum 1 # frequency of Jacobian update of residuum in Lp
|
||||||
NRiterMax 24
|
pert_Fg 1.0e-6 # strain perturbation for FEM Jacobi
|
||||||
|
nHomog 10 # homogenization loop limit
|
||||||
|
nCryst 20 # crystallite loop limit (only for debugging info, real loop limit is "subStepMin")
|
||||||
|
nState 10 # state loop limit
|
||||||
|
nStress 40 # stress loop limit
|
||||||
|
subStepMin 1.0e-3 # minimum (relative) size of sub-step allowed during cutback in crystallite
|
||||||
|
rTol_crystalliteState 1.0e-6 # relative tolerance in crystallite state loop
|
||||||
|
rTol_crystalliteStress 1.0e-6 # relative tolerance in crystallite stress loop
|
||||||
|
aTol_crystalliteStress 1.0e-8 # absolute tolerance in crystallite stress loop
|
||||||
|
|
||||||
|
resToler 1.0e-4 # relative tolerance of residual in GIA iteration
|
||||||
|
resAbsol 1.0e+2 # absolute tolerance of residual in GIA iteration (corresponds to ~1 Pa)
|
||||||
|
resBound 1.0e+1 # relative maximum value (upper bound) for GIA residual
|
||||||
|
NRiterMax 24 # maximum number of GIA iteration
|
|
@ -74,71 +74,105 @@ subroutine numerics_init()
|
||||||
! resBound
|
! resBound
|
||||||
! NRiterMax
|
! NRiterMax
|
||||||
|
|
||||||
! initialize all values to zero
|
write(6,*)
|
||||||
relevantStrain = 0.0_pReal
|
write(6,*) '<<<+- numerics init -+>>>'
|
||||||
iJacoStiffness = 0_pInt
|
write(6,*)
|
||||||
iJacoLpresiduum = 0_pInt
|
|
||||||
pert_Fg = 0.0_pReal
|
|
||||||
nHomog = 0_pInt
|
|
||||||
nCryst = 0_pInt
|
|
||||||
nState = 0_pInt
|
|
||||||
nStress = 0_pInt
|
|
||||||
subStepMin = 0.0_pReal
|
|
||||||
rTol_crystalliteState = 0.0_pReal
|
|
||||||
rTol_crystalliteStress = 0.0_pReal
|
|
||||||
aTol_crystalliteStress = 0.0_pReal
|
|
||||||
resToler = 0.0_pReal
|
|
||||||
resAbsol = 0.0_pReal
|
|
||||||
resBound = 0.0_pReal
|
|
||||||
NRiterMax = 0_pInt
|
|
||||||
|
|
||||||
! try to open the config file and call error if corrupt
|
! initialize all parameters with standard values
|
||||||
if(.not. IO_open_file(fileunit,numerics_configFile)) call IO_error (100)
|
relevantStrain = 1.0e-7_pReal
|
||||||
|
iJacoStiffness = 1_pInt
|
||||||
|
iJacoLpresiduum = 1_pInt
|
||||||
|
pert_Fg = 1.0e-6_pReal
|
||||||
|
nHomog = 10_pInt
|
||||||
|
nCryst = 20_pInt
|
||||||
|
nState = 10_pInt
|
||||||
|
nStress = 40_pInt
|
||||||
|
subStepMin = 1.0e-3_pReal
|
||||||
|
rTol_crystalliteState = 1.0e-6_pReal
|
||||||
|
rTol_crystalliteStress = 1.0e-6_pReal
|
||||||
|
aTol_crystalliteStress = 1.0e-8_pReal
|
||||||
|
resToler = 1.0e-4_pReal
|
||||||
|
resAbsol = 1.0e+2_pReal
|
||||||
|
resBound = 1.0e+1_pReal
|
||||||
|
NRiterMax = 24_pInt
|
||||||
|
|
||||||
line = ''
|
! try to open the config file
|
||||||
! read variables from config file
|
if(IO_open_file(fileunit,numerics_configFile)) then
|
||||||
do
|
|
||||||
read(fileunit,'(a1024)',END=100) line
|
write(6,*) ' ... using values from config file'
|
||||||
if (IO_isBlank(line)) cycle ! skip empty lines
|
write(6,*)
|
||||||
positions = IO_stringPos(line,maxNchunks)
|
|
||||||
tag = IO_lc(IO_stringValue(line,positions,1)) ! extract key
|
line = ''
|
||||||
select case(tag)
|
! read variables from config file and overwrite parameters
|
||||||
case ('relevantstrain')
|
do
|
||||||
relevantStrain = IO_floatValue(line,positions,2)
|
read(fileunit,'(a1024)',END=100) line
|
||||||
case ('ijacostiffness')
|
if (IO_isBlank(line)) cycle ! skip empty lines
|
||||||
iJacoStiffness = IO_intValue(line,positions,2)
|
positions = IO_stringPos(line,maxNchunks)
|
||||||
case ('ijacolpresiduum')
|
tag = IO_lc(IO_stringValue(line,positions,1)) ! extract key
|
||||||
iJacoLpresiduum = IO_intValue(line,positions,2)
|
select case(tag)
|
||||||
case ('pert_fg')
|
case ('relevantstrain')
|
||||||
pert_Fg = IO_floatValue(line,positions,2)
|
relevantStrain = IO_floatValue(line,positions,2)
|
||||||
case ('nhomog')
|
case ('ijacostiffness')
|
||||||
nHomog = IO_intValue(line,positions,2)
|
iJacoStiffness = IO_intValue(line,positions,2)
|
||||||
case ('ncryst')
|
case ('ijacolpresiduum')
|
||||||
nCryst = IO_intValue(line,positions,2)
|
iJacoLpresiduum = IO_intValue(line,positions,2)
|
||||||
case ('nstate')
|
case ('pert_fg')
|
||||||
nState = IO_intValue(line,positions,2)
|
pert_Fg = IO_floatValue(line,positions,2)
|
||||||
case ('nstress')
|
case ('nhomog')
|
||||||
nStress = IO_intValue(line,positions,2)
|
nHomog = IO_intValue(line,positions,2)
|
||||||
case ('substepmin')
|
case ('ncryst')
|
||||||
subStepMin = IO_floatValue(line,positions,2)
|
nCryst = IO_intValue(line,positions,2)
|
||||||
case ('rtol_crystallitestate')
|
case ('nstate')
|
||||||
rTol_crystalliteState = IO_floatValue(line,positions,2)
|
nState = IO_intValue(line,positions,2)
|
||||||
case ('rtol_crystallitestress')
|
case ('nstress')
|
||||||
rTol_crystalliteStress = IO_floatValue(line,positions,2)
|
nStress = IO_intValue(line,positions,2)
|
||||||
case ('atol_crystallitestress')
|
case ('substepmin')
|
||||||
aTol_crystalliteStress = IO_floatValue(line,positions,2)
|
subStepMin = IO_floatValue(line,positions,2)
|
||||||
case ('restoler')
|
case ('rtol_crystallitestate')
|
||||||
resToler = IO_floatValue(line,positions,2)
|
rTol_crystalliteState = IO_floatValue(line,positions,2)
|
||||||
case ('resabsol')
|
case ('rtol_crystallitestress')
|
||||||
resAbsol = IO_floatValue(line,positions,2)
|
rTol_crystalliteStress = IO_floatValue(line,positions,2)
|
||||||
case ('resbound')
|
case ('atol_crystallitestress')
|
||||||
resBound = IO_floatValue(line,positions,2)
|
aTol_crystalliteStress = IO_floatValue(line,positions,2)
|
||||||
case ('nritermax')
|
case ('restoler')
|
||||||
NRiterMax = IO_intValue(line,positions,2)
|
resToler = IO_floatValue(line,positions,2)
|
||||||
end select
|
case ('resabsol')
|
||||||
enddo
|
resAbsol = IO_floatValue(line,positions,2)
|
||||||
|
case ('resbound')
|
||||||
|
resBound = IO_floatValue(line,positions,2)
|
||||||
|
case ('nritermax')
|
||||||
|
NRiterMax = IO_intValue(line,positions,2)
|
||||||
|
endselect
|
||||||
|
enddo
|
||||||
|
100 close(fileunit)
|
||||||
|
|
||||||
|
! no config file, so we use standard values
|
||||||
|
else
|
||||||
|
|
||||||
|
write(6,*) ' ... using standard values'
|
||||||
|
write(6,*)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
! 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
|
||||||
|
write(6,'(a24,x,i8)') 'nCryst: ',nCryst
|
||||||
|
write(6,'(a24,x,i8)') 'nState: ',nState
|
||||||
|
write(6,'(a24,x,i8)') 'nStress: ',nStress
|
||||||
|
write(6,'(a24,x,e8.1)') 'subStepMin: ',subStepMin
|
||||||
|
write(6,'(a24,x,e8.1)') 'rTol_crystalliteState: ',rTol_crystalliteState
|
||||||
|
write(6,'(a24,x,e8.1)') 'rTol_crystalliteStress: ',rTol_crystalliteStress
|
||||||
|
write(6,'(a24,x,e8.1)') 'aTol_crystalliteStress: ',aTol_crystalliteStress
|
||||||
|
write(6,'(a24,x,e8.1)') 'resToler: ',resToler
|
||||||
|
write(6,'(a24,x,e8.1)') 'resAbsol: ',resAbsol
|
||||||
|
write(6,'(a24,x,e8.1)') 'resBound: ',resBound
|
||||||
|
write(6,'(a24,x,i8)') 'NRiterMax: ',NRiterMax
|
||||||
|
write(6,*)
|
||||||
|
|
||||||
100 write(6,*)
|
|
||||||
! sanity check
|
! sanity check
|
||||||
if (relevantStrain <= 0.0_pReal) call IO_error(260)
|
if (relevantStrain <= 0.0_pReal) call IO_error(260)
|
||||||
if (iJacoStiffness < 1_pInt) call IO_error(261)
|
if (iJacoStiffness < 1_pInt) call IO_error(261)
|
||||||
|
@ -157,13 +191,6 @@ subroutine numerics_init()
|
||||||
if (resBound <= 0.0_pReal) call IO_error(274)
|
if (resBound <= 0.0_pReal) call IO_error(274)
|
||||||
if (NRiterMax < 1_pInt) call IO_error(275)
|
if (NRiterMax < 1_pInt) call IO_error(275)
|
||||||
|
|
||||||
close(fileunit)
|
|
||||||
|
|
||||||
write(6,*)
|
|
||||||
write(6,*) '<<<+- numerics init -+>>>'
|
|
||||||
write(6,*) '...done'
|
|
||||||
write(6,*)
|
|
||||||
|
|
||||||
endsubroutine
|
endsubroutine
|
||||||
|
|
||||||
END MODULE numerics
|
END MODULE numerics
|
Loading…
Reference in New Issue