1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive.f90"
36 integer,
public,
protected :: &
42 module subroutine plastic_none_init
43 end subroutine plastic_none_init
45 module subroutine plastic_isotropic_init
46 end subroutine plastic_isotropic_init
48 module subroutine plastic_phenopowerlaw_init
49 end subroutine plastic_phenopowerlaw_init
51 module subroutine plastic_kinehardening_init
52 end subroutine plastic_kinehardening_init
54 module subroutine plastic_dislotwin_init
55 end subroutine plastic_dislotwin_init
57 module subroutine plastic_disloucla_init
58 end subroutine plastic_disloucla_init
60 module subroutine plastic_nonlocal_init
61 end subroutine plastic_nonlocal_init
64 module subroutine plastic_isotropic_lpanditstangent(lp,dlp_dmp,mp,instance,of)
65 real(
preal),
dimension(3,3),
intent(out) :: &
67 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
70 real(
preal),
dimension(3,3),
intent(in) :: &
72 integer,
intent(in) :: &
75 end subroutine plastic_isotropic_lpanditstangent
77 pure module subroutine plastic_phenopowerlaw_lpanditstangent(lp,dlp_dmp,mp,instance,of)
78 real(
preal),
dimension(3,3),
intent(out) :: &
80 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
83 real(
preal),
dimension(3,3),
intent(in) :: &
85 integer,
intent(in) :: &
88 end subroutine plastic_phenopowerlaw_lpanditstangent
90 pure module subroutine plastic_kinehardening_lpanditstangent(lp,dlp_dmp,mp,instance,of)
91 real(
preal),
dimension(3,3),
intent(out) :: &
93 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
96 real(
preal),
dimension(3,3),
intent(in) :: &
98 integer,
intent(in) :: &
101 end subroutine plastic_kinehardening_lpanditstangent
103 module subroutine plastic_dislotwin_lpanditstangent(lp,dlp_dmp,mp,t,instance,of)
104 real(
preal),
dimension(3,3),
intent(out) :: &
106 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
109 real(
preal),
dimension(3,3),
intent(in) :: &
111 real(
preal),
intent(in) :: &
113 integer,
intent(in) :: &
116 end subroutine plastic_dislotwin_lpanditstangent
118 pure module subroutine plastic_disloucla_lpanditstangent(lp,dlp_dmp,mp,t,instance,of)
119 real(
preal),
dimension(3,3),
intent(out) :: &
121 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
124 real(
preal),
dimension(3,3),
intent(in) :: &
126 real(
preal),
intent(in) :: &
128 integer,
intent(in) :: &
131 end subroutine plastic_disloucla_lpanditstangent
133 module subroutine plastic_nonlocal_lpanditstangent(lp,dlp_dmp, &
135 real(
preal),
dimension(3,3),
intent(out) :: &
137 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
140 real(
preal),
dimension(3,3),
intent(in) :: &
142 real(
preal),
intent(in) :: &
144 integer,
intent(in) :: &
147 ip, & !< current integration point
149 end subroutine plastic_nonlocal_lpanditstangent
152 module subroutine plastic_isotropic_lianditstangent(li,dli_dmi,mi,instance,of)
153 real(
preal),
dimension(3,3),
intent(out) :: &
155 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
158 real(
preal),
dimension(3,3),
intent(in) :: &
160 integer,
intent(in) :: &
163 end subroutine plastic_isotropic_lianditstangent
166 module subroutine plastic_isotropic_dotstate(mp,instance,of)
167 real(
preal),
dimension(3,3),
intent(in) :: &
169 integer,
intent(in) :: &
172 end subroutine plastic_isotropic_dotstate
174 module subroutine plastic_phenopowerlaw_dotstate(mp,instance,of)
175 real(
preal),
dimension(3,3),
intent(in) :: &
177 integer,
intent(in) :: &
180 end subroutine plastic_phenopowerlaw_dotstate
182 module subroutine plastic_kinehardening_dotstate(mp,instance,of)
183 real(
preal),
dimension(3,3),
intent(in) :: &
185 integer,
intent(in) :: &
188 end subroutine plastic_kinehardening_dotstate
190 module subroutine plastic_dislotwin_dotstate(mp,t,instance,of)
191 real(
preal),
dimension(3,3),
intent(in) :: &
193 real(
preal),
intent(in) :: &
195 integer,
intent(in) :: &
198 end subroutine plastic_dislotwin_dotstate
200 module subroutine plastic_disloucla_dotstate(mp,t,instance,of)
201 real(
preal),
dimension(3,3),
intent(in) :: &
203 real(
preal),
intent(in) :: &
205 integer,
intent(in) :: &
208 end subroutine plastic_disloucla_dotstate
210 module subroutine plastic_nonlocal_dotstate(mp, f, fp,
temperature,timestep, &
212 real(
preal),
dimension(3,3),
intent(in) ::&
214 real(
preal),
dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem),
intent(in) :: &
215 f, & !< deformation gradient
217 real(
preal),
intent(in) :: &
220 integer,
intent(in) :: &
223 ip, & !< current integration point
225 end subroutine plastic_nonlocal_dotstate
228 module subroutine plastic_dislotwin_dependentstate(t,instance,of)
229 integer,
intent(in) :: &
232 real(
preal),
intent(in) :: &
234 end subroutine plastic_dislotwin_dependentstate
236 module subroutine plastic_disloucla_dependentstate(instance,of)
237 integer,
intent(in) :: &
240 end subroutine plastic_disloucla_dependentstate
242 module subroutine plastic_nonlocal_dependentstate(f, fp, instance, of, ip, el)
243 real(
preal),
dimension(3,3),
intent(in) :: &
246 integer,
intent(in) :: &
251 end subroutine plastic_nonlocal_dependentstate
254 module subroutine plastic_kinehardening_deltastate(mp,instance,of)
255 real(
preal),
dimension(3,3),
intent(in) :: &
257 integer,
intent(in) :: &
260 end subroutine plastic_kinehardening_deltastate
262 module subroutine plastic_nonlocal_deltastate(mp,instance,of,ip,el)
263 real(
preal),
dimension(3,3),
intent(in) :: &
265 integer,
intent(in) :: &
270 end subroutine plastic_nonlocal_deltastate
273 module function plastic_dislotwin_homogenizedc(ipc,ip,el) result(homogenizedc)
274 real(
preal),
dimension(6,6) :: &
276 integer,
intent(in) :: &
277 ipc, & !< component-ID of integration point
278 ip, & !< integration point
280 end function plastic_dislotwin_homogenizedc
282 module subroutine plastic_nonlocal_updatecompatibility(orientation,instance,i,e)
283 integer,
intent(in) :: &
287 type(
rotation),
dimension(1,discretization_nIP,discretization_nElem),
intent(in) :: &
289 end subroutine plastic_nonlocal_updatecompatibility
292 module subroutine plastic_isotropic_results(instance,group)
293 integer,
intent(in) :: instance
294 character(len=*),
intent(in) :: group
295 end subroutine plastic_isotropic_results
297 module subroutine plastic_phenopowerlaw_results(instance,group)
298 integer,
intent(in) :: instance
299 character(len=*),
intent(in) :: group
300 end subroutine plastic_phenopowerlaw_results
302 module subroutine plastic_kinehardening_results(instance,group)
303 integer,
intent(in) :: instance
304 character(len=*),
intent(in) :: group
305 end subroutine plastic_kinehardening_results
307 module subroutine plastic_dislotwin_results(instance,group)
308 integer,
intent(in) :: instance
309 character(len=*),
intent(in) :: group
310 end subroutine plastic_dislotwin_results
312 module subroutine plastic_disloucla_results(instance,group)
313 integer,
intent(in) :: instance
314 character(len=*),
intent(in) :: group
315 end subroutine plastic_disloucla_results
317 module subroutine plastic_nonlocal_results(instance,group)
318 integer,
intent(in) :: instance
319 character(len=*),
intent(in) :: group
320 end subroutine plastic_nonlocal_results
325 plastic_nonlocal_updatecompatibility, &
327 constitutive_homogenizedc, &
328 constitutive_dependentstate, &
329 constitutive_lpanditstangents, &
330 constitutive_lianditstangents, &
331 constitutive_initialfi, &
332 constitutive_sanditstangents, &
333 constitutive_collectdotstate, &
334 constitutive_collectdeltastate, &
343 subroutine constitutive_init
346 ph, & !< counter in phase loop
358 call plastic_nonlocal_init
377 write(6,
'(/,a)')
' <<<+- constitutive init -+>>>';
flush(6)
379 constitutive_source_maxsizedotstate = 0
391 constitutive_source_maxsizedotstate = max(constitutive_source_maxsizedotstate, &
394 constitutive_plasticity_maxsizedotstate = maxval(
plasticstate%sizeDotState)
396 end subroutine constitutive_init
403 function constitutive_homogenizedc(ipc,ip,el)
405 real(
preal),
dimension(6,6) :: constitutive_homogenizedc
406 integer,
intent(in) :: &
407 ipc, & !< component-ID of integration point
408 ip, & !< integration point
413 constitutive_homogenizedc = plastic_dislotwin_homogenizedc(ipc,ip,el)
414 case default plasticitytype
416 end select plasticitytype
418 end function constitutive_homogenizedc
424 subroutine constitutive_dependentstate(F, Fp, ipc, ip, el)
426 integer,
intent(in) :: &
427 ipc, & !< component-ID of integration point
428 ip, & !< integration point
430 real(
preal),
intent(in),
dimension(3,3) :: &
431 f, & !< elastic deformation gradient
434 ho, & !< homogenization
435 tme, & !< thermal member position
445 call plastic_dislotwin_dependentstate(
temperature(ho)%p(tme),instance,of)
447 call plastic_disloucla_dependentstate(instance,of)
449 call plastic_nonlocal_dependentstate (f,fp,instance,of,ip,el)
450 end select plasticitytype
452 end subroutine constitutive_dependentstate
460 subroutine constitutive_lpanditstangents(Lp, dLp_dS, dLp_dFi, &
462 integer,
intent(in) :: &
463 ipc, & !< component-ID of integration point
464 ip, & !< integration point
466 real(
preal),
intent(in),
dimension(3,3) :: &
467 s, & !< 2nd Piola-Kirchhoff stress
469 real(
preal),
intent(out),
dimension(3,3) :: &
471 real(
preal),
intent(out),
dimension(3,3,3,3) :: &
474 real(
preal),
dimension(3,3,3,3) :: &
476 real(
preal),
dimension(3,3) :: &
479 ho, & !< homogenization
487 mp = matmul(matmul(transpose(fi),fi),s)
498 call plastic_isotropic_lpanditstangent (lp,dlp_dmp,mp,instance,of)
501 call plastic_phenopowerlaw_lpanditstangent(lp,dlp_dmp,mp,instance,of)
504 call plastic_kinehardening_lpanditstangent(lp,dlp_dmp,mp,instance,of)
507 call plastic_nonlocal_lpanditstangent (lp,dlp_dmp,mp,
temperature(ho)%p(tme),instance,of,ip,el)
510 call plastic_dislotwin_lpanditstangent (lp,dlp_dmp,mp,
temperature(ho)%p(tme),instance,of)
513 call plastic_disloucla_lpanditstangent (lp,dlp_dmp,mp,
temperature(ho)%p(tme),instance,of)
515 end select plasticitytype
518 dlp_dfi(i,j,1:3,1:3) = matmul(matmul(fi,s),transpose(dlp_dmp(i,j,1:3,1:3))) + &
519 matmul(matmul(fi,dlp_dmp(i,j,1:3,1:3)),s)
520 dlp_ds(i,j,1:3,1:3) = matmul(matmul(transpose(fi),fi),dlp_dmp(i,j,1:3,1:3))
523 end subroutine constitutive_lpanditstangents
530 subroutine constitutive_lianditstangents(Li, dLi_dS, dLi_dFi, &
533 integer,
intent(in) :: &
534 ipc, & !< component-ID of integration point
535 ip, & !< integration point
537 real(
preal),
intent(in),
dimension(3,3) :: &
539 real(
preal),
intent(in),
dimension(3,3) :: &
541 real(
preal),
intent(out),
dimension(3,3) :: &
543 real(
preal),
intent(out),
dimension(3,3,3,3) :: &
544 dli_ds, & !< derivative of Li with respect to S
547 real(
preal),
dimension(3,3) :: &
548 my_li, & !< intermediate velocity gradient
551 real(
preal),
dimension(3,3,3,3) :: &
567 call plastic_isotropic_lianditstangent(my_li, my_dli_ds, s ,instance,of)
568 case default plasticitytype
570 my_dli_ds = 0.0_preal
571 end select plasticitytype
574 dli_ds = dli_ds + my_dli_ds
584 case default kinematicstype
586 my_dli_ds = 0.0_preal
587 end select kinematicstype
589 dli_ds = dli_ds + my_dli_ds
594 li = matmul(matmul(fi,li),fiinv)*detfi
595 temp_33 = matmul(fiinv,li)
597 do i = 1,3;
do j = 1,3
598 dli_ds(1:3,1:3,i,j) = matmul(matmul(fi,dli_ds(1:3,1:3,i,j)),fiinv)*detfi
599 dli_dfi(1:3,1:3,i,j) = dli_dfi(1:3,1:3,i,j) + li*fiinv(j,i)
600 dli_dfi(1:3,i,1:3,j) = dli_dfi(1:3,i,1:3,j) +
math_i3*temp_33(j,i) + li*fiinv(j,i)
603 end subroutine constitutive_lianditstangents
609 pure function constitutive_initialfi(ipc, ip, el)
611 integer,
intent(in) :: &
612 ipc, & !< component-ID of integration point
613 ip, & !< integration point
615 real(
preal),
dimension(3,3) :: &
616 constitutive_initialfi
623 constitutive_initialfi =
math_i3
631 constitutive_initialfi = &
633 end select kinematicstype
636 end function constitutive_initialfi
644 subroutine constitutive_sanditstangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el)
646 integer,
intent(in) :: &
647 ipc, & !< component-ID of integration point
648 ip, & !< integration point
650 real(
preal),
intent(in),
dimension(3,3) :: &
651 fe, & !< elastic deformation gradient
653 real(
preal),
intent(out),
dimension(3,3) :: &
655 real(
preal),
intent(out),
dimension(3,3,3,3) :: &
656 ds_dfe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
659 call constitutive_hooke_sanditstangents(s, ds_dfe, ds_dfi, fe, fi, ipc, ip, el)
662 end subroutine constitutive_sanditstangents
669 subroutine constitutive_hooke_sanditstangents(S, dS_dFe, dS_dFi, &
672 integer,
intent(in) :: &
673 ipc, & !< component-ID of integration point
674 ip, & !< integration point
676 real(pReal),
intent(in),
dimension(3,3) :: &
677 Fe, & !< elastic deformation gradient
679 real(pReal),
intent(out),
dimension(3,3) :: &
681 real(pReal),
intent(out),
dimension(3,3,3,3) :: &
682 dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
684 real(pReal),
dimension(3,3) :: E
685 real(pReal),
dimension(3,3,3,3) :: C
687 ho, & !< homogenization
699 end select degradationtype
700 enddo degradationloop
702 e = 0.5_preal*(matmul(transpose(fe),fe)-
math_i3)
706 ds_dfe(i,j,1:3,1:3) = matmul(fe,matmul(matmul(fi,c(i,j,1:3,1:3)),transpose(fi)))
707 ds_dfi(i,j,1:3,1:3) = 2.0_preal*matmul(matmul(e,fi),c(i,j,1:3,1:3))
710 end subroutine constitutive_hooke_sanditstangents
716 subroutine constitutive_collectdotstate(S, FArray, Fi, FpArray, subdt, ipc, ip, el)
718 integer,
intent(in) :: &
719 ipc, & !< component-ID of integration point
720 ip, & !< integration point
722 real(
preal),
intent(in) :: &
724 real(
preal),
intent(in),
dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
725 farray, & !< elastic deformation gradient
727 real(
preal),
intent(in),
dimension(3,3) :: &
729 real(
preal),
intent(in),
dimension(3,3) :: &
731 real(
preal),
dimension(3,3) :: &
734 ho, & !< homogenization
735 tme, & !< thermal member position
736 i, & !< counter in source loop
744 mp = matmul(matmul(transpose(fi),fi),s)
749 call plastic_isotropic_dotstate (mp,instance,of)
752 call plastic_phenopowerlaw_dotstate(mp,instance,of)
755 call plastic_kinehardening_dotstate(mp,instance,of)
758 call plastic_dislotwin_dotstate (mp,
temperature(ho)%p(tme),instance,of)
761 call plastic_disloucla_dotstate (mp,
temperature(ho)%p(tme),instance,of)
764 call plastic_nonlocal_dotstate (mp,farray,fparray,
temperature(ho)%p(tme),subdt, &
766 end select plasticitytype
784 end select sourcetype
788 end subroutine constitutive_collectdotstate
795 subroutine constitutive_collectdeltastate(S, Fe, Fi, ipc, ip, el)
797 integer,
intent(in) :: &
798 ipc, & !< component-ID of integration point
799 ip, & !< integration point
801 real(
preal),
intent(in),
dimension(3,3) :: &
802 s, & !< 2nd Piola Kirchhoff stress
803 fe, & !< elastic deformation gradient
805 real(
preal),
dimension(3,3) :: &
811 mp = matmul(matmul(transpose(fi),fi),s)
818 call plastic_kinehardening_deltastate(mp,instance,of)
821 call plastic_nonlocal_deltastate(mp,instance,of,ip,el)
823 end select plasticitytype
833 end select sourcetype
837 end subroutine constitutive_collectdeltastate
843 subroutine constitutive_results
846 character(len=pStringLen) :: group
851 group = trim(group)//
'/plastic'
877 end subroutine constitutive_results