more cleaning; use 'ce', 'ph', 'me' wherever applicable
hide ip,el
This commit is contained in:
parent
286f59ed8c
commit
89858543fa
|
@ -126,15 +126,13 @@ module homogenization
|
||||||
integer, intent(in) :: h
|
integer, intent(in) :: h
|
||||||
end subroutine mechanical_results
|
end subroutine mechanical_results
|
||||||
|
|
||||||
module function mechanical_updateState(subdt,subF,ce,ip,el) result(doneAndHappy)
|
module function mechanical_updateState(subdt,subF,ce) result(doneAndHappy)
|
||||||
real(pReal), intent(in) :: &
|
real(pReal), intent(in) :: &
|
||||||
subdt !< current time step
|
subdt !< current time step
|
||||||
real(pReal), intent(in), dimension(3,3) :: &
|
real(pReal), intent(in), dimension(3,3) :: &
|
||||||
subF
|
subF
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ce, & !< cell
|
ce !< cell
|
||||||
ip, &
|
|
||||||
el
|
|
||||||
logical, dimension(2) :: doneAndHappy
|
logical, dimension(2) :: doneAndHappy
|
||||||
end function mechanical_updateState
|
end function mechanical_updateState
|
||||||
|
|
||||||
|
@ -327,7 +325,7 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE
|
||||||
if (.not. converged) then
|
if (.not. converged) then
|
||||||
doneAndHappy = [.true.,.false.]
|
doneAndHappy = [.true.,.false.]
|
||||||
else
|
else
|
||||||
doneAndHappy = mechanical_updateState(dt,homogenization_F(1:3,1:3,ce),ce,ip,el)
|
doneAndHappy = mechanical_updateState(dt,homogenization_F(1:3,1:3,ce),ce)
|
||||||
converged = all(doneAndHappy)
|
converged = all(doneAndHappy)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -154,11 +154,11 @@ module subroutine mechanical_homogenize(dt,ip,el)
|
||||||
|
|
||||||
case (HOMOGENIZATION_NONE_ID) chosenHomogenization
|
case (HOMOGENIZATION_NONE_ID) chosenHomogenization
|
||||||
homogenization_P(1:3,1:3,ce) = phase_mechanical_getP(1,ce)
|
homogenization_P(1:3,1:3,ce) = phase_mechanical_getP(1,ce)
|
||||||
homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = phase_mechanical_dPdF(dt,1,ip,el)
|
homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = phase_mechanical_dPdF(dt,1,ce)
|
||||||
|
|
||||||
case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization
|
case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization
|
||||||
do co = 1, homogenization_Nconstituents(material_homogenizationAt(el))
|
do co = 1, homogenization_Nconstituents(material_homogenizationAt(el))
|
||||||
dPdFs(:,:,:,:,co) = phase_mechanical_dPdF(dt,co,ip,el)
|
dPdFs(:,:,:,:,co) = phase_mechanical_dPdF(dt,co,ce)
|
||||||
Ps(:,:,co) = phase_mechanical_getP(co,ce)
|
Ps(:,:,co) = phase_mechanical_getP(co,ce)
|
||||||
enddo
|
enddo
|
||||||
call mechanical_isostrain_averageStressAndItsTangent(&
|
call mechanical_isostrain_averageStressAndItsTangent(&
|
||||||
|
@ -169,7 +169,7 @@ module subroutine mechanical_homogenize(dt,ip,el)
|
||||||
|
|
||||||
case (HOMOGENIZATION_RGC_ID) chosenHomogenization
|
case (HOMOGENIZATION_RGC_ID) chosenHomogenization
|
||||||
do co = 1, homogenization_Nconstituents(material_homogenizationAt(el))
|
do co = 1, homogenization_Nconstituents(material_homogenizationAt(el))
|
||||||
dPdFs(:,:,:,:,co) = phase_mechanical_dPdF(dt,co,ip,el)
|
dPdFs(:,:,:,:,co) = phase_mechanical_dPdF(dt,co,ce)
|
||||||
Ps(:,:,co) = phase_mechanical_getP(co,ce)
|
Ps(:,:,co) = phase_mechanical_getP(co,ce)
|
||||||
enddo
|
enddo
|
||||||
call mechanical_RGC_averageStressAndItsTangent(&
|
call mechanical_RGC_averageStressAndItsTangent(&
|
||||||
|
@ -187,16 +187,14 @@ end subroutine mechanical_homogenize
|
||||||
!> @brief update the internal state of the homogenization scheme and tell whether "done" and
|
!> @brief update the internal state of the homogenization scheme and tell whether "done" and
|
||||||
!> "happy" with result
|
!> "happy" with result
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module function mechanical_updateState(subdt,subF,ce,ip,el) result(doneAndHappy)
|
module function mechanical_updateState(subdt,subF,ce) result(doneAndHappy)
|
||||||
|
|
||||||
real(pReal), intent(in) :: &
|
real(pReal), intent(in) :: &
|
||||||
subdt !< current time step
|
subdt !< current time step
|
||||||
real(pReal), intent(in), dimension(3,3) :: &
|
real(pReal), intent(in), dimension(3,3) :: &
|
||||||
subF
|
subF
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ce, &
|
ce
|
||||||
ip, &
|
|
||||||
el
|
|
||||||
logical, dimension(2) :: doneAndHappy
|
logical, dimension(2) :: doneAndHappy
|
||||||
|
|
||||||
integer :: co
|
integer :: co
|
||||||
|
@ -207,7 +205,7 @@ module function mechanical_updateState(subdt,subF,ce,ip,el) result(doneAndHappy)
|
||||||
|
|
||||||
if (homogenization_type(material_homogenizationAt2(ce)) == HOMOGENIZATION_RGC_ID) then
|
if (homogenization_type(material_homogenizationAt2(ce)) == HOMOGENIZATION_RGC_ID) then
|
||||||
do co = 1, homogenization_Nconstituents(material_homogenizationAt2(ce))
|
do co = 1, homogenization_Nconstituents(material_homogenizationAt2(ce))
|
||||||
dPdFs(:,:,:,:,co) = phase_mechanical_dPdF(subdt,co,ip,el)
|
dPdFs(:,:,:,:,co) = phase_mechanical_dPdF(subdt,co,ce)
|
||||||
Fs(:,:,co) = phase_mechanical_getF(co,ce)
|
Fs(:,:,co) = phase_mechanical_getF(co,ce)
|
||||||
Ps(:,:,co) = phase_mechanical_getP(co,ce)
|
Ps(:,:,co) = phase_mechanical_getP(co,ce)
|
||||||
enddo
|
enddo
|
||||||
|
|
|
@ -120,12 +120,11 @@ module phase
|
||||||
end subroutine mechanical_restore
|
end subroutine mechanical_restore
|
||||||
|
|
||||||
|
|
||||||
module function phase_mechanical_dPdF(dt,co,ip,el) result(dPdF)
|
module function phase_mechanical_dPdF(dt,co,ce) result(dPdF)
|
||||||
real(pReal), intent(in) :: dt
|
real(pReal), intent(in) :: dt
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
co, & !< counter in constituent loop
|
co, & !< counter in constituent loop
|
||||||
ip, & !< counter in integration point loop
|
ce
|
||||||
el !< counter in element loop
|
|
||||||
real(pReal), dimension(3,3,3,3) :: dPdF
|
real(pReal), dimension(3,3,3,3) :: dPdF
|
||||||
end function phase_mechanical_dPdF
|
end function phase_mechanical_dPdF
|
||||||
|
|
||||||
|
|
|
@ -355,12 +355,11 @@ end subroutine mechanical_init
|
||||||
!> the elastic and intermediate deformation gradients using Hooke's law
|
!> the elastic and intermediate deformation gradients using Hooke's law
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
|
subroutine phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
|
||||||
Fe, Fi, co, ip, el)
|
Fe, Fi, ph, me)
|
||||||
|
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
co, & !< component-ID of integration point
|
ph, &
|
||||||
ip, & !< integration point
|
me
|
||||||
el !< element
|
|
||||||
real(pReal), intent(in), dimension(3,3) :: &
|
real(pReal), intent(in), dimension(3,3) :: &
|
||||||
Fe, & !< elastic deformation gradient
|
Fe, & !< elastic deformation gradient
|
||||||
Fi !< intermediate deformation gradient
|
Fi !< intermediate deformation gradient
|
||||||
|
@ -373,17 +372,15 @@ subroutine phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
|
||||||
real(pReal), dimension(3,3) :: E
|
real(pReal), dimension(3,3) :: E
|
||||||
real(pReal), dimension(3,3,3,3) :: C
|
real(pReal), dimension(3,3,3,3) :: C
|
||||||
integer :: &
|
integer :: &
|
||||||
ho, & !< homogenization
|
d, & !< counter in degradation loop
|
||||||
d, & !< counter in degradation loop
|
i, j
|
||||||
i, j, ph, me
|
|
||||||
|
|
||||||
ho = material_homogenizationAt(el)
|
C = math_66toSym3333(phase_homogenizedC(ph,me))
|
||||||
C = math_66toSym3333(phase_homogenizedC(material_phaseAt(co,el),material_phaseMemberAt(co,ip,el)))
|
|
||||||
|
|
||||||
DegradationLoop: do d = 1, phase_NstiffnessDegradations(material_phaseAt(co,el))
|
DegradationLoop: do d = 1, phase_NstiffnessDegradations(ph)
|
||||||
degradationType: select case(phase_stiffnessDegradation(d,material_phaseAt(co,el)))
|
degradationType: select case(phase_stiffnessDegradation(d,ph))
|
||||||
case (STIFFNESS_DEGRADATION_damage_ID) degradationType
|
case (STIFFNESS_DEGRADATION_damage_ID) degradationType
|
||||||
C = C * phase_damage_get_phi(co,ip,el)**2
|
C = C * damage_phi(ph,me)**2
|
||||||
end select degradationType
|
end select degradationType
|
||||||
enddo DegradationLoop
|
enddo DegradationLoop
|
||||||
|
|
||||||
|
@ -541,7 +538,7 @@ function integrateStress(F,subFp0,subFi0,Delta_t,co,ip,el) result(broken)
|
||||||
B = math_I3 - Delta_t*Lpguess
|
B = math_I3 - Delta_t*Lpguess
|
||||||
Fe = matmul(matmul(A,B), invFi_new)
|
Fe = matmul(matmul(A,B), invFi_new)
|
||||||
call phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
|
call phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
|
||||||
Fe, Fi_new, co, ip, el)
|
Fe, Fi_new, ph, me)
|
||||||
|
|
||||||
call plastic_LpAndItsTangents(Lp_constitutive, dLp_dS, dLp_dFi, &
|
call plastic_LpAndItsTangents(Lp_constitutive, dLp_dS, dLp_dFi, &
|
||||||
S, Fi_new, ph,me)
|
S, Fi_new, ph,me)
|
||||||
|
@ -1263,13 +1260,12 @@ end subroutine mechanical_restore
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Calculate tangent (dPdF).
|
!> @brief Calculate tangent (dPdF).
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module function phase_mechanical_dPdF(dt,co,ip,el) result(dPdF)
|
module function phase_mechanical_dPdF(dt,co,ce) result(dPdF)
|
||||||
|
|
||||||
real(pReal), intent(in) :: dt
|
real(pReal), intent(in) :: dt
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
co, & !< counter in constituent loop
|
co, & !< counter in constituent loop
|
||||||
ip, & !< counter in integration point loop
|
ce
|
||||||
el !< counter in element loop
|
|
||||||
real(pReal), dimension(3,3,3,3) :: dPdF
|
real(pReal), dimension(3,3,3,3) :: dPdF
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
|
@ -1294,12 +1290,12 @@ module function phase_mechanical_dPdF(dt,co,ip,el) result(dPdF)
|
||||||
logical :: error
|
logical :: error
|
||||||
|
|
||||||
|
|
||||||
ph = material_phaseAt(co,el)
|
ph = material_phaseAt2(co,ce)
|
||||||
me = material_phaseMemberAt(co,ip,el)
|
me = material_phaseMemberAt2(co,ce)
|
||||||
|
|
||||||
call phase_hooke_SandItsTangents(devNull,dSdFe,dSdFi, &
|
call phase_hooke_SandItsTangents(devNull,dSdFe,dSdFi, &
|
||||||
phase_mechanical_Fe(ph)%data(1:3,1:3,me), &
|
phase_mechanical_Fe(ph)%data(1:3,1:3,me), &
|
||||||
phase_mechanical_Fi(ph)%data(1:3,1:3,me),co,ip,el)
|
phase_mechanical_Fi(ph)%data(1:3,1:3,me),ph,me)
|
||||||
call phase_LiAndItsTangents(devNull,dLidS,dLidFi, &
|
call phase_LiAndItsTangents(devNull,dLidS,dLidFi, &
|
||||||
phase_mechanical_S(ph)%data(1:3,1:3,me), &
|
phase_mechanical_S(ph)%data(1:3,1:3,me), &
|
||||||
phase_mechanical_Fi(ph)%data(1:3,1:3,me), &
|
phase_mechanical_Fi(ph)%data(1:3,1:3,me), &
|
||||||
|
@ -1324,7 +1320,7 @@ module function phase_mechanical_dPdF(dt,co,ip,el) result(dPdF)
|
||||||
enddo; enddo
|
enddo; enddo
|
||||||
call math_invert(temp_99,error,math_3333to99(lhs_3333))
|
call math_invert(temp_99,error,math_3333to99(lhs_3333))
|
||||||
if (error) then
|
if (error) then
|
||||||
call IO_warning(warning_ID=600,el=el,ip=ip,g=co, &
|
call IO_warning(warning_ID=600, &
|
||||||
ext_msg='inversion error in analytic tangent calculation')
|
ext_msg='inversion error in analytic tangent calculation')
|
||||||
dFidS = 0.0_pReal
|
dFidS = 0.0_pReal
|
||||||
else
|
else
|
||||||
|
@ -1354,7 +1350,7 @@ module function phase_mechanical_dPdF(dt,co,ip,el) result(dPdF)
|
||||||
|
|
||||||
call math_invert(temp_99,error,math_eye(9)+math_3333to99(lhs_3333))
|
call math_invert(temp_99,error,math_eye(9)+math_3333to99(lhs_3333))
|
||||||
if (error) then
|
if (error) then
|
||||||
call IO_warning(warning_ID=600,el=el,ip=ip,g=co, &
|
call IO_warning(warning_ID=600, &
|
||||||
ext_msg='inversion error in analytic tangent calculation')
|
ext_msg='inversion error in analytic tangent calculation')
|
||||||
dSdF = rhs_3333
|
dSdF = rhs_3333
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue