From 261f32d7c9d2a912fae4d1add0b52e61389bbfd7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 19 Jan 2021 10:21:51 +0100 Subject: [PATCH] consistent names --- src/constitutive_damage.f90 | 16 +++++++--------- src/source_damage_isoBrittle.f90 | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/constitutive_damage.f90 b/src/constitutive_damage.f90 index 4fa7a9627..46f2a3057 100644 --- a/src/constitutive_damage.f90 +++ b/src/constitutive_damage.f90 @@ -411,14 +411,14 @@ end function constitutive_damage_collectDotState !> @brief for constitutive models having an instantaneous change of state !> will return false if delta state is not needed/supported by the constitutive model !-------------------------------------------------------------------------------------------------- -function constitutive_damage_deltaState(Fe, co, ip, el, ph, of) result(broken) +function constitutive_damage_deltaState(Fe, co, ip, el, ph, me) result(broken) integer, intent(in) :: & - co, & !< component-ID of integration point + co, & !< component-ID me integration point ip, & !< integration point el, & !< element ph, & - of + me real(pReal), intent(in), dimension(3,3) :: & Fe !< elastic deformation gradient integer :: & @@ -436,15 +436,13 @@ function constitutive_damage_deltaState(Fe, co, ip, el, ph, of) result(broken) sourceType: select case (phase_source(so,ph)) case (DAMAGE_ISOBRITTLE_ID) sourceType - call source_damage_isoBrittle_deltaState (constitutive_homogenizedC(material_phaseAt(co,el), & - material_phaseMemberAt(co,ip,el)), Fe, & - co, ip, el) - broken = any(IEEE_is_NaN(damageState(ph)%p(so)%deltaState(:,of))) + call source_damage_isoBrittle_deltaState(constitutive_homogenizedC(ph,me), Fe, co, ip, el) + broken = any(IEEE_is_NaN(damageState(ph)%p(so)%deltaState(:,me))) if(.not. broken) then myOffset = damageState(ph)%p(so)%offsetDeltaState mySize = damageState(ph)%p(so)%sizeDeltaState - damageState(ph)%p(so)%state(myOffset + 1: myOffset + mySize,of) = & - damageState(ph)%p(so)%state(myOffset + 1: myOffset + mySize,of) + damageState(ph)%p(so)%deltaState(1:mySize,of) + damageState(ph)%p(so)%state(myOffset + 1: myOffset + mySize,me) = & + damageState(ph)%p(so)%state(myOffset + 1: myOffset + mySize,me) + damageState(ph)%p(so)%deltaState(1:mySize,me) endif end select sourceType diff --git a/src/source_damage_isoBrittle.f90 b/src/source_damage_isoBrittle.f90 index 1721b0201..b2da8411f 100644 --- a/src/source_damage_isoBrittle.f90 +++ b/src/source_damage_isoBrittle.f90 @@ -28,7 +28,7 @@ contains !-------------------------------------------------------------------------------------------------- module function source_damage_isoBrittle_init(source_length) result(mySources) - integer, intent(in) :: source_length + integer, intent(in) :: source_length logical, dimension(:,:), allocatable :: mySources class(tNode), pointer :: & @@ -52,7 +52,7 @@ module function source_damage_isoBrittle_init(source_length) result(mySources) allocate(source_damage_isoBrittle_instance(phases%length), source=0) do p = 1, phases%length - phase => phases%get(p) + phase => phases%get(p) if(any(mySources(:,p))) source_damage_isoBrittle_instance(p) = count(mySources(:,1:p)) if(count(mySources(:,p)) == 0) cycle sources => phase%get('source') @@ -60,7 +60,7 @@ module function source_damage_isoBrittle_init(source_length) result(mySources) if(mySources(sourceOffset,p)) then source_damage_isoBrittle_offset(p) = sourceOffset associate(prm => param(source_damage_isoBrittle_instance(p))) - src => sources%get(sourceOffset) + src => sources%get(sourceOffset) prm%W_crit = src%get_asFloat('W_crit') @@ -69,7 +69,7 @@ module function source_damage_isoBrittle_init(source_length) result(mySources) #else prm%output = src%get_asStrings('output',defaultVal=emptyStringArray) #endif - + ! sanity checks if (prm%W_crit <= 0.0_pReal) extmsg = trim(extmsg)//' W_crit' @@ -106,31 +106,31 @@ module subroutine source_damage_isoBrittle_deltaState(C, Fe, co, ip, el) C integer :: & - phase, & - constituent, & + ph, & + me, & sourceOffset real(pReal), dimension(6) :: & strain real(pReal) :: & strainenergy - phase = material_phaseAt(co,el) !< phase ID at co,ip,el - constituent = material_phasememberAt(co,ip,el) !< state array offset for phase ID at co,ip,el - sourceOffset = source_damage_isoBrittle_offset(phase) + ph = material_phaseAt(co,el) !< ph ID at co,ip,el + me = material_phasememberAt(co,ip,el) !< state array offset for ph ID at co,ip,el + sourceOffset = source_damage_isoBrittle_offset(ph) strain = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3) - associate(prm => param(source_damage_isoBrittle_instance(phase))) + associate(prm => param(source_damage_isoBrittle_instance(ph))) strainenergy = 2.0_pReal*sum(strain*matmul(C,strain))/prm%W_crit ! ToDo: check strainenergy = 2.0_pReal*dot_product(strain,matmul(C,strain))/prm%W_crit - if (strainenergy > damageState(phase)%p(sourceOffset)%subState0(1,constituent)) then - damageState(phase)%p(sourceOffset)%deltaState(1,constituent) = & - strainenergy - damageState(phase)%p(sourceOffset)%state(1,constituent) + if (strainenergy > damageState(ph)%p(sourceOffset)%subState0(1,me)) then + damageState(ph)%p(sourceOffset)%deltaState(1,me) = & + strainenergy - damageState(ph)%p(sourceOffset)%state(1,me) else - damageState(phase)%p(sourceOffset)%deltaState(1,constituent) = & - damageState(phase)%p(sourceOffset)%subState0(1,constituent) - & - damageState(phase)%p(sourceOffset)%state(1,constituent) + damageState(ph)%p(sourceOffset)%deltaState(1,me) = & + damageState(ph)%p(sourceOffset)%subState0(1,me) - & + damageState(ph)%p(sourceOffset)%state(1,me) endif end associate