simplified structure

choice of damage model triggers eigendeformation, no repeated variables
This implementation is the most ugly hack I could imagine. I just serves
the purpose of having a stable material.yaml
This commit is contained in:
Martin Diehl 2021-02-12 22:41:35 +01:00
parent 4eb2a981ca
commit 830d00fa67
8 changed files with 55 additions and 15 deletions

@ -1 +1 @@
Subproject commit e74cf00628285a587ced1e551cc9837c1011ca1c Subproject commit 07d125fe476621224d9f2ef73b0cf88f3b07bc60

View File

@ -175,7 +175,7 @@ module subroutine damage_init
allocate(current(ph)%d_phi_d_dot_phi(Nconstituents),source=0.0_pReal) allocate(current(ph)%d_phi_d_dot_phi(Nconstituents),source=0.0_pReal)
phase => phases%get(ph) phase => phases%get(ph)
sources => phase%get('source',defaultVal=emptyList) sources => phase%get('damage',defaultVal=emptyList)
phase_Nsources(ph) = sources%length phase_Nsources(ph) = sources%length
allocate(damageState(ph)%p(phase_Nsources(ph))) allocate(damageState(ph)%p(phase_Nsources(ph)))
enddo enddo
@ -493,7 +493,7 @@ function source_active(source_label,src_length) result(active_source)
allocate(active_source(src_length,phases%length), source = .false. ) allocate(active_source(src_length,phases%length), source = .false. )
do p = 1, phases%length do p = 1, phases%length
phase => phases%get(p) phase => phases%get(p)
sources => phase%get('source',defaultVal=emptyList) sources => phase%get('damage',defaultVal=emptyList)
do s = 1, sources%length do s = 1, sources%length
src => sources%get(s) src => sources%get(s)
if(src%get_asString('type') == source_label) active_source(s,p) = .true. if(src%get_asString('type') == source_label) active_source(s,p) = .true.

View File

@ -51,7 +51,7 @@ module function anisobrittle_init(source_length) result(mySources)
print'(/,a)', ' <<<+- phase:damage:anisobrittle init -+>>>' print'(/,a)', ' <<<+- phase:damage:anisobrittle init -+>>>'
mySources = source_active('damage_anisoBrittle',source_length) mySources = source_active('anisobrittle',source_length)
Ninstances = count(mySources) Ninstances = count(mySources)
print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT) print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT)
if(Ninstances == 0) return if(Ninstances == 0) return
@ -65,7 +65,7 @@ module function anisobrittle_init(source_length) result(mySources)
phase => phases%get(p) phase => phases%get(p)
if(any(mySources(:,p))) source_damage_anisoBrittle_instance(p) = count(mySources(:,1:p)) if(any(mySources(:,p))) source_damage_anisoBrittle_instance(p) = count(mySources(:,1:p))
if(count(mySources(:,p)) == 0) cycle if(count(mySources(:,p)) == 0) cycle
sources => phase%get('source') sources => phase%get('damage')
do sourceOffset = 1, sources%length do sourceOffset = 1, sources%length
if(mySources(sourceOffset,p)) then if(mySources(sourceOffset,p)) then
source_damage_anisoBrittle_offset(p) = sourceOffset source_damage_anisoBrittle_offset(p) = sourceOffset

View File

@ -41,7 +41,7 @@ module function isobrittle_init(source_length) result(mySources)
print'(/,a)', ' <<<+- phase:damage:isobrittle init -+>>>' print'(/,a)', ' <<<+- phase:damage:isobrittle init -+>>>'
mySources = source_active('damage_isoBrittle',source_length) mySources = source_active('isobrittle',source_length)
Ninstances = count(mySources) Ninstances = count(mySources)
print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT) print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT)
if(Ninstances == 0) return if(Ninstances == 0) return
@ -55,7 +55,7 @@ module function isobrittle_init(source_length) result(mySources)
phase => phases%get(p) phase => phases%get(p)
if(any(mySources(:,p))) source_damage_isoBrittle_instance(p) = count(mySources(:,1:p)) if(any(mySources(:,p))) source_damage_isoBrittle_instance(p) = count(mySources(:,1:p))
if(count(mySources(:,p)) == 0) cycle if(count(mySources(:,p)) == 0) cycle
sources => phase%get('source') sources => phase%get('damage')
do sourceOffset = 1, sources%length do sourceOffset = 1, sources%length
if(mySources(sourceOffset,p)) then if(mySources(sourceOffset,p)) then
source_damage_isoBrittle_offset(p) = sourceOffset source_damage_isoBrittle_offset(p) = sourceOffset

View File

@ -43,7 +43,7 @@ module function isoductile_init(source_length) result(mySources)
print'(/,a)', ' <<<+- phase:damage:isoductile init -+>>>' print'(/,a)', ' <<<+- phase:damage:isoductile init -+>>>'
mySources = source_active('damage_isoDuctile',source_length) mySources = source_active('isoductile',source_length)
Ninstances = count(mySources) Ninstances = count(mySources)
print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT) print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT)
if(Ninstances == 0) return if(Ninstances == 0) return
@ -57,7 +57,7 @@ module function isoductile_init(source_length) result(mySources)
phase => phases%get(p) phase => phases%get(p)
if(count(mySources(:,p)) == 0) cycle if(count(mySources(:,p)) == 0) cycle
if(any(mySources(:,p))) source_damage_isoDuctile_instance(p) = count(mySources(:,1:p)) if(any(mySources(:,p))) source_damage_isoDuctile_instance(p) = count(mySources(:,1:p))
sources => phase%get('source') sources => phase%get('damage')
do sourceOffset = 1, sources%length do sourceOffset = 1, sources%length
if(mySources(sourceOffset,p)) then if(mySources(sourceOffset,p)) then
source_damage_isoDuctile_offset(p) = sourceOffset source_damage_isoDuctile_offset(p) = sourceOffset

View File

@ -66,7 +66,8 @@ module subroutine eigendeformation_init(phases)
ph ph
class(tNode), pointer :: & class(tNode), pointer :: &
phase, & phase, &
kinematics kinematics, &
damage
print'(/,a)', ' <<<+- phase:mechanics:eigendeformation init -+>>>' print'(/,a)', ' <<<+- phase:mechanics:eigendeformation init -+>>>'
@ -77,6 +78,12 @@ module subroutine eigendeformation_init(phases)
phase => phases%get(ph) phase => phases%get(ph)
kinematics => phase%get('kinematics',defaultVal=emptyList) kinematics => phase%get('kinematics',defaultVal=emptyList)
phase_Nkinematics(ph) = kinematics%length phase_Nkinematics(ph) = kinematics%length
kinematics => phase%get('damage',defaultVal=emptyList)
if(kinematics%length >0) then
damage => kinematics%get(1)
if(damage%get_asString('type') == 'anisobrittle') phase_Nkinematics(ph) = phase_Nkinematics(ph) +1
if(damage%get_asString('type') == 'isoductile') phase_Nkinematics(ph) = phase_Nkinematics(ph) +1
endif
enddo enddo
allocate(phase_kinematics(maxval(phase_Nkinematics),phases%length), source = KINEMATICS_undefined_ID) allocate(phase_kinematics(maxval(phase_Nkinematics),phases%length), source = KINEMATICS_undefined_ID)
@ -90,7 +97,6 @@ module subroutine eigendeformation_init(phases)
end subroutine eigendeformation_init end subroutine eigendeformation_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief checks if a kinematic mechanism is active or not !> @brief checks if a kinematic mechanism is active or not
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -122,6 +128,38 @@ function kinematics_active(kinematics_label,kinematics_length) result(active_ki
end function kinematics_active end function kinematics_active
!--------------------------------------------------------------------------------------------------
!> @brief checks if a kinematic mechanism is active or not
!--------------------------------------------------------------------------------------------------
function kinematics_active2(kinematics_label,kinematics_length) result(active_kinematics)
character(len=*), intent(in) :: kinematics_label !< name of kinematic mechanism
integer, intent(in) :: kinematics_length !< max. number of kinematics in system
logical, dimension(:,:), allocatable :: active_kinematics
class(tNode), pointer :: &
phases, &
phase, &
kinematics, &
kinematics_type
integer :: p,k
phases => config_material%get('phase')
allocate(active_kinematics(kinematics_length,phases%length), source = .false. )
do p = 1, phases%length
phase => phases%get(p)
kinematics => phase%get('damage',defaultVal=emptyList)
do k = 1, kinematics%length
kinematics_type => kinematics%get(k)
if(kinematics_type%get_asString('type') == kinematics_label) active_kinematics(k,p) = .true.
enddo
enddo
end function kinematics_active2
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief contains the constitutive equation for calculating the velocity gradient !> @brief contains the constitutive equation for calculating the velocity gradient
! ToDo: MD: S is Mi? ! ToDo: MD: S is Mi?
@ -175,8 +213,10 @@ module subroutine phase_LiAndItsTangents(Li, dLi_dS, dLi_dFi, &
KinematicsLoop: do k = 1, phase_Nkinematics(material_phaseAt(co,el)) KinematicsLoop: do k = 1, phase_Nkinematics(material_phaseAt(co,el))
kinematicsType: select case (phase_kinematics(k,material_phaseAt(co,el))) kinematicsType: select case (phase_kinematics(k,material_phaseAt(co,el)))
case (KINEMATICS_cleavage_opening_ID) kinematicsType case (KINEMATICS_cleavage_opening_ID) kinematicsType
print*, 'clea'
call kinematics_cleavage_opening_LiAndItsTangent(my_Li, my_dLi_dS, S, co, ip, el) call kinematics_cleavage_opening_LiAndItsTangent(my_Li, my_dLi_dS, S, co, ip, el)
case (KINEMATICS_slipplane_opening_ID) kinematicsType case (KINEMATICS_slipplane_opening_ID) kinematicsType
print*, 'slipp'
call kinematics_slipplane_opening_LiAndItsTangent(my_Li, my_dLi_dS, S, co, ip, el) call kinematics_slipplane_opening_LiAndItsTangent(my_Li, my_dLi_dS, S, co, ip, el)
case (KINEMATICS_thermal_expansion_ID) kinematicsType case (KINEMATICS_thermal_expansion_ID) kinematicsType
me = material_phaseMemberAt(co,ip,el) me = material_phaseMemberAt(co,ip,el)

View File

@ -46,7 +46,7 @@ module function kinematics_cleavage_opening_init(kinematics_length) result(myKin
print'(/,a)', ' <<<+- phase:mechanics:eigendeformation:cleavageopening init -+>>>' print'(/,a)', ' <<<+- phase:mechanics:eigendeformation:cleavageopening init -+>>>'
myKinematics = kinematics_active('cleavage_opening',kinematics_length) myKinematics = kinematics_active2('anisobrittle',kinematics_length)
Ninstances = count(myKinematics) Ninstances = count(myKinematics)
print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT) print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT)
if(Ninstances == 0) return if(Ninstances == 0) return
@ -59,7 +59,7 @@ module function kinematics_cleavage_opening_init(kinematics_length) result(myKin
if(any(myKinematics(:,p))) kinematics_cleavage_opening_instance(p) = count(myKinematics(:,1:p)) if(any(myKinematics(:,p))) kinematics_cleavage_opening_instance(p) = count(myKinematics(:,1:p))
phase => phases%get(p) phase => phases%get(p)
if(count(myKinematics(:,p)) == 0) cycle if(count(myKinematics(:,p)) == 0) cycle
kinematics => phase%get('kinematics') kinematics => phase%get('damage')
do k = 1, kinematics%length do k = 1, kinematics%length
if(myKinematics(k,p)) then if(myKinematics(k,p)) then
associate(prm => param(kinematics_cleavage_opening_instance(p))) associate(prm => param(kinematics_cleavage_opening_instance(p)))

View File

@ -51,7 +51,7 @@ module function kinematics_slipplane_opening_init(kinematics_length) result(myKi
print'(/,a)', ' <<<+- phase:mechanics:eigendeformation:slipplaneopening init -+>>>' print'(/,a)', ' <<<+- phase:mechanics:eigendeformation:slipplaneopening init -+>>>'
myKinematics = kinematics_active('slipplane_opening',kinematics_length) myKinematics = kinematics_active2('isoductile',kinematics_length)
Ninstances = count(myKinematics) Ninstances = count(myKinematics)
print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT) print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT)
if(Ninstances == 0) return if(Ninstances == 0) return
@ -66,7 +66,7 @@ module function kinematics_slipplane_opening_init(kinematics_length) result(myKi
mech => phase%get('mechanics') mech => phase%get('mechanics')
pl => mech%get('plasticity') pl => mech%get('plasticity')
if(count(myKinematics(:,p)) == 0) cycle if(count(myKinematics(:,p)) == 0) cycle
kinematics => phase%get('kinematics') kinematics => phase%get('damage')
do k = 1, kinematics%length do k = 1, kinematics%length
if(myKinematics(k,p)) then if(myKinematics(k,p)) then
associate(prm => param(kinematics_slipplane_opening_instance(p))) associate(prm => param(kinematics_slipplane_opening_instance(p)))