consistent naming

This commit is contained in:
Martin Diehl 2018-06-26 20:54:54 +02:00
parent ea80e04ea8
commit fc83a76318
5 changed files with 228 additions and 228 deletions

View File

@ -42,11 +42,11 @@ module config
type(tPartitionedStringList), public :: emptyList
type(tPartitionedStringList), public, protected, allocatable, dimension(:) :: & ! QUESTION: rename to config_XXX?
phaseConfig, &
microstructureConfig, &
homogenizationConfig, &
textureConfig, &
crystalliteConfig
config_phase, &
config_microstructure, &
config_homogenization, &
config_texture, &
config_crystallite
character(len=64), dimension(:), allocatable, public, protected :: &
phase_name, & !< name of each phase
@ -64,7 +64,7 @@ module config
character(len=*), parameter, private :: &
MATERIAL_partTexture = 'texture' !< keyword for texture part
! ToDo: Remove, use size(phaseConfig) etc
! ToDo: Remove, use size(config_phase) etc
integer(pInt), public, protected :: &
material_Nphase, & !< number of phases
material_Nhomogenization, & !< number of homogenizations
@ -131,23 +131,23 @@ subroutine config_init()
select case (trim(part))
case (trim(material_partPhase))
call parseFile(line,phase_name,phaseConfig,FILEUNIT)
call parseFile(line,phase_name,config_phase,FILEUNIT)
if (iand(myDebug,debug_levelBasic) /= 0_pInt) write(6,'(a)') ' Phase parsed'; flush(6)
case (trim(material_partMicrostructure))
call parseFile(line,microstructure_name,microstructureConfig,FILEUNIT)
call parseFile(line,microstructure_name,config_microstructure,FILEUNIT)
if (iand(myDebug,debug_levelBasic) /= 0_pInt) write(6,'(a)') ' Microstructure parsed'; flush(6)
case (trim(material_partCrystallite))
call parseFile(line,crystallite_name,crystalliteConfig,FILEUNIT)
call parseFile(line,crystallite_name,config_crystallite,FILEUNIT)
if (iand(myDebug,debug_levelBasic) /= 0_pInt) write(6,'(a)') ' Crystallite parsed'; flush(6)
case (trim(material_partHomogenization))
call parseFile(line,homogenization_name,homogenizationConfig,FILEUNIT)
call parseFile(line,homogenization_name,config_homogenization,FILEUNIT)
if (iand(myDebug,debug_levelBasic) /= 0_pInt) write(6,'(a)') ' Homogenization parsed'; flush(6)
case (trim(material_partTexture))
call parseFile(line,texture_name,textureConfig,FILEUNIT)
call parseFile(line,texture_name,config_texture,FILEUNIT)
if (iand(myDebug,debug_levelBasic) /= 0_pInt) write(6,'(a)') ' Texture parsed'; flush(6)
case default
@ -157,15 +157,15 @@ subroutine config_init()
enddo
material_Nhomogenization = size(homogenizationConfig)
material_Nhomogenization = size(config_homogenization)
if (material_Nhomogenization < 1_pInt) call IO_error(160_pInt,ext_msg=material_partHomogenization)
material_Nmicrostructure = size(microstructureConfig)
material_Nmicrostructure = size(config_microstructure)
if (material_Nmicrostructure < 1_pInt) call IO_error(160_pInt,ext_msg=material_partMicrostructure)
material_Ncrystallite = size(crystalliteConfig)
material_Ncrystallite = size(config_crystallite)
if (material_Ncrystallite < 1_pInt) call IO_error(160_pInt,ext_msg=material_partCrystallite)
material_Nphase = size(phaseConfig)
material_Nphase = size(config_phase)
if (material_Nphase < 1_pInt) call IO_error(160_pInt,ext_msg=material_partPhase)
if (size(textureConfig) < 1_pInt) call IO_error(160_pInt,ext_msg=material_partTexture)
if (size(config_texture) < 1_pInt) call IO_error(160_pInt,ext_msg=material_partTexture)
end subroutine config_init
@ -247,34 +247,34 @@ subroutine config_deallocate(what)
select case(what)
case('material.config/phase')
do i=1, size(phaseConfig)
call phaseConfig(i)%free
do i=1, size(config_phase)
call config_phase(i)%free
enddo
deallocate(phaseConfig)
deallocate(config_phase)
case('material.config/microstructure')
do i=1, size(microstructureConfig)
call microstructureConfig(i)%free
do i=1, size(config_microstructure)
call config_microstructure(i)%free
enddo
deallocate(microstructureConfig)
deallocate(config_microstructure)
case('material.config/crystallite')
do i=1, size(crystalliteConfig)
call crystalliteConfig(i)%free
do i=1, size(config_crystallite)
call config_crystallite(i)%free
enddo
deallocate(crystalliteConfig)
deallocate(config_crystallite)
case('material.config/homogenization')
do i=1, size(homogenizationConfig)
call homogenizationConfig(i)%free
do i=1, size(config_homogenization)
call config_homogenization(i)%free
enddo
deallocate(homogenizationConfig)
deallocate(config_homogenization)
case('material.config/texture')
do i=1, size(textureConfig)
call textureConfig(i)%free
do i=1, size(config_texture)
call config_texture(i)%free
enddo
deallocate(textureConfig)
deallocate(config_texture)
case default
call IO_error(0_pInt,ext_msg='config_deallocate')

View File

@ -172,7 +172,7 @@ subroutine crystallite_init
IO_error
use material
use config, only: &
crystalliteConfig, &
config_crystallite, &
crystallite_name, &
config_deallocate
use constitutive, only: &
@ -262,21 +262,21 @@ subroutine crystallite_init
allocate(crystallite_clearToCutback(iMax,eMax), source=.true.)
allocate(crystallite_neighborEnforcedCutback(iMax,eMax), source=.false.)
allocate(crystallite_output(maxval(crystallite_Noutput), &
size(crystalliteConfig))) ; crystallite_output = ''
size(config_crystallite))) ; crystallite_output = ''
allocate(crystallite_outputID(maxval(crystallite_Noutput), &
size(crystalliteConfig)), source=undefined_ID)
allocate(crystallite_sizePostResults(size(crystalliteConfig)),source=0_pInt)
size(config_crystallite)), source=undefined_ID)
allocate(crystallite_sizePostResults(size(config_crystallite)),source=0_pInt)
allocate(crystallite_sizePostResult(maxval(crystallite_Noutput), &
size(crystalliteConfig)), source=0_pInt)
size(config_crystallite)), source=0_pInt)
do c = 1_pInt, size(crystalliteConfig)
do c = 1_pInt, size(config_crystallite)
#if defined(__GFORTRAN__)
str = ['GfortranBug86277']
str = crystalliteConfig(c)%getStrings('(output)',defaultVal=str)
str = config_crystallite(c)%getStrings('(output)',defaultVal=str)
if (str(1) == 'GfortranBug86277') str = [character(len=65536)::]
#else
str = crystalliteConfig(c)%getStrings('(output)',defaultVal=[character(len=65536)::])
str = config_crystallite(c)%getStrings('(output)',defaultVal=[character(len=65536)::])
#endif
do o = 1_pInt, size(str)
crystallite_output(o,c) = str(o)
@ -332,7 +332,7 @@ subroutine crystallite_init
enddo
do r = 1_pInt,size(crystalliteConfig)
do r = 1_pInt,size(config_crystallite)
do o = 1_pInt,crystallite_Noutput(r)
select case(crystallite_outputID(o,r))
case(phase_ID,texture_ID,volume_ID,grainrotationx_ID,grainrotationy_ID,grainrotationz_ID)
@ -364,7 +364,7 @@ subroutine crystallite_init
if (worldrank == 0_pInt) then
call IO_write_jobFile(FILEUNIT,'outputCrystallite')
do r = 1_pInt,size(crystalliteConfig)
do r = 1_pInt,size(config_crystallite)
if (any(microstructure_crystallite(mesh_element(4,:)) == r)) then
write(FILEUNIT,'(/,a,/)') '['//trim(crystallite_name(r))//']'
do o = 1_pInt,crystallite_Noutput(r)

View File

@ -104,7 +104,7 @@ subroutine homogenization_init
config_deallocate, &
material_configFile, &
material_localFileExt, &
homogenizationConfig, &
config_homogenization, &
homogenization_name
use material
use homogenization_none
@ -202,7 +202,7 @@ subroutine homogenization_init
! write description file for homogenization output
mainProcess2: if (worldrank == 0) then
call IO_write_jobFile(FILEUNIT,'outputHomogenization')
do p = 1,size(homogenizationConfig)
do p = 1,size(config_homogenization)
if (any(material_homog == p)) then
i = homogenization_typeInstance(p) ! which instance of this homogenization type
valid = .true. ! assume valid
@ -402,7 +402,7 @@ subroutine homogenization_init
vacancyflux_maxSizePostResults = 0_pInt
porosity_maxSizePostResults = 0_pInt
hydrogenflux_maxSizePostResults = 0_pInt
do p = 1,size(homogenizationConfig)
do p = 1,size(config_homogenization)
homogenization_maxSizePostResults = max(homogenization_maxSizePostResults,homogState (p)%sizePostResults)
thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState (p)%sizePostResults)
damage_maxSizePostResults = max(damage_maxSizePostResults ,damageState (p)%sizePostResults)

View File

@ -352,11 +352,11 @@ subroutine material_init()
debug_levelBasic, &
debug_levelExtensive
use config, only: &
crystalliteConfig, &
homogenizationConfig, &
microstructureConfig, &
phaseConfig, &
textureConfig, &
config_crystallite, &
config_homogenization, &
config_microstructure, &
config_phase, &
config_texture, &
homogenization_name, &
microstructure_name, &
phase_name, &
@ -402,44 +402,44 @@ subroutine material_init()
call material_parseTexture()
if (iand(myDebug,debug_levelBasic) /= 0_pInt) write(6,'(a)') ' Texture parsed'; flush(6)
allocate(plasticState (size(phaseConfig)))
allocate(sourceState (size(phaseConfig)))
do myPhase = 1,size(phaseConfig)
allocate(plasticState (size(config_phase)))
allocate(sourceState (size(config_phase)))
do myPhase = 1,size(config_phase)
allocate(sourceState(myPhase)%p(phase_Nsources(myPhase)))
enddo
allocate(homogState (size(homogenizationConfig)))
allocate(thermalState (size(homogenizationConfig)))
allocate(damageState (size(homogenizationConfig)))
allocate(vacancyfluxState (size(homogenizationConfig)))
allocate(porosityState (size(homogenizationConfig)))
allocate(hydrogenfluxState (size(homogenizationConfig)))
allocate(homogState (size(config_homogenization)))
allocate(thermalState (size(config_homogenization)))
allocate(damageState (size(config_homogenization)))
allocate(vacancyfluxState (size(config_homogenization)))
allocate(porosityState (size(config_homogenization)))
allocate(hydrogenfluxState (size(config_homogenization)))
allocate(thermalMapping (size(homogenizationConfig)))
allocate(damageMapping (size(homogenizationConfig)))
allocate(vacancyfluxMapping (size(homogenizationConfig)))
allocate(porosityMapping (size(homogenizationConfig)))
allocate(hydrogenfluxMapping(size(homogenizationConfig)))
allocate(thermalMapping (size(config_homogenization)))
allocate(damageMapping (size(config_homogenization)))
allocate(vacancyfluxMapping (size(config_homogenization)))
allocate(porosityMapping (size(config_homogenization)))
allocate(hydrogenfluxMapping(size(config_homogenization)))
allocate(temperature (size(homogenizationConfig)))
allocate(damage (size(homogenizationConfig)))
allocate(vacancyConc (size(homogenizationConfig)))
allocate(porosity (size(homogenizationConfig)))
allocate(hydrogenConc (size(homogenizationConfig)))
allocate(temperature (size(config_homogenization)))
allocate(damage (size(config_homogenization)))
allocate(vacancyConc (size(config_homogenization)))
allocate(porosity (size(config_homogenization)))
allocate(hydrogenConc (size(config_homogenization)))
allocate(temperatureRate (size(homogenizationConfig)))
allocate(vacancyConcRate (size(homogenizationConfig)))
allocate(hydrogenConcRate (size(homogenizationConfig)))
allocate(temperatureRate (size(config_homogenization)))
allocate(vacancyConcRate (size(config_homogenization)))
allocate(hydrogenConcRate (size(config_homogenization)))
do m = 1_pInt,size(microstructureConfig)
do m = 1_pInt,size(config_microstructure)
if(microstructure_crystallite(m) < 1_pInt .or. &
microstructure_crystallite(m) > size(crystalliteConfig)) &
microstructure_crystallite(m) > size(config_crystallite)) &
call IO_error(150_pInt,m,ext_msg='crystallite')
if(minval(microstructure_phase(1:microstructure_Nconstituents(m),m)) < 1_pInt .or. &
maxval(microstructure_phase(1:microstructure_Nconstituents(m),m)) > size(phaseConfig)) &
maxval(microstructure_phase(1:microstructure_Nconstituents(m),m)) > size(config_phase)) &
call IO_error(150_pInt,m,ext_msg='phase')
if(minval(microstructure_texture(1:microstructure_Nconstituents(m),m)) < 1_pInt .or. &
maxval(microstructure_texture(1:microstructure_Nconstituents(m),m)) > size(textureConfig)) &
maxval(microstructure_texture(1:microstructure_Nconstituents(m),m)) > size(config_texture)) &
call IO_error(150_pInt,m,ext_msg='texture')
if(microstructure_Nconstituents(m) < 1_pInt) &
call IO_error(151_pInt,m)
@ -448,11 +448,11 @@ subroutine material_init()
debugOut: if (iand(myDebug,debug_levelExtensive) /= 0_pInt) then
write(6,'(/,a,/)') ' MATERIAL configuration'
write(6,'(a32,1x,a16,1x,a6)') 'homogenization ','type ','grains'
do h = 1_pInt,size(homogenizationConfig)
do h = 1_pInt,size(config_homogenization)
write(6,'(1x,a32,1x,a16,1x,i6)') homogenization_name(h),homogenization_type(h),homogenization_Ngrains(h)
enddo
write(6,'(/,a14,18x,1x,a11,1x,a12,1x,a13)') 'microstructure','crystallite','constituents','homogeneous'
do m = 1_pInt,size(microstructureConfig)
do m = 1_pInt,size(config_microstructure)
write(6,'(1x,a32,1x,i11,1x,i12,1x,l13)') microstructure_name(m), &
microstructure_crystallite(m), &
microstructure_Nconstituents(m), &
@ -477,9 +477,9 @@ subroutine material_init()
allocate(mappingCrystallite (2,homogenization_maxNgrains, mesh_NcpElems),source=0_pInt)
allocate(mappingHomogenizationConst( mesh_maxNips,mesh_NcpElems),source=1_pInt)
allocate(ConstitutivePosition (size(phaseConfig)), source=0_pInt)
allocate(HomogenizationPosition(size(homogenizationConfig)),source=0_pInt)
allocate(CrystallitePosition (size(phaseConfig)), source=0_pInt)
allocate(ConstitutivePosition (size(config_phase)), source=0_pInt)
allocate(HomogenizationPosition(size(config_homogenization)),source=0_pInt)
allocate(CrystallitePosition (size(config_phase)), source=0_pInt)
ElemLoop:do e = 1_pInt,mesh_NcpElems
myHomog = mesh_element(3,e)
@ -496,7 +496,7 @@ subroutine material_init()
enddo ElemLoop
! hack needed to initialize field values used during constitutive and crystallite initializations
do myHomog = 1,size(homogenizationConfig)
do myHomog = 1,size(config_homogenization)
thermalMapping (myHomog)%p => mappingHomogenizationConst
damageMapping (myHomog)%p => mappingHomogenizationConst
vacancyfluxMapping (myHomog)%p => mappingHomogenizationConst
@ -520,7 +520,7 @@ end subroutine material_init
!--------------------------------------------------------------------------------------------------
subroutine material_parseHomogenization
use config, only : &
homogenizationConfig
config_homogenization
use IO, only: &
IO_error
use mesh, only: &
@ -530,54 +530,54 @@ subroutine material_parseHomogenization
integer(pInt) :: h
character(len=65536) :: tag
allocate(homogenization_type(size(homogenizationConfig)), source=HOMOGENIZATION_undefined_ID)
allocate(thermal_type(size(homogenizationConfig)), source=THERMAL_isothermal_ID)
allocate(damage_type (size(homogenizationConfig)), source=DAMAGE_none_ID)
allocate(vacancyflux_type(size(homogenizationConfig)), source=VACANCYFLUX_isoconc_ID)
allocate(porosity_type (size(homogenizationConfig)), source=POROSITY_none_ID)
allocate(hydrogenflux_type(size(homogenizationConfig)), source=HYDROGENFLUX_isoconc_ID)
allocate(homogenization_typeInstance(size(homogenizationConfig)), source=0_pInt)
allocate(thermal_typeInstance(size(homogenizationConfig)), source=0_pInt)
allocate(damage_typeInstance(size(homogenizationConfig)), source=0_pInt)
allocate(vacancyflux_typeInstance(size(homogenizationConfig)), source=0_pInt)
allocate(porosity_typeInstance(size(homogenizationConfig)), source=0_pInt)
allocate(hydrogenflux_typeInstance(size(homogenizationConfig)), source=0_pInt)
allocate(homogenization_Ngrains(size(homogenizationConfig)), source=0_pInt)
allocate(homogenization_Noutput(size(homogenizationConfig)), source=0_pInt)
allocate(homogenization_active(size(homogenizationConfig)), source=.false.) !!!!!!!!!!!!!!!
allocate(thermal_initialT(size(homogenizationConfig)), source=300.0_pReal)
allocate(damage_initialPhi(size(homogenizationConfig)), source=1.0_pReal)
allocate(vacancyflux_initialCv(size(homogenizationConfig)), source=0.0_pReal)
allocate(porosity_initialPhi(size(homogenizationConfig)), source=1.0_pReal)
allocate(hydrogenflux_initialCh(size(homogenizationConfig)), source=0.0_pReal)
allocate(homogenization_type(size(config_homogenization)), source=HOMOGENIZATION_undefined_ID)
allocate(thermal_type(size(config_homogenization)), source=THERMAL_isothermal_ID)
allocate(damage_type (size(config_homogenization)), source=DAMAGE_none_ID)
allocate(vacancyflux_type(size(config_homogenization)), source=VACANCYFLUX_isoconc_ID)
allocate(porosity_type (size(config_homogenization)), source=POROSITY_none_ID)
allocate(hydrogenflux_type(size(config_homogenization)), source=HYDROGENFLUX_isoconc_ID)
allocate(homogenization_typeInstance(size(config_homogenization)), source=0_pInt)
allocate(thermal_typeInstance(size(config_homogenization)), source=0_pInt)
allocate(damage_typeInstance(size(config_homogenization)), source=0_pInt)
allocate(vacancyflux_typeInstance(size(config_homogenization)), source=0_pInt)
allocate(porosity_typeInstance(size(config_homogenization)), source=0_pInt)
allocate(hydrogenflux_typeInstance(size(config_homogenization)), source=0_pInt)
allocate(homogenization_Ngrains(size(config_homogenization)), source=0_pInt)
allocate(homogenization_Noutput(size(config_homogenization)), source=0_pInt)
allocate(homogenization_active(size(config_homogenization)), source=.false.) !!!!!!!!!!!!!!!
allocate(thermal_initialT(size(config_homogenization)), source=300.0_pReal)
allocate(damage_initialPhi(size(config_homogenization)), source=1.0_pReal)
allocate(vacancyflux_initialCv(size(config_homogenization)), source=0.0_pReal)
allocate(porosity_initialPhi(size(config_homogenization)), source=1.0_pReal)
allocate(hydrogenflux_initialCh(size(config_homogenization)), source=0.0_pReal)
forall (h = 1_pInt:size(homogenizationConfig)) homogenization_active(h) = any(mesh_element(3,:) == h)
forall (h = 1_pInt:size(config_homogenization)) homogenization_active(h) = any(mesh_element(3,:) == h)
do h=1_pInt, size(homogenizationConfig)
homogenization_Noutput(h) = homogenizationConfig(h)%countKeys('(output)')
do h=1_pInt, size(config_homogenization)
homogenization_Noutput(h) = config_homogenization(h)%countKeys('(output)')
tag = homogenizationConfig(h)%getString('mech')
tag = config_homogenization(h)%getString('mech')
select case (trim(tag))
case(HOMOGENIZATION_NONE_label)
homogenization_type(h) = HOMOGENIZATION_NONE_ID
homogenization_Ngrains(h) = 1_pInt
case(HOMOGENIZATION_ISOSTRAIN_label)
homogenization_type(h) = HOMOGENIZATION_ISOSTRAIN_ID
homogenization_Ngrains(h) = homogenizationConfig(h)%getInt('nconstituents')
homogenization_Ngrains(h) = config_homogenization(h)%getInt('nconstituents')
case(HOMOGENIZATION_RGC_label)
homogenization_type(h) = HOMOGENIZATION_RGC_ID
homogenization_Ngrains(h) = homogenizationConfig(h)%getInt('nconstituents')
homogenization_Ngrains(h) = config_homogenization(h)%getInt('nconstituents')
case default
call IO_error(500_pInt,ext_msg=trim(tag))
end select
homogenization_typeInstance(h) = count(homogenization_type==homogenization_type(h))
if (homogenizationConfig(h)%keyExists('thermal')) then
thermal_initialT(h) = homogenizationConfig(h)%getFloat('t0',defaultVal=300.0_pReal)
if (config_homogenization(h)%keyExists('thermal')) then
thermal_initialT(h) = config_homogenization(h)%getFloat('t0',defaultVal=300.0_pReal)
tag = homogenizationConfig(h)%getString('thermal')
tag = config_homogenization(h)%getString('thermal')
select case (trim(tag))
case(THERMAL_isothermal_label)
thermal_type(h) = THERMAL_isothermal_ID
@ -591,10 +591,10 @@ subroutine material_parseHomogenization
endif
if (homogenizationConfig(h)%keyExists('damage')) then
damage_initialPhi(h) = homogenizationConfig(h)%getFloat('initialdamage',defaultVal=1.0_pReal)
if (config_homogenization(h)%keyExists('damage')) then
damage_initialPhi(h) = config_homogenization(h)%getFloat('initialdamage',defaultVal=1.0_pReal)
tag = homogenizationConfig(h)%getString('damage')
tag = config_homogenization(h)%getString('damage')
select case (trim(tag))
case(DAMAGE_NONE_label)
damage_type(h) = DAMAGE_none_ID
@ -608,10 +608,10 @@ subroutine material_parseHomogenization
endif
if (homogenizationConfig(h)%keyExists('vacancyflux')) then
vacancyflux_initialCv(h) = homogenizationConfig(h)%getFloat('cv0',defaultVal=0.0_pReal)
if (config_homogenization(h)%keyExists('vacancyflux')) then
vacancyflux_initialCv(h) = config_homogenization(h)%getFloat('cv0',defaultVal=0.0_pReal)
tag = homogenizationConfig(h)%getString('vacancyflux')
tag = config_homogenization(h)%getString('vacancyflux')
select case (trim(tag))
case(VACANCYFLUX_isoconc_label)
vacancyflux_type(h) = VACANCYFLUX_isoconc_ID
@ -625,10 +625,10 @@ subroutine material_parseHomogenization
endif
if (homogenizationConfig(h)%keyExists('porosity')) then
if (config_homogenization(h)%keyExists('porosity')) then
!ToDo?
tag = homogenizationConfig(h)%getString('porosity')
tag = config_homogenization(h)%getString('porosity')
select case (trim(tag))
case(POROSITY_NONE_label)
porosity_type(h) = POROSITY_none_ID
@ -640,10 +640,10 @@ subroutine material_parseHomogenization
endif
if (homogenizationConfig(h)%keyExists('hydrogenflux')) then
hydrogenflux_initialCh(h) = homogenizationConfig(h)%getFloat('ch0',defaultVal=0.0_pReal)
if (config_homogenization(h)%keyExists('hydrogenflux')) then
hydrogenflux_initialCh(h) = config_homogenization(h)%getFloat('ch0',defaultVal=0.0_pReal)
tag = homogenizationConfig(h)%getString('hydrogenflux')
tag = config_homogenization(h)%getString('hydrogenflux')
select case (trim(tag))
case(HYDROGENFLUX_isoconc_label)
hydrogenflux_type(h) = HYDROGENFLUX_isoconc_ID
@ -657,7 +657,7 @@ subroutine material_parseHomogenization
enddo
do h=1_pInt, size(homogenizationConfig)
do h=1_pInt, size(config_homogenization)
homogenization_typeInstance(h) = count(homogenization_type(1:h) == homogenization_type(h))
thermal_typeInstance(h) = count(thermal_type (1:h) == thermal_type (h))
damage_typeInstance(h) = count(damage_type (1:h) == damage_type (h))
@ -684,7 +684,7 @@ subroutine material_parseMicrostructure
IO_stringPos, &
IO_error
use config, only: &
microstructureConfig, &
config_microstructure, &
microstructure_name
use mesh, only: &
mesh_element, &
@ -698,29 +698,29 @@ subroutine material_parseMicrostructure
character(len=65536) :: &
tag
allocate(microstructure_crystallite(size(microstructureConfig)), source=0_pInt)
allocate(microstructure_Nconstituents(size(microstructureConfig)), source=0_pInt)
allocate(microstructure_active(size(microstructureConfig)), source=.false.)
allocate(microstructure_elemhomo(size(microstructureConfig)), source=.false.)
allocate(microstructure_crystallite(size(config_microstructure)), source=0_pInt)
allocate(microstructure_Nconstituents(size(config_microstructure)), source=0_pInt)
allocate(microstructure_active(size(config_microstructure)), source=.false.)
allocate(microstructure_elemhomo(size(config_microstructure)), source=.false.)
if(any(mesh_element(4,1:mesh_NcpElems) > size(microstructureConfig))) &
if(any(mesh_element(4,1:mesh_NcpElems) > size(config_microstructure))) &
call IO_error(155_pInt,ext_msg='More microstructures in geometry than sections in material.config')
forall (e = 1_pInt:mesh_NcpElems) microstructure_active(mesh_element(4,e)) = .true. ! current microstructure used in model? Elementwise view, maximum N operations for N elements
do m=1_pInt, size(microstructureConfig)
microstructure_Nconstituents(m) = microstructureConfig(m)%countKeys('(constituent)')
microstructure_crystallite(m) = microstructureConfig(m)%getInt('crystallite')
microstructure_elemhomo(m) = microstructureConfig(m)%keyExists('/elementhomogeneous/')
do m=1_pInt, size(config_microstructure)
microstructure_Nconstituents(m) = config_microstructure(m)%countKeys('(constituent)')
microstructure_crystallite(m) = config_microstructure(m)%getInt('crystallite')
microstructure_elemhomo(m) = config_microstructure(m)%keyExists('/elementhomogeneous/')
enddo
microstructure_maxNconstituents = maxval(microstructure_Nconstituents)
allocate(microstructure_phase (microstructure_maxNconstituents,size(microstructureConfig)),source=0_pInt)
allocate(microstructure_texture (microstructure_maxNconstituents,size(microstructureConfig)),source=0_pInt)
allocate(microstructure_fraction(microstructure_maxNconstituents,size(microstructureConfig)),source=0.0_pReal)
allocate(microstructure_phase (microstructure_maxNconstituents,size(config_microstructure)),source=0_pInt)
allocate(microstructure_texture (microstructure_maxNconstituents,size(config_microstructure)),source=0_pInt)
allocate(microstructure_fraction(microstructure_maxNconstituents,size(config_microstructure)),source=0.0_pReal)
do m=1_pInt, size(microstructureConfig)
str = microstructureConfig(m)%getStrings('(constituent)',raw=.true.)
do m=1_pInt, size(config_microstructure)
str = config_microstructure(m)%getStrings('(constituent)',raw=.true.)
do c = 1_pInt, size(str)
chunkPos = IO_stringPos(str(c))
@ -740,7 +740,7 @@ subroutine material_parseMicrostructure
enddo
enddo
do m = 1_pInt, size(microstructureConfig)
do m = 1_pInt, size(config_microstructure)
if (dNeq(sum(microstructure_fraction(:,m)),1.0_pReal)) &
call IO_error(153_pInt,ext_msg=microstructure_name(m))
enddo
@ -753,14 +753,14 @@ end subroutine material_parseMicrostructure
!--------------------------------------------------------------------------------------------------
subroutine material_parseCrystallite
use config, only: &
crystalliteConfig
config_crystallite
implicit none
integer(pInt) :: c
allocate(crystallite_Noutput(size(crystalliteConfig)),source=0_pInt)
do c=1_pInt, size(crystalliteConfig)
crystallite_Noutput(c) = crystalliteConfig(c)%countKeys('(output)')
allocate(crystallite_Noutput(size(config_crystallite)),source=0_pInt)
do c=1_pInt, size(config_crystallite)
crystallite_Noutput(c) = config_crystallite(c)%countKeys('(output)')
enddo
end subroutine material_parseCrystallite
@ -775,36 +775,36 @@ subroutine material_parsePhase
IO_getTag, &
IO_stringValue
use config, only: &
phaseConfig
config_phase
implicit none
integer(pInt) :: sourceCtr, kinematicsCtr, stiffDegradationCtr, p
character(len=65536), dimension(:), allocatable :: str
allocate(phase_elasticity(size(phaseConfig)),source=ELASTICITY_undefined_ID)
allocate(phase_plasticity(size(phaseConfig)),source=PLASTICITY_undefined_ID)
allocate(phase_Nsources(size(phaseConfig)), source=0_pInt)
allocate(phase_Nkinematics(size(phaseConfig)), source=0_pInt)
allocate(phase_NstiffnessDegradations(size(phaseConfig)),source=0_pInt)
allocate(phase_Noutput(size(phaseConfig)), source=0_pInt)
allocate(phase_localPlasticity(size(phaseConfig)), source=.false.)
allocate(phase_elasticity(size(config_phase)),source=ELASTICITY_undefined_ID)
allocate(phase_plasticity(size(config_phase)),source=PLASTICITY_undefined_ID)
allocate(phase_Nsources(size(config_phase)), source=0_pInt)
allocate(phase_Nkinematics(size(config_phase)), source=0_pInt)
allocate(phase_NstiffnessDegradations(size(config_phase)),source=0_pInt)
allocate(phase_Noutput(size(config_phase)), source=0_pInt)
allocate(phase_localPlasticity(size(config_phase)), source=.false.)
do p=1_pInt, size(phaseConfig)
phase_Noutput(p) = phaseConfig(p)%countKeys('(output)')
phase_Nsources(p) = phaseConfig(p)%countKeys('(source)')
phase_Nkinematics(p) = phaseConfig(p)%countKeys('(kinematics)')
phase_NstiffnessDegradations(p) = phaseConfig(p)%countKeys('(stiffness_degradation)')
phase_localPlasticity(p) = .not. phaseConfig(p)%KeyExists('/nonlocal/')
do p=1_pInt, size(config_phase)
phase_Noutput(p) = config_phase(p)%countKeys('(output)')
phase_Nsources(p) = config_phase(p)%countKeys('(source)')
phase_Nkinematics(p) = config_phase(p)%countKeys('(kinematics)')
phase_NstiffnessDegradations(p) = config_phase(p)%countKeys('(stiffness_degradation)')
phase_localPlasticity(p) = .not. config_phase(p)%KeyExists('/nonlocal/')
select case (phaseConfig(p)%getString('elasticity'))
select case (config_phase(p)%getString('elasticity'))
case (ELASTICITY_HOOKE_label)
phase_elasticity(p) = ELASTICITY_HOOKE_ID
case default
call IO_error(200_pInt,ext_msg=trim(phaseConfig(p)%getString('elasticity')))
call IO_error(200_pInt,ext_msg=trim(config_phase(p)%getString('elasticity')))
end select
select case (phaseConfig(p)%getString('plasticity'))
select case (config_phase(p)%getString('plasticity'))
case (PLASTICITY_NONE_label)
phase_plasticity(p) = PLASTICITY_NONE_ID
case (PLASTICITY_ISOTROPIC_label)
@ -820,22 +820,22 @@ subroutine material_parsePhase
case (PLASTICITY_NONLOCAL_label)
phase_plasticity(p) = PLASTICITY_NONLOCAL_ID
case default
call IO_error(201_pInt,ext_msg=trim(phaseConfig(p)%getString('plasticity')))
call IO_error(201_pInt,ext_msg=trim(config_phase(p)%getString('plasticity')))
end select
enddo
allocate(phase_source(maxval(phase_Nsources),size(phaseConfig)), source=SOURCE_undefined_ID)
allocate(phase_kinematics(maxval(phase_Nkinematics),size(phaseConfig)), source=KINEMATICS_undefined_ID)
allocate(phase_stiffnessDegradation(maxval(phase_NstiffnessDegradations),size(phaseConfig)), &
allocate(phase_source(maxval(phase_Nsources),size(config_phase)), source=SOURCE_undefined_ID)
allocate(phase_kinematics(maxval(phase_Nkinematics),size(config_phase)), source=KINEMATICS_undefined_ID)
allocate(phase_stiffnessDegradation(maxval(phase_NstiffnessDegradations),size(config_phase)), &
source=STIFFNESS_DEGRADATION_undefined_ID)
do p=1_pInt, size(phaseConfig)
do p=1_pInt, size(config_phase)
#if defined(__GFORTRAN__)
str = ['GfortranBug86277']
str = phaseConfig(p)%getStrings('(source)',defaultVal=str)
str = config_phase(p)%getStrings('(source)',defaultVal=str)
if (str(1) == 'GfortranBug86277') str = [character(len=65536)::]
#else
str = phaseConfig(p)%getStrings('(source)',defaultVal=[character(len=65536)::])
str = config_phase(p)%getStrings('(source)',defaultVal=[character(len=65536)::])
#endif
do sourceCtr = 1_pInt, size(str)
select case (trim(str(sourceCtr)))
@ -862,10 +862,10 @@ subroutine material_parsePhase
#if defined(__GFORTRAN__)
str = ['GfortranBug86277']
str = phaseConfig(p)%getStrings('(kinematics)',defaultVal=str)
str = config_phase(p)%getStrings('(kinematics)',defaultVal=str)
if (str(1) == 'GfortranBug86277') str = [character(len=65536)::]
#else
str = phaseConfig(p)%getStrings('(kinematics)',defaultVal=[character(len=65536)::])
str = config_phase(p)%getStrings('(kinematics)',defaultVal=[character(len=65536)::])
#endif
do kinematicsCtr = 1_pInt, size(str)
select case (trim(str(kinematicsCtr)))
@ -883,10 +883,10 @@ subroutine material_parsePhase
enddo
#if defined(__GFORTRAN__)
str = ['GfortranBug86277']
str = phaseConfig(p)%getStrings('(stiffness_degradation)',defaultVal=str)
str = config_phase(p)%getStrings('(stiffness_degradation)',defaultVal=str)
if (str(1) == 'GfortranBug86277') str = [character(len=65536)::]
#else
str = phaseConfig(p)%getStrings('(stiffness_degradation)',defaultVal=[character(len=65536)::])
str = config_phase(p)%getStrings('(stiffness_degradation)',defaultVal=[character(len=65536)::])
#endif
do stiffDegradationCtr = 1_pInt, size(str)
select case (trim(str(stiffDegradationCtr)))
@ -898,10 +898,10 @@ subroutine material_parsePhase
enddo
enddo
allocate(phase_plasticityInstance(size(phaseConfig)), source=0_pInt)
allocate(phase_elasticityInstance(size(phaseConfig)), source=0_pInt)
allocate(phase_plasticityInstance(size(config_phase)), source=0_pInt)
allocate(phase_elasticityInstance(size(config_phase)), source=0_pInt)
do p=1_pInt, size(phaseConfig)
do p=1_pInt, size(config_phase)
phase_elasticityInstance(p) = count(phase_elasticity(1:p) == phase_elasticity(p))
phase_plasticityInstance(p) = count(phase_plasticity(1:p) == phase_plasticity(p))
enddo
@ -920,7 +920,7 @@ subroutine material_parseTexture
IO_floatValue, &
IO_stringValue
use config, only: &
textureConfig, &
config_texture, &
config_deallocate
use math, only: &
inRad, &
@ -934,31 +934,31 @@ subroutine material_parseTexture
integer(pInt), dimension(:), allocatable :: chunkPos
character(len=65536) :: tag
allocate(texture_ODFfile(size(textureConfig))); texture_ODFfile=''
allocate(texture_symmetry(size(textureConfig)), source=1_pInt)
allocate(texture_Ngauss(size(textureConfig)), source=0_pInt)
allocate(texture_Nfiber(size(textureConfig)), source=0_pInt)
allocate(texture_ODFfile(size(config_texture))); texture_ODFfile=''
allocate(texture_symmetry(size(config_texture)), source=1_pInt)
allocate(texture_Ngauss(size(config_texture)), source=0_pInt)
allocate(texture_Nfiber(size(config_texture)), source=0_pInt)
do t=1_pInt, size(textureConfig)
texture_Ngauss(t) = textureConfig(t)%countKeys('(gauss)') &
+ textureConfig(t)%countKeys('(random)')
texture_Nfiber(t) = textureConfig(t)%countKeys('(fiber)')
do t=1_pInt, size(config_texture)
texture_Ngauss(t) = config_texture(t)%countKeys('(gauss)') &
+ config_texture(t)%countKeys('(random)')
texture_Nfiber(t) = config_texture(t)%countKeys('(fiber)')
enddo
texture_maxNgauss = maxval(texture_Ngauss)
texture_maxNfiber = maxval(texture_Nfiber)
allocate(texture_Gauss (5,texture_maxNgauss,size(textureConfig)), source=0.0_pReal)
allocate(texture_Fiber (6,texture_maxNfiber,size(textureConfig)), source=0.0_pReal)
allocate(texture_transformation(3,3,size(textureConfig)), source=0.0_pReal)
texture_transformation = spread(math_I3,3,size(textureConfig))
allocate(texture_Gauss (5,texture_maxNgauss,size(config_texture)), source=0.0_pReal)
allocate(texture_Fiber (6,texture_maxNfiber,size(config_texture)), source=0.0_pReal)
allocate(texture_transformation(3,3,size(config_texture)), source=0.0_pReal)
texture_transformation = spread(math_I3,3,size(config_texture))
do t=1_pInt, size(textureConfig)
do t=1_pInt, size(config_texture)
section = t
gauss = 0_pInt
fiber = 0_pInt
if (textureConfig(t)%keyExists('axes')) then
strings = textureConfig(t)%getStrings('axes')
if (config_texture(t)%keyExists('axes')) then
strings = config_texture(t)%getStrings('axes')
do j = 1_pInt, 3_pInt ! look for "x", "y", and "z" entries
select case (strings(j))
case('x', '+x')
@ -981,10 +981,10 @@ subroutine material_parseTexture
endif
tag=''
texture_ODFfile(t) = textureConfig(t)%getString('hybridia',defaultVal=tag)
texture_ODFfile(t) = config_texture(t)%getString('hybridia',defaultVal=tag)
if (textureConfig(t)%keyExists('symmetry')) then
select case (textureConfig(t)%getString('symmetry'))
if (config_texture(t)%keyExists('symmetry')) then
select case (config_texture(t)%getString('symmetry'))
case('orthotropic')
texture_symmetry(t) = 4_pInt
case('monoclinic')
@ -994,8 +994,8 @@ subroutine material_parseTexture
end select
endif
if (textureConfig(t)%keyExists('(random)')) then
strings = textureConfig(t)%getStrings('(random)',raw=.true.)
if (config_texture(t)%keyExists('(random)')) then
strings = config_texture(t)%getStrings('(random)',raw=.true.)
do i = 1_pInt, size(strings)
gauss = gauss + 1_pInt
texture_Gauss(1:3,gauss,t) = math_sampleRandomOri()
@ -1012,9 +1012,9 @@ subroutine material_parseTexture
endif
if (textureConfig(t)%keyExists('(gauss)')) then
if (config_texture(t)%keyExists('(gauss)')) then
gauss = gauss + 1_pInt
strings = textureConfig(t)%getStrings('(gauss)',raw= .true.)
strings = config_texture(t)%getStrings('(gauss)',raw= .true.)
do i = 1_pInt , size(strings)
chunkPos = IO_stringPos(strings(i))
do j = 1_pInt,9_pInt,2_pInt
@ -1035,9 +1035,9 @@ subroutine material_parseTexture
endif
if (textureConfig(t)%keyExists('(fiber)')) then
if (config_texture(t)%keyExists('(fiber)')) then
fiber = fiber + 1_pInt
strings = textureConfig(t)%getStrings('(fiber)',raw= .true.)
strings = config_texture(t)%getStrings('(fiber)',raw= .true.)
do i = 1_pInt, size(strings)
chunkPos = IO_stringPos(strings(i))
do j = 1_pInt,11_pInt,2_pInt
@ -1090,8 +1090,8 @@ subroutine material_populateGrains
FE_Nips, &
FE_geomtype
use config, only: &
homogenizationConfig, &
microstructureConfig, &
config_homogenization, &
config_microstructure, &
homogenization_name, &
microstructure_name
use IO, only: &
@ -1130,8 +1130,8 @@ subroutine material_populateGrains
allocate(material_texture(homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source=0_pInt)
allocate(material_EulerAngles(3,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems),source=0.0_pReal)
allocate(Ngrains(size(homogenizationConfig),size(microstructureConfig)), source=0_pInt)
allocate(Nelems (size(homogenizationConfig),size(microstructureConfig)), source=0_pInt)
allocate(Ngrains(size(config_homogenization),size(config_microstructure)), source=0_pInt)
allocate(Nelems (size(config_homogenization),size(config_microstructure)), source=0_pInt)
! populating homogenization schemes in each
!--------------------------------------------------------------------------------------------------
@ -1146,9 +1146,9 @@ subroutine material_populateGrains
micro = mesh_element(4,e)
Nelems(homog,micro) = Nelems(homog,micro) + 1_pInt
enddo
allocate(elemsOfHomogMicro(size(homogenizationConfig),size(microstructureConfig)))
do homog = 1,size(homogenizationConfig)
do micro = 1,size(microstructureConfig)
allocate(elemsOfHomogMicro(size(config_homogenization),size(config_microstructure)))
do homog = 1,size(config_homogenization)
do micro = 1,size(config_microstructure)
if (Nelems(homog,micro) > 0_pInt) then
allocate(elemsOfHomogMicro(homog,micro)%p(Nelems(homog,micro)))
elemsOfHomogMicro(homog,micro)%p = 0_pInt
@ -1163,9 +1163,9 @@ subroutine material_populateGrains
t = FE_geomtype(mesh_element(2,e))
homog = mesh_element(3,e)
micro = mesh_element(4,e)
if (homog < 1_pInt .or. homog > size(homogenizationConfig)) & ! out of bounds
if (homog < 1_pInt .or. homog > size(config_homogenization)) & ! out of bounds
call IO_error(154_pInt,e,0_pInt,0_pInt)
if (micro < 1_pInt .or. micro > size(microstructureConfig)) & ! out of bounds
if (micro < 1_pInt .or. micro > size(config_microstructure)) & ! out of bounds
call IO_error(155_pInt,e,0_pInt,0_pInt)
if (microstructure_elemhomo(micro)) then ! how many grains are needed at this element?
dGrains = homogenization_Ngrains(homog) ! only one set of Ngrains (other IPs are plain copies)
@ -1186,9 +1186,9 @@ subroutine material_populateGrains
write(6,'(/,a/)') ' MATERIAL grain population'
write(6,'(a32,1x,a32,1x,a6)') 'homogenization_name','microstructure_name','grain#'
endif
homogenizationLoop: do homog = 1_pInt,size(homogenizationConfig)
homogenizationLoop: do homog = 1_pInt,size(config_homogenization)
dGrains = homogenization_Ngrains(homog) ! grain number per material point
microstructureLoop: do micro = 1_pInt,size(microstructureConfig) ! all pairs of homog and micro
microstructureLoop: do micro = 1_pInt,size(config_microstructure) ! all pairs of homog and micro
activePair: if (Ngrains(homog,micro) > 0_pInt) then
myNgrains = Ngrains(homog,micro) ! assign short name for total number of grains to populate
myNconstituents = microstructure_Nconstituents(micro) ! assign short name for number of constituents

View File

@ -100,7 +100,7 @@ use IO
plasticState
use config, only: &
MATERIAL_partPhase, &
phaseConfig
config_phase
use lattice
@ -145,29 +145,29 @@ use IO
if (phase_plasticity(phase) == PLASTICITY_ISOTROPIC_ID) then
instance = phase_plasticityInstance(phase)
prm => param(instance) ! shorthand pointer to parameter object of my constitutive law
prm%tau0 = phaseConfig(phase)%getFloat('tau0')
prm%tausat = phaseConfig(phase)%getFloat('tausat')
prm%gdot0 = phaseConfig(phase)%getFloat('gdot0')
prm%n = phaseConfig(phase)%getFloat('n')
prm%h0 = phaseConfig(phase)%getFloat('h0')
prm%fTaylor = phaseConfig(phase)%getFloat('m')
prm%h0_slopeLnRate = phaseConfig(phase)%getFloat('h0_slopelnrate', defaultVal=0.0_pReal)
prm%tausat_SinhFitA = phaseConfig(phase)%getFloat('tausat_sinhfita',defaultVal=0.0_pReal)
prm%tausat_SinhFitB = phaseConfig(phase)%getFloat('tausat_sinhfitb',defaultVal=0.0_pReal)
prm%tausat_SinhFitC = phaseConfig(phase)%getFloat('tausat_sinhfitc',defaultVal=0.0_pReal)
prm%tausat_SinhFitD = phaseConfig(phase)%getFloat('tausat_sinhfitd',defaultVal=0.0_pReal)
prm%a = phaseConfig(phase)%getFloat('a')
prm%aTolFlowStress = phaseConfig(phase)%getFloat('atol_flowstress',defaultVal=1.0_pReal)
prm%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal)
prm%tau0 = config_phase(phase)%getFloat('tau0')
prm%tausat = config_phase(phase)%getFloat('tausat')
prm%gdot0 = config_phase(phase)%getFloat('gdot0')
prm%n = config_phase(phase)%getFloat('n')
prm%h0 = config_phase(phase)%getFloat('h0')
prm%fTaylor = config_phase(phase)%getFloat('m')
prm%h0_slopeLnRate = config_phase(phase)%getFloat('h0_slopelnrate', defaultVal=0.0_pReal)
prm%tausat_SinhFitA = config_phase(phase)%getFloat('tausat_sinhfita',defaultVal=0.0_pReal)
prm%tausat_SinhFitB = config_phase(phase)%getFloat('tausat_sinhfitb',defaultVal=0.0_pReal)
prm%tausat_SinhFitC = config_phase(phase)%getFloat('tausat_sinhfitc',defaultVal=0.0_pReal)
prm%tausat_SinhFitD = config_phase(phase)%getFloat('tausat_sinhfitd',defaultVal=0.0_pReal)
prm%a = config_phase(phase)%getFloat('a')
prm%aTolFlowStress = config_phase(phase)%getFloat('atol_flowstress',defaultVal=1.0_pReal)
prm%aTolShear = config_phase(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal)
prm%dilatation = phaseConfig(phase)%keyExists('/dilatation/')
prm%dilatation = config_phase(phase)%keyExists('/dilatation/')
#if defined(__GFORTRAN__)
outputs = ['GfortranBug86277']
outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=outputs)
outputs = config_phase(phase)%getStrings('(output)',defaultVal=outputs)
if (outputs(1) == 'GfortranBug86277') outputs = [character(len=65536)::]
#else
outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=[character(len=65536)::])
outputs = config_phase(phase)%getStrings('(output)',defaultVal=[character(len=65536)::])
#endif
allocate(prm%outputID(0))
do i=1_pInt, size(outputs)