variable names better reflect their content

This commit is contained in:
Martin Diehl 2020-09-19 10:27:15 +02:00
parent 201303f35f
commit c34bf83e35
1 changed files with 16 additions and 15 deletions

View File

@ -227,6 +227,7 @@ end subroutine material_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief parses the homogenization part from the material configuration !> @brief parses the homogenization part from the material configuration
! ToDo: This should be done in homogenization
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_parseHomogenization subroutine material_parseHomogenization
@ -320,10 +321,10 @@ end subroutine material_parseHomogenization
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_parseMicrostructure subroutine material_parseMicrostructure
class(tNode), pointer :: microstructure, & !> pointer to microstructure list class(tNode), pointer :: microstructures, & !> list of microstructures
constituentsInMicrostructure, & !> pointer to a microstructure list item microstructure, & !> microstructure definition
constituents, & !> pointer to constituents list constituents, & !> list of constituents
constituent, & !> pointer to each constituent constituent, & !> constituent definition
phases, & phases, &
homogenization homogenization
@ -340,34 +341,35 @@ subroutine material_parseMicrostructure
c, & c, &
maxNconstituents maxNconstituents
microstructure => config_material%get('microstructure') microstructures => config_material%get('microstructure')
if(any(discretization_microstructureAt > microstructure%length)) & if(any(discretization_microstructureAt > microstructures%length)) &
call IO_error(155,ext_msg='More microstructures requested than found in material.yaml') call IO_error(155,ext_msg='More microstructures requested than found in material.yaml')
allocate(microstructure_Nconstituents(microstructure%length),source=0) allocate(microstructure_Nconstituents(microstructures%length),source=0)
do m = 1, microstructure%length do m = 1, microstructures%length
constituentsInMicrostructure => microstructure%get(m) microstructure => microstructures%get(m)
constituents => constituentsInMicrostructure%get('constituents') constituents => microstructure%get('constituents')
microstructure_Nconstituents(m) = constituents%length microstructure_Nconstituents(m) = constituents%length
enddo enddo
maxNconstituents = maxval(microstructure_Nconstituents) maxNconstituents = maxval(microstructure_Nconstituents)
allocate(material_orientation0(maxNconstituents,discretization_nIP,discretization_nElem))
allocate(material_homogenizationAt(discretization_nElem),source=0) allocate(material_homogenizationAt(discretization_nElem),source=0)
allocate(material_homogenizationMemberAt(discretization_nIP,discretization_nElem),source=0) allocate(material_homogenizationMemberAt(discretization_nIP,discretization_nElem),source=0)
allocate(material_phaseAt(maxNconstituents,discretization_nElem),source=0) allocate(material_phaseAt(maxNconstituents,discretization_nElem),source=0)
allocate(material_phaseMemberAt(maxNconstituents,discretization_nIP,discretization_nElem),source=0) allocate(material_phaseMemberAt(maxNconstituents,discretization_nIP,discretization_nElem),source=0)
allocate(material_orientation0(maxNconstituents,discretization_nIP,discretization_nElem))
phases => config_material%get('phase') phases => config_material%get('phase')
allocate(counterPhase(phases%length),source=0) allocate(counterPhase(phases%length),source=0)
homogenization => config_material%get('homogenization') homogenization => config_material%get('homogenization')
allocate(counterHomogenization(homogenization%length),source=0) allocate(counterHomogenization(homogenization%length),source=0)
do e = 1, discretization_nElem do e = 1, discretization_nElem
constituentsInMicrostructure => microstructure%get(discretization_microstructureAt(e)) microstructure => microstructures%get(discretization_microstructureAt(e))
constituents => constituentsInMicrostructure%get('constituents') constituents => microstructure%get('constituents')
material_homogenizationAt(e) = homogenization%getIndex(constituentsInMicrostructure%get_asString('homogenization')) material_homogenizationAt(e) = homogenization%getIndex(microstructure%get_asString('homogenization'))
do i = 1, discretization_nIP do i = 1, discretization_nIP
counterHomogenization(material_homogenizationAt(e)) = counterHomogenization(material_homogenizationAt(e)) + 1 counterHomogenization(material_homogenizationAt(e)) = counterHomogenization(material_homogenizationAt(e)) + 1
material_homogenizationMemberAt(i,e) = counterHomogenization(material_homogenizationAt(e)) material_homogenizationMemberAt(i,e) = counterHomogenization(material_homogenizationAt(e))
@ -379,7 +381,6 @@ subroutine material_parseMicrostructure
frac = frac + constituent%get_asFloat('fraction') frac = frac + constituent%get_asFloat('fraction')
material_phaseAt(c,e) = phases%getIndex(constituent%get_asString('phase')) material_phaseAt(c,e) = phases%getIndex(constituent%get_asString('phase'))
do i = 1, discretization_nIP do i = 1, discretization_nIP
counterPhase(material_phaseAt(c,e)) = counterPhase(material_phaseAt(c,e)) + 1 counterPhase(material_phaseAt(c,e)) = counterPhase(material_phaseAt(c,e)) + 1
material_phaseMemberAt(c,i,e) = counterPhase(material_phaseAt(c,e)) material_phaseMemberAt(c,i,e) = counterPhase(material_phaseAt(c,e))