Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
frodal committed Jan 19, 2022
2 parents d78ddaa + a827b21 commit df2ed2b
Show file tree
Hide file tree
Showing 115 changed files with 56,628 additions and 91 deletions.
735 changes: 735 additions & 0 deletions CCCP.f

Large diffs are not rendered by default.

166 changes: 166 additions & 0 deletions CCCPHardening.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
!
! Hardening subroutines for CCCP
!
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
! Preprocessor definitions
!-----------------------------------------------------------------------
#ifndef SCMM_HYPO_CCCP_HARD
#define SCMM_HYPO_CCCP_HARD
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
! Subroutines
!-----------------------------------------------------------------------
! Subroutines should be inlined by the compiler
!-----------------------------------------------------------------------
!DIR$ ATTRIBUTES FORCEINLINE :: VoceMatrix, KalidindiMatrix,
!DIR$& VoceCCCP, KalidindiCCCP
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
! SUBROUTINE VoceMatrix
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
#ifndef SCMM_HYPO_KALIDINDI_ONLY
subroutine VoceMatrix(q,theta1,tau1,theta2,tau2,gamma,hMatrix)
!
implicit none
!
integer, parameter :: alpha = 12
real*8, intent(in) :: q(alpha,alpha),theta1,tau1,theta2,tau2,gamma
real*8, intent(out) :: hMatrix(alpha,alpha)
! Local variables
integer a,b
!-----
do b=1,alpha
do a=1,alpha
hMatrix(a,b) = (theta1*exp(-theta1*gamma/tau1)+
+ theta2*exp(-theta2*gamma/tau2))*q(a,b)
enddo
enddo
!
return
end subroutine VoceMatrix
#endif
!
!-----------------------------------------------------------------------
! SUBROUTINE KalidindiMatrix
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
#ifndef SCMM_HYPO_VOCE_ONLY
subroutine KalidindiMatrix(q,h0,tau_s,am,tau_c,hMatrix)
!
implicit none
!
integer, parameter :: alpha = 12
real*8, intent(in) :: q(alpha,alpha),h0,tau_s,am,tau_c(alpha)
real*8, intent(out) :: hMatrix(alpha,alpha)
! Local variables
real*8, parameter :: one = 1.d0
integer a,b
!-----
do b=1,alpha
do a=1,alpha
hMatrix(a,b) = q(a,b)*h0*abs(one-tau_c(b)/tau_s)**am*
. sign(one,one-tau_c(b)/tau_s)
enddo
enddo
!
return
end subroutine KalidindiMatrix
#endif
!
!-----------------------------------------------------------------------
! SUBROUTINE VoceCCCP
!-----------------------------------------------------------------------
! Update the critical resolved shear stresses/slip resistances
!-----------------------------------------------------------------------
#ifndef SCMM_HYPO_KALIDINDI_ONLY
subroutine VoceCCCP(q,theta1,tau1,theta2,
+ tau2,dfdtau,dlambda,gamma,tau_c)
!
implicit none
!
integer, parameter :: alpha = 12
real*8, intent(in) :: q(alpha,alpha),theta1,tau1,
+ theta2,tau2,dfdtau(alpha),gamma,dlambda
real*8, intent(inout) :: tau_c(alpha)
! Local variables
integer a
!-----
do a=1,alpha
! Voce
tau_c(a)=tau_c(a)+(theta1*exp(-theta1*gamma/tau1)+
+ theta2*exp(-theta2*gamma/tau2))*(q(a,1)*abs(dfdtau(1))+
+ q(a,2)*abs(dfdtau(2))+q(a,3)*abs(dfdtau(3))+
+ q(a,4)*abs(dfdtau(4))+q(a,5)*abs(dfdtau(5))+
+ q(a,6)*abs(dfdtau(6))+q(a,7)*abs(dfdtau(7))+
+ q(a,8)*abs(dfdtau(8))+q(a,9)*abs(dfdtau(9))+
+ q(a,10)*abs(dfdtau(10))+q(a,11)*abs(dfdtau(11))+
+ q(a,12)*abs(dfdtau(12)))*dlambda
enddo
!
return
end subroutine VoceCCCP
#endif
!
!-----------------------------------------------------------------------
! SUBROUTINE KalidindiCCCP
!-----------------------------------------------------------------------
! Updates the critical resolved shear stresses/slip resistances
!-----------------------------------------------------------------------
#ifndef SCMM_HYPO_VOCE_ONLY
subroutine KalidindiCCCP(q,h0,tau_s,am,dfdtau,dlambda,tau_c)
!
implicit none
!
integer, parameter :: alpha = 12
real*8, intent(in) :: q(alpha,alpha),h0,tau_s,am,
+ dfdtau(alpha),dlambda
real*8, intent(inout) :: tau_c(alpha)
! Local variables
real*8 dtau_c(alpha),one
integer a
parameter(one=1.d0)
!-----
do a=1,alpha
! Kalidindi et al.
dtau_c(a)=q(a,1)*abs(dfdtau(1))*h0*abs(one-tau_c(1)/tau_s)**am*
. sign(one,one-tau_c(1)/tau_s)+
+ q(a,2)*abs(dfdtau(2))*h0*abs(one-tau_c(2)/tau_s)**am*
. sign(one,one-tau_c(2)/tau_s)+
+ q(a,3)*abs(dfdtau(3))*h0*abs(one-tau_c(3)/tau_s)**am*
. sign(one,one-tau_c(3)/tau_s)+
+ q(a,4)*abs(dfdtau(4))*h0*abs(one-tau_c(4)/tau_s)**am*
. sign(one,one-tau_c(4)/tau_s)+
+ q(a,5)*abs(dfdtau(5))*h0*abs(one-tau_c(5)/tau_s)**am*
. sign(one,one-tau_c(5)/tau_s)+
+ q(a,6)*abs(dfdtau(6))*h0*abs(one-tau_c(6)/tau_s)**am*
. sign(one,one-tau_c(6)/tau_s)+
+ q(a,7)*abs(dfdtau(7))*h0*abs(one-tau_c(7)/tau_s)**am*
. sign(one,one-tau_c(7)/tau_s)+
+ q(a,8)*abs(dfdtau(8))*h0*abs(one-tau_c(8)/tau_s)**am*
. sign(one,one-tau_c(8)/tau_s)+
+ q(a,9)*abs(dfdtau(9))*h0*abs(one-tau_c(9)/tau_s)**am*
. sign(one,one-tau_c(9)/tau_s)+
+ q(a,10)*abs(dfdtau(10))*h0*abs(one-tau_c(10)/tau_s)**am*
. sign(one,one-tau_c(10)/tau_s)+
+ q(a,11)*abs(dfdtau(11))*h0*abs(one-tau_c(11)/tau_s)**am*
. sign(one,one-tau_c(11)/tau_s)+
+ q(a,12)*abs(dfdtau(12))*h0*abs(one-tau_c(12)/tau_s)**am*
. sign(one,one-tau_c(12)/tau_s)
enddo
tau_c = tau_c+dtau_c*dlambda
!
return
end subroutine KalidindiCCCP
#endif
!-----------------------------------------------------------------------
! End preprocessor definitions
!-----------------------------------------------------------------------
#endif
!-----------------------------------------------------------------------
141 changes: 141 additions & 0 deletions CCCPSubs.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
!
! Helper subroutines for CCCP
!
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
! Preprocessor definitions
!-----------------------------------------------------------------------
#ifndef SCMM_HYPO_CCCP_SUBS
#define SCMM_HYPO_CCCP_SUBS
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
! Subroutines
!-----------------------------------------------------------------------
! Subroutines should be inlined by the compiler
!-----------------------------------------------------------------------
!DIR$ ATTRIBUTES FORCEINLINE :: yieldfunction, yieldgradient, RMAP
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
! SUBROUTINE yieldfunction
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
subroutine yieldfunction(tau,tau_c,rho,m,f)
!
implicit none
!
integer, parameter :: alpha = 12
real*8, intent(in) :: tau(alpha),tau_c(alpha),rho,m
real*8, intent(out) :: f
! Local variables
real*8 temp
real*8 zero,one
parameter(zero=0.d0,one=1.d0)
integer a
!-----
temp = zero
do a = 1,alpha
temp = temp+exp((rho/m)*(abs(tau(a))/tau_c(a)-one))
enddo
f = (one/rho)*log(temp)
!
return
end subroutine yieldfunction
!
!-----------------------------------------------------------------------
! SUBROUTINE yieldgradient
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
subroutine yieldgradient(tau,tau_c,rho,m,
. S,dfdtau,dfdtau_c,dfdsigma)
!
implicit none
!
integer, parameter :: alpha = 12
real*8, intent(in) :: tau(alpha),tau_c(alpha),rho,m,S(alpha,3,3)
real*8, intent(out) :: dfdtau(alpha),dfdtau_c(alpha),dfdsigma(6)
! Local variables
real*8 temp,xmat(3,3)
real*8 zero,one,half
parameter(zero=0.d0,one=1.d0,half=5.d-1)
integer a,j,i
!-----
temp = zero
do a = 1,alpha
temp = temp+exp((rho/m)*(abs(tau(a))/tau_c(a)-one))
dfdtau(a) = (sign(one,tau(a))/tau_c(a))*
. exp((rho/m)*(abs(tau(a))/tau_c(a)-one))
dfdtau_c(a) = -(abs(tau(a))/(tau_c(a))**2)*
. exp((rho/m)*(abs(tau(a))/tau_c(a)-one))
enddo
dfdtau = dfdtau/(m*temp)
dfdtau_c = dfdtau_c/(m*temp)
xmat = zero
do j=1,3
do i=1,3
do a=1,alpha
xmat(i,j)=xmat(i,j)+half*dfdtau(a)*(S(a,i,j)+S(a,j,i))
enddo
enddo
enddo
call mat2vec(xmat,dfdsigma)
!
return
end subroutine yieldgradient
!
!-----------------------------------------------------------------------
! SUBROUTINE RMAP
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
subroutine RMAP(f,dfdtau,dfdtau_c,dfdsigma,C11,C12,C44,hMatrix,
. dlambda)
!
implicit none
!
integer, parameter :: alpha = 12
real*8, intent(in) :: f,dfdtau(alpha),dfdtau_c(alpha),
. dfdsigma(6),C11,C12,C44,
. hMatrix(alpha,alpha)
real*8, intent(out) :: dlambda
! Local variables
real*8 temp1,temp2,temp(6)
real*8 zero,four
parameter(zero=0.d0,four=4.d0)
integer a,b
!-----
temp1 = zero
temp2 = zero
temp(1) = C11*(dfdsigma(1))
+ +C12*(dfdsigma(2))
+ +C12*(dfdsigma(3))
temp(2) = C12*(dfdsigma(1))
+ +C11*(dfdsigma(2))
+ +C12*(dfdsigma(3))
temp(3) = C12*(dfdsigma(1))
+ +C12*(dfdsigma(2))
+ +C11*(dfdsigma(3))
temp(4) = four*C44*(dfdsigma(4))
temp(5) = four*C44*(dfdsigma(5))
temp(6) = four*C44*(dfdsigma(6))
do a=1,6
temp1 = temp1+temp(a)*dfdsigma(a)
enddo
do b=1,alpha
do a=1,alpha
temp2 = temp2+hMatrix(a,b)*abs(dfdtau(b))*dfdtau_c(a)
enddo
enddo
dlambda = f/(temp1-temp2)
!
return
end subroutine RMAP
!-----------------------------------------------------------------------
! End preprocessor definitions
!-----------------------------------------------------------------------
#endif
!-----------------------------------------------------------------------
Loading

0 comments on commit df2ed2b

Please sign in to comment.