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:
Christoph Kords 2009-06-18 14:28:02 +00:00
parent 904ea78ac5
commit ef8b672a00
7 changed files with 137 additions and 88 deletions

View File

@ -32,6 +32,10 @@
integer(pInt), dimension(1+2*maxNchunks) :: positions
character(len=1024) line
write(6,*)
write(6,*) '<<<+- FEsolving init -+>>>'
write(6,*)
if (IO_open_inputFile(fileunit)) then
rewind(fileunit)

View File

@ -26,6 +26,10 @@ subroutine debug_init()
nCryst
implicit none
write(6,*)
write(6,*) '<<<+- debug init -+>>>'
write(6,*)
allocate(debug_StressLoopDistribution(nStress)) ; debug_StressLoopDistribution = 0_pInt
allocate(debug_StateLoopDistribution(nState)) ; debug_StateLoopDistribution = 0_pInt
allocate(debug_StiffnessStateLoopDistribution(nState)) ; debug_StiffnessStateLoopDistribution = 0_pInt

View File

@ -592,6 +592,10 @@ subroutine lattice_init()
integer(pInt), parameter :: fileunit = 200
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
Nsections = IO_countSections(fileunit,material_partPhase)
lattice_Nstructure = 2_pInt + sum(IO_countTagInPart(fileunit,material_partPhase,'covera_ratio',Nsections)) ! fcc + bcc + all hex

View File

@ -73,6 +73,10 @@ subroutine material_init()
integer(pInt), parameter :: fileunit = 200
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
call material_parseHomogenization(fileunit,material_partHomogenization)
call material_parseMicrostructure(fileunit,material_partMicrostructure)

View File

@ -192,6 +192,10 @@
integer(pInt), parameter :: fileUnit = 222
integer(pInt) e
write(6,*)
write(6,*) '<<<+- mesh init -+>>>'
write(6,*)
mesh_Nelems = 0_pInt
mesh_NcpElems = 0_pInt
mesh_Nnodes = 0_pInt

View File

@ -1,18 +1,20 @@
relevantStrain 1.0e-7
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
### numerical parameters ###
resToler 1.0e-4
resAbsol 1.0e+2
resBound 1.0e+1
NRiterMax 24
relevantStrain 1.0e-7 # strain increment considered significant
iJacoStiffness 1 # frequency of stiffness update
iJacoLpresiduum 1 # frequency of Jacobian update of residuum in Lp
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

View File

@ -74,71 +74,105 @@ subroutine numerics_init()
! resBound
! NRiterMax
! initialize all values to zero
relevantStrain = 0.0_pReal
iJacoStiffness = 0_pInt
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
write(6,*)
write(6,*) '<<<+- numerics init -+>>>'
write(6,*)
! try to open the config file and call error if corrupt
if(.not. IO_open_file(fileunit,numerics_configFile)) call IO_error (100)
! initialize all parameters with standard values
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 = ''
! read variables from config file
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)
case ('ncryst')
nCryst = IO_intValue(line,positions,2)
case ('nstate')
nState = IO_intValue(line,positions,2)
case ('nstress')
nStress = IO_intValue(line,positions,2)
case ('substepmin')
subStepMin = IO_floatValue(line,positions,2)
case ('rtol_crystallitestate')
rTol_crystalliteState = IO_floatValue(line,positions,2)
case ('rtol_crystallitestress')
rTol_crystalliteStress = IO_floatValue(line,positions,2)
case ('atol_crystallitestress')
aTol_crystalliteStress = IO_floatValue(line,positions,2)
case ('restoler')
resToler = IO_floatValue(line,positions,2)
case ('resabsol')
resAbsol = IO_floatValue(line,positions,2)
case ('resbound')
resBound = IO_floatValue(line,positions,2)
case ('nritermax')
NRiterMax = IO_intValue(line,positions,2)
end select
enddo
! 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)
case ('ncryst')
nCryst = IO_intValue(line,positions,2)
case ('nstate')
nState = IO_intValue(line,positions,2)
case ('nstress')
nStress = IO_intValue(line,positions,2)
case ('substepmin')
subStepMin = IO_floatValue(line,positions,2)
case ('rtol_crystallitestate')
rTol_crystalliteState = IO_floatValue(line,positions,2)
case ('rtol_crystallitestress')
rTol_crystalliteStress = IO_floatValue(line,positions,2)
case ('atol_crystallitestress')
aTol_crystalliteStress = IO_floatValue(line,positions,2)
case ('restoler')
resToler = IO_floatValue(line,positions,2)
case ('resabsol')
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
if (relevantStrain <= 0.0_pReal) call IO_error(260)
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 (NRiterMax < 1_pInt) call IO_error(275)
close(fileunit)
write(6,*)
write(6,*) '<<<+- numerics init -+>>>'
write(6,*) '...done'
write(6,*)
endsubroutine
END MODULE numerics