1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
35 real(
preal),
dimension(:,:,:),
allocatable,
public :: &
37 real(
preal),
dimension(:,:,:),
allocatable :: &
41 type(
rotation),
dimension(:,:,:),
allocatable :: &
43 real(
preal),
dimension(:,:,:,:,:),
allocatable,
public,
protected :: &
44 crystallite_fe, & !< current
"elastic" def grad (end of converged time step)
46 crystallite_s0, & !< 2nd Piola-Kirchhoff stress vector at start of FE inc
52 real(
preal),
dimension(:,:,:,:,:),
allocatable,
public :: &
53 crystallite_s, & !< current 2nd Piola-Kirchhoff stress vector (end of converged time step)
55 crystallite_fp, & !< current plastic def grad (end of converged time step)
57 crystallite_fi, & !< current intermediate def grad (end of converged time step)
61 crystallite_lp, & !< current plastic velocitiy grad (end of converged time step)
63 crystallite_li, & !< current intermediate velocitiy grad (end of converged time step)
65 real(
preal),
dimension(:,:,:,:,:),
allocatable :: &
72 real(
preal),
dimension(:,:,:,:,:,:,:),
allocatable,
public,
protected :: &
74 logical,
dimension(:,:,:),
allocatable,
public :: &
76 logical,
dimension(:,:,:),
allocatable :: &
82 character(len=pStringLen),
allocatable,
dimension(:) :: &
89 ijacolpresiduum, & !< frequency of Jacobian update of residuum in Lp
90 nstate, & !< state loop limit
93 substepmincryst, & !< minimum (relative) size of sub-step allowed during cutback
94 substepsizecryst, & !< size of first substep when cutback
95 substepsizelp, & !< size of first substep when cutback in Lp calculation
96 substepsizeli, & !< size of first substep when cutback in Li calculation
97 stepincreasecryst, & !< increase of next substep size when previous substep converged
98 rtol_crystallitestate, & !< relative tolerance in state loop
99 rtol_crystallitestress, & !< relative tolerance in stress loop
100 atol_crystallitestress
126 logical,
dimension(discretization_nIP,discretization_nElem) :: devnull
128 c, & !< counter in integration point component loop
129 i, & !< counter in integration point loop
130 e, & !< counter in element loop
131 cmax, & !< maximum number of integration point components
132 imax, & !< maximum number of integration points
133 emax, & !< maximum number of elements
136 write(6,
'(/,a)')
' <<<+- crystallite init -+>>>'
171 num%subStepMinCryst =
config_numerics%getFloat(
'substepmincryst', defaultval=1.0e-3_preal)
172 num%subStepSizeCryst =
config_numerics%getFloat(
'substepsizecryst', defaultval=0.25_preal)
173 num%stepIncreaseCryst =
config_numerics%getFloat(
'stepincreasecryst', defaultval=1.5_preal)
178 num%rtol_crystalliteState =
config_numerics%getFloat(
'rtol_crystallitestate', defaultval=1.0e-6_preal)
179 num%rtol_crystalliteStress =
config_numerics%getFloat(
'rtol_crystallitestress',defaultval=1.0e-6_preal)
180 num%atol_crystalliteStress =
config_numerics%getFloat(
'atol_crystallitestress',defaultval=1.0e-8_preal)
187 if(
num%subStepMinCryst <= 0.0_preal)
call io_error(301,ext_msg=
'subStepMinCryst')
188 if(
num%subStepSizeCryst <= 0.0_preal)
call io_error(301,ext_msg=
'subStepSizeCryst')
189 if(
num%stepIncreaseCryst <= 0.0_preal)
call io_error(301,ext_msg=
'stepIncreaseCryst')
191 if(
num%subStepSizeLp <= 0.0_preal)
call io_error(301,ext_msg=
'subStepSizeLp')
192 if(
num%subStepSizeLi <= 0.0_preal)
call io_error(301,ext_msg=
'subStepSizeLi')
194 if(
num%rtol_crystalliteState <= 0.0_preal)
call io_error(301,ext_msg=
'rtol_crystalliteState')
195 if(
num%rtol_crystalliteStress <= 0.0_preal)
call io_error(301,ext_msg=
'rtol_crystalliteStress')
196 if(
num%atol_crystalliteStress <= 0.0_preal)
call io_error(301,ext_msg=
'atol_crystalliteStress')
198 if(
num%iJacoLpresiduum < 1)
call io_error(301,ext_msg=
'iJacoLpresiduum')
200 if(
num%nState < 1)
call io_error(301,ext_msg=
'nState')
201 if(
num%nStress< 1)
call io_error(301,ext_msg=
'nStress')
275 # 283 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
286 real(
preal),
intent(in),
optional :: &
287 dummyargumenttopreventinternalcompilererrorwithgcc
291 niterationcrystallite, &
292 c, & !< counter in integration point component loop
293 i, & !< counter in integration point loop
294 e, & !< counter in element loop
298 # 325 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
323 endif homogenizationrequestscalculation
325 enddo elementlooping1
337 niterationcrystallite = 0
339 niterationcrystallite = niterationcrystallite + 1
410 enddo elementlooping3
428 enddo elementlooping5
439 c, & !< counter in integration point component loop
440 i, & !< counter in integration point loop
441 e, & !< counter in element loop
445 real(
preal),
dimension(3,3) :: devnull, &
446 invsubfp0,invsubfi0,invfp,invfi, &
447 temp_33_1, temp_33_2, temp_33_3, temp_33_4
448 real(
preal),
dimension(3,3,3,3) :: dsdfe, &
460 real(
preal),
dimension(9,9):: temp_99
486 lhs_3333 = 0.0_preal; rhs_3333 = 0.0_preal
488 lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) &
490 lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) &
492 rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) &
497 call io_warning(warning_id=600,el=e,ip=i,g=c, &
498 ext_msg=
'inversion error in analytic tangent calculation')
513 temp_33_1 = transpose(matmul(invfp,invfi))
515 temp_33_3 = matmul(matmul(
crystallite_subf(1:3,1:3,c,i,e),invfp), invsubfi0)
518 rhs_3333(p,o,1:3,1:3) = matmul(dsdfe(p,o,1:3,1:3),temp_33_1)
519 temp_3333(1:3,1:3,p,o) = matmul(matmul(temp_33_2,dlpds(1:3,1:3,p,o)), invfi) &
520 + matmul(temp_33_3,dlids(1:3,1:3,p,o))
527 call io_warning(warning_id=600,el=e,ip=i,g=c, &
528 ext_msg=
'inversion error in analytic tangent calculation')
539 * matmul(invsubfp0, matmul(temp_3333(1:3,1:3,p,o),invfi))
544 temp_33_1 = matmul(
crystallite_s(1:3,1:3,c,i,e),transpose(invfp))
545 temp_33_2 = matmul(invfp,temp_33_1)
554 crystallite_dpdf(1:3,1:3,p,o,c,i,e) =
crystallite_dpdf(1:3,1:3,p,o,c,i,e) &
556 dfpinvdf(1:3,1:3,p,o)),temp_33_1) &
557 + matmul(matmul(temp_33_3,dsdf(1:3,1:3,p,o)), &
559 + matmul(temp_33_4,transpose(dfpinvdf(1:3,1:3,p,o)))
575 c, & !< counter in integration point component loop
576 i, & !< counter in integration point loop
596 endif nonlocalpresent
607 real(
preal),
dimension(3,3),
intent(in) :: tensor33
608 real(
preal),
dimension(3,3) :: t
609 integer,
intent(in):: &
627 real(
preal),
allocatable,
dimension(:,:,:) :: selected_tensors
628 type(
rotation),
allocatable,
dimension(:) :: selected_rotations
629 character(len=pStringLen) :: group,structurelabel
641 'deformation gradient',
'1')
645 'elastic deformation gradient',
'1')
649 'plastic deformation gradient',
'1')
653 'inelastic deformation gradient',
'1')
657 'plastic velocity gradient',
'1/s')
661 'inelastic velocity gradient',
'1/s')
665 'First Piola-Kirchoff stress',
'Pa')
669 'Second Piola-Kirchoff stress',
'Pa')
673 structurelabel =
'iso'
675 structurelabel =
'fcc'
677 structurelabel =
'bcc'
679 structurelabel =
'bct'
681 structurelabel =
'hex'
683 structurelabel =
'ort'
687 'crystal orientation as quaternion',structurelabel)
699 integer,
intent(in) :: instance
700 real(
preal),
dimension(:,:,:,:,:),
intent(in) :: dataset
726 integer,
intent(in) :: instance
727 type(
rotation),
dimension(:,:,:),
intent(in) :: dataset
756 integer,
intent(in):: el, &
759 real(
preal),
optional,
intent(in) :: timefraction
761 real(
preal),
dimension(3,3):: f, &
786 real(
preal),
dimension(9) :: temp_9
787 integer,
dimension(9) :: devnull_9
788 real(
preal),
dimension(9,9) :: drlp_dlp, &
790 real(
preal),
dimension(3,3,3,3):: ds_dfe, &
799 real(
preal) steplengthlp, &
805 integer niterationstresslp, &
806 niterationstressli, &
818 if (
present(timefraction))
then
835 a = matmul(f,invfp_current)
838 steplengthli = 1.0_preal
839 residuumli_old = 0.0_preal
840 liguess_old = liguess
842 niterationstressli = 0
844 niterationstressli = niterationstressli + 1
845 if (niterationstressli>
num%nStress)
return
847 invfi_new = matmul(invfi_current,
math_i3 - dt*liguess)
851 steplengthlp = 1.0_preal
852 residuumlp_old = 0.0_preal
853 lpguess_old = lpguess
855 niterationstresslp = 0
857 niterationstresslp = niterationstresslp + 1
858 if (niterationstresslp>
num%nStress)
return
861 fe = matmul(matmul(a,b), invfi_new)
863 fe, fi_new, ipc, ip, el)
866 s, fi_new, ipc, ip, el)
869 atol_lp = max(
num%rtol_crystalliteStress * max(norm2(lpguess),norm2(lp_constitutive)), &
870 num%atol_crystalliteStress)
871 residuumlp = lpguess - lp_constitutive
873 if (any(ieee_is_nan(residuumlp)))
then
875 elseif (norm2(residuumlp) < atol_lp)
then
877 elseif (niterationstresslp == 1 .or. norm2(residuumlp) < norm2(residuumlp_old))
then
878 residuumlp_old = residuumlp
879 lpguess_old = lpguess
880 steplengthlp = 1.0_preal
882 steplengthlp =
num%subStepSizeLp * steplengthlp
883 lpguess = lpguess_old &
884 + deltalp * steplengthlp
889 if (mod(jacocounterlp,
num%iJacoLpresiduum) == 0)
then
890 jacocounterlp = jacocounterlp + 1
893 dfe_dlp(o,1:3,p,1:3) = a(o,p)*transpose(invfi_new)
895 dfe_dlp = - dt * dfe_dlp
899 call dgesv(9,1,drlp_dlp,9,devnull_9,temp_9,9,ierr)
900 if (ierr /= 0)
return
905 + deltalp * steplengthlp
909 s, fi_new, ipc, ip, el)
912 atol_li = max(
num%rtol_crystalliteStress * max(norm2(liguess),norm2(li_constitutive)), &
913 num%atol_crystalliteStress)
914 residuumli = liguess - li_constitutive
915 if (any(ieee_is_nan(residuumli)))
then
917 elseif (norm2(residuumli) < atol_li)
then
919 elseif (niterationstressli == 1 .or. norm2(residuumli) < norm2(residuumli_old))
then
920 residuumli_old = residuumli
921 liguess_old = liguess
922 steplengthli = 1.0_preal
924 steplengthli =
num%subStepSizeLi * steplengthli
925 liguess = liguess_old &
926 + deltali * steplengthli
931 if (mod(jacocounterli,
num%iJacoLpresiduum) == 0)
then
932 jacocounterli = jacocounterli + 1
934 temp_33 = matmul(matmul(a,b),invfi_current)
936 dfe_dli(1:3,o,1:3,p) = -dt*
math_i3(o,p)*temp_33
937 dfi_dli(1:3,o,1:3,p) = -dt*
math_i3(o,p)*invfi_current
940 dfi_dli(1:3,1:3,o,p) = matmul(matmul(fi_new,dfi_dli(1:3,1:3,o,p)),fi_new)
947 call dgesv(9,1,drli_dli,9,devnull_9,temp_9,9,ierr)
948 if (ierr /= 0)
return
953 + deltali * steplengthli
956 invfp_new = matmul(invfp_current,b)
959 fp_new = fp_new /
math_det33(fp_new)**(1.0_preal/3.0_preal)
960 fe_new = matmul(matmul(f,invfp_new),invfi_new)
963 crystallite_p(1:3,1:3,ipc,ip,el) = matmul(matmul(f,invfp_new),matmul(s,transpose(invfp_new)))
981 NiterationState, & !< number of iterations in state loop
982 e, & !< element index in element loop
983 i, & !< integration point index in ip loop
984 g, & !< grain index in grain loop
991 real(pReal),
dimension(constitutive_plasticity_maxSizeDotState) :: &
993 real(pReal),
dimension(constitutive_source_maxSizeDotState) :: &
998 nonlocalbroken = .false.
1017 nonlocalbroken = .true.
1027 +
sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
1031 iteration:
do niterationstate = 1,
num%nState
1035 niterationstate > 1)
1040 niterationstate > 1)
1050 nonlocalbroken = .true.
1063 nonlocalbroken = .true.
1071 +
plasticstate(p)%previousDotState(:,c) * (1.0_preal - zeta)
1072 residuum_plastic(1:sizedotstate) =
plasticstate(p)%state (1:sizedotstate,c) &
1077 - residuum_plastic(1:sizedotstate)
1087 +
sourcestate(p)%p(s)%previousDotState(:,c)* (1.0_preal - zeta)
1088 residuum_source(1:sizedotstate) =
sourcestate(p)%p(s)%state (1:sizedotstate,c) &
1089 -
sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
1090 -
sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
1093 - residuum_source(1:sizedotstate)
1103 nonlocalbroken = .true.
1121 real(pReal)
pure function damper(current,previous,previous2)
1123 real(preal),
dimension(:),
intent(in) ::&
1124 current, previous, previous2
1126 real(preal) :: dot_prod12, dot_prod22
1128 dot_prod12 = dot_product(current - previous, previous - previous2)
1129 dot_prod22 = dot_product(previous - previous2, previous - previous2)
1130 if ((dot_product(current,previous) < 0.0_preal .or. dot_prod12 < 0.0_preal) .and. dot_prod22 > 0.0_preal)
then
1131 damper = 0.75_preal + 0.25_preal * tanh(2.0_preal + 4.0_preal * dot_prod12 / dot_prod22)
1147 e, & !< element index in element loop
1148 i, & !< integration point index in ip loop
1149 g, & !< grain index in grain loop
1157 nonlocalbroken = .false.
1159 do e = fesolving_execelem(1),fesolving_execelem(2)
1160 do i = fesolving_execip(1),fesolving_execip(2)
1161 do g = 1,homogenization_ngrains(material_homogenizationat(e))
1164 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
1166 call constitutive_collectdotstate(
crystallite_s(1:3,1:3,g,i,e), &
1171 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
1172 do s = 1, phase_nsources(p)
1176 nonlocalbroken = .true.
1179 sizedotstate = plasticstate(p)%sizeDotState
1180 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
1181 + plasticstate(p)%dotState (1:sizedotstate,c) &
1183 do s = 1, phase_nsources(p)
1184 sizedotstate = sourcestate(p)%p(s)%sizeDotState
1185 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
1186 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
1192 nonlocalbroken = .true.
1201 nonlocalbroken = .true.
1231 real(pReal),
dimension(constitutive_plasticity_maxSizeDotState, &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
1233 real(pReal),
dimension(constitutive_source_maxSizeDotState,&
maxval(phase_Nsources), &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
1237 nonlocalbroken = .false.
1239 do e = fesolving_execelem(1),fesolving_execelem(2)
1240 do i = fesolving_execip(1),fesolving_execip(2)
1241 do g = 1,homogenization_ngrains(material_homogenizationat(e))
1244 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
1246 call constitutive_collectdotstate(
crystallite_s(1:3,1:3,g,i,e), &
1251 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
1252 do s = 1, phase_nsources(p)
1256 nonlocalbroken = .true.
1259 sizedotstate = plasticstate(p)%sizeDotState
1261 residuum_plastic(1:sizedotstate,g,i,e) = plasticstate(p)%dotstate(1:sizedotstate,c) &
1263 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
1265 do s = 1, phase_nsources(p)
1266 sizedotstate = sourcestate(p)%p(s)%sizeDotState
1268 residuum_source(1:sizedotstate,s,g,i,e) = sourcestate(p)%p(s)%dotstate(1:sizedotstate,c) &
1270 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
1276 nonlocalbroken = .true.
1285 nonlocalbroken = .true.
1288 call constitutive_collectdotstate(
crystallite_s(1:3,1:3,g,i,e), &
1293 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
1294 do s = 1, phase_nsources(p)
1298 nonlocalbroken = .true.
1302 sizedotstate = plasticstate(p)%sizeDotState
1304 residuum_plastic(1:sizedotstate,g,i,e) = residuum_plastic(1:sizedotstate,g,i,e) &
1308 plasticstate(p)%state(1:sizedotstate,c), &
1309 plasticstate(p)%atol(1:sizedotstate))
1311 do s = 1, phase_nsources(p)
1312 sizedotstate = sourcestate(p)%p(s)%sizeDotState
1314 residuum_source(1:sizedotstate,s,g,i,e) = &
1315 residuum_source(1:sizedotstate,s,g,i,e) + 0.5_preal * sourcestate(p)%p(s)%dotState(:,c) *
crystallite_subdt(g,i,e)
1319 sourcestate(p)%p(s)%state(1:sizedotstate,c), &
1320 sourcestate(p)%p(s)%atol(1:sizedotstate))
1337 real(pReal),
dimension(3,3),
parameter :: &
1339 0.5_preal, 0.0_preal, 0.0_preal, &
1340 0.0_preal, 0.5_preal, 0.0_preal, &
1341 0.0_preal, 0.0_preal, 1.0_preal], &
1343 real(pReal),
dimension(3),
parameter :: &
1344 CC = [0.5_preal, 0.5_preal, 1.0_preal]
1345 real(pReal),
dimension(4),
parameter :: &
1346 B = [1.0_preal/6.0_preal, 1.0_preal/3.0_preal, 1.0_preal/3.0_preal, 1.0_preal/6.0_preal]
1361 nonlocalbroken = .false.
1363 do e = fesolving_execelem(1),fesolving_execelem(2)
1364 do i = fesolving_execip(1),fesolving_execip(2)
1365 do g = 1,homogenization_ngrains(material_homogenizationat(e))
1368 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
1370 call constitutive_collectdotstate(
crystallite_s(1:3,1:3,g,i,e), &
1375 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
1376 do s = 1, phase_nsources(p)
1380 nonlocalbroken = .true.
1385 plasticstate(p)%RK4dotState(stage,:,c) = plasticstate(p)%dotState(:,c)
1386 plasticstate(p)%dotState(:,c) = a(1,stage) * plasticstate(p)%RK4dotState(1,:,c)
1387 do s = 1, phase_nsources(p)
1388 sourcestate(p)%p(s)%RK4dotState(stage,:,c) = sourcestate(p)%p(s)%dotState(:,c)
1389 sourcestate(p)%p(s)%dotState(:,c) = a(1,stage) * sourcestate(p)%p(s)%RK4dotState(1,:,c)
1393 plasticstate(p)%dotState(:,c) = plasticstate(p)%dotState(:,c) &
1394 + a(n,stage) * plasticstate(p)%RK4dotState(n,:,c)
1395 do s = 1, phase_nsources(p)
1396 sourcestate(p)%p(s)%dotState(:,c) = sourcestate(p)%p(s)%dotState(:,c) &
1397 + a(n,stage) * sourcestate(p)%p(s)%RK4dotState(n,:,c)
1401 sizedotstate = plasticstate(p)%sizeDotState
1402 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
1403 + plasticstate(p)%dotState (1:sizedotstate,c) &
1405 do s = 1, phase_nsources(p)
1406 sizedotstate = sourcestate(p)%p(s)%sizeDotState
1407 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
1408 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
1418 nonlocalbroken = .true.
1421 call constitutive_collectdotstate(
crystallite_s(1:3,1:3,g,i,e), &
1426 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
1427 do s = 1, phase_nsources(p)
1431 nonlocalbroken = .true.
1438 sizedotstate = plasticstate(p)%sizeDotState
1440 plasticstate(p)%RK4dotState(4,:,c) = plasticstate(p)%dotState(:,c)
1442 plasticstate(p)%dotState(:,c) = matmul(b,plasticstate(p)%RK4dotState(1:4,1:sizedotstate,c))
1443 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
1444 + plasticstate(p)%dotState (1:sizedotstate,c) &
1447 do s = 1, phase_nsources(p)
1448 sizedotstate = sourcestate(p)%p(s)%sizeDotState
1450 sourcestate(p)%p(s)%RK4dotState(4,:,c) = sourcestate(p)%p(s)%dotState(:,c)
1452 sourcestate(p)%p(s)%dotState(:,c) = matmul(b,sourcestate(p)%p(s)%RK4dotState(1:4,1:sizedotstate,c))
1453 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
1454 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
1460 nonlocalbroken = .true.
1468 nonlocalbroken = .true.
1473 nonlocalbroken = .true.
1492 real(pReal),
dimension(5,5),
parameter :: &
1494 .2_preal, .075_preal, .3_preal, -11.0_preal/54.0_preal, 1631.0_preal/55296.0_preal, &
1495 .0_preal, .225_preal, -.9_preal, 2.5_preal, 175.0_preal/512.0_preal, &
1496 .0_preal, .0_preal, 1.2_preal, -70.0_preal/27.0_preal, 575.0_preal/13824.0_preal, &
1497 .0_preal, .0_preal, .0_preal, 35.0_preal/27.0_preal, 44275.0_preal/110592.0_preal, &
1498 .0_preal, .0_preal, .0_preal, .0_preal, 253.0_preal/4096.0_preal], &
1501 real(pReal),
dimension(6),
parameter :: &
1503 [37.0_preal/378.0_preal, .0_preal, 250.0_preal/621.0_preal, &
1504 125.0_preal/594.0_preal, .0_preal, 512.0_preal/1771.0_preal], &
1506 [2825.0_preal/27648.0_preal, .0_preal, 18575.0_preal/48384.0_preal,&
1507 13525.0_preal/55296.0_preal, 277.0_preal/14336.0_preal, 0.25_preal]
1509 real(pReal),
dimension(5),
parameter :: &
1510 CC = [0.2_preal, 0.3_preal, 0.6_preal, 1.0_preal, 0.875_preal]
1525 real(pReal),
dimension(constitutive_plasticity_maxSizeDotState, &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
1527 real(pReal),
dimension(constitutive_source_maxSizeDotState, &
maxval(phase_Nsources), &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
1531 nonlocalbroken = .false.
1533 do e = fesolving_execelem(1),fesolving_execelem(2)
1534 do i = fesolving_execip(1),fesolving_execip(2)
1535 do g = 1,homogenization_ngrains(material_homogenizationat(e))
1538 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
1540 call constitutive_collectdotstate(
crystallite_s(1:3,1:3,g,i,e), &
1545 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
1546 do s = 1, phase_nsources(p)
1550 nonlocalbroken = .true.
1555 plasticstate(p)%RKCK45dotState(stage,:,c) = plasticstate(p)%dotState(:,c)
1556 plasticstate(p)%dotState(:,c) = a(1,stage) * plasticstate(p)%RKCK45dotState(1,:,c)
1557 do s = 1, phase_nsources(p)
1558 sourcestate(p)%p(s)%RKCK45dotState(stage,:,c) = sourcestate(p)%p(s)%dotState(:,c)
1559 sourcestate(p)%p(s)%dotState(:,c) = a(1,stage) * sourcestate(p)%p(s)%RKCK45dotState(1,:,c)
1563 plasticstate(p)%dotState(:,c) = plasticstate(p)%dotState(:,c) &
1564 + a(n,stage) * plasticstate(p)%RKCK45dotState(n,:,c)
1565 do s = 1, phase_nsources(p)
1566 sourcestate(p)%p(s)%dotState(:,c) = sourcestate(p)%p(s)%dotState(:,c) &
1567 + a(n,stage) * sourcestate(p)%p(s)%RKCK45dotState(n,:,c)
1571 sizedotstate = plasticstate(p)%sizeDotState
1572 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
1573 + plasticstate(p)%dotState (1:sizedotstate,c) &
1575 do s = 1, phase_nsources(p)
1576 sizedotstate = sourcestate(p)%p(s)%sizeDotState
1577 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
1578 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
1588 nonlocalbroken = .true.
1591 call constitutive_collectdotstate(
crystallite_s(1:3,1:3,g,i,e), &
1596 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
1597 do s = 1, phase_nsources(p)
1601 nonlocalbroken = .true.
1608 sizedotstate = plasticstate(p)%sizeDotState
1610 plasticstate(p)%RKCK45dotState(6,:,c) = plasticstate(p)%dotState(:,c)
1611 residuum_plastic(1:sizedotstate,g,i,e) = matmul(db,plasticstate(p)%RKCK45dotState(1:6,1:sizedotstate,c)) &
1613 plasticstate(p)%dotState(:,c) = matmul(b,plasticstate(p)%RKCK45dotState(1:6,1:sizedotstate,c))
1614 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
1615 + plasticstate(p)%dotState (1:sizedotstate,c) &
1618 plasticstate(p)%state(1:sizedotstate,c), &
1619 plasticstate(p)%atol(1:sizedotstate))
1621 do s = 1, phase_nsources(p)
1622 sizedotstate = sourcestate(p)%p(s)%sizeDotState
1624 sourcestate(p)%p(s)%RKCK45dotState(6,:,c) = sourcestate(p)%p(s)%dotState(:,c)
1625 residuum_source(1:sizedotstate,s,g,i,e) = matmul(db,sourcestate(p)%p(s)%RKCK45dotState(1:6,1:sizedotstate,c)) &
1627 sourcestate(p)%p(s)%dotState(:,c) = matmul(b,sourcestate(p)%p(s)%RKCK45dotState(1:6,1:sizedotstate,c))
1628 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
1629 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
1632 converged(residuum_source(1:sizedotstate,s,g,i,e), &
1633 sourcestate(p)%p(s)%state(1:sizedotstate,c), &
1634 sourcestate(p)%p(s)%atol(1:sizedotstate))
1637 nonlocalbroken = .true.
1642 nonlocalbroken = .true.
1651 nonlocalbroken = .true.
1679 logical pure function converged(residuum,state,atol)
1681 real(pReal),
intent(in),
dimension(:) ::&
1682 residuum, state, atol
1686 rtol =
num%rTol_crystalliteState
1688 converged = all(abs(residuum) <= max(atol, rtol*abs(state)))
1699 integer,
intent(in):: &
1711 c = material_phasememberat(ipc,ip,el)
1712 p = material_phaseat(ipc,el)
1714 call constitutive_collectdeltastate(
crystallite_s(1:3,1:3,ipc,ip,el), &
1719 myoffset = plasticstate(p)%offsetDeltaState
1720 mysize = plasticstate(p)%sizeDeltaState
1722 if( any(ieee_is_nan(plasticstate(p)%deltaState(1:mysize,c))))
then
1727 plasticstate(p)%state(myoffset + 1:myoffset + mysize,c) = &
1728 plasticstate(p)%state(myoffset + 1:myoffset + mysize,c) + plasticstate(p)%deltaState(1:mysize,c)
1730 do mysource = 1, phase_nsources(p)
1731 myoffset = sourcestate(p)%p(mysource)%offsetDeltaState
1732 mysize = sourcestate(p)%p(mysource)%sizeDeltaState
1733 if (any(ieee_is_nan(sourcestate(p)%p(mysource)%deltaState(1:mysize,c))))
then
1737 sourcestate(p)%p(mysource)%state(myoffset + 1: myoffset + mysize,c) = &
1738 sourcestate(p)%p(mysource)%state(myoffset + 1: myoffset + mysize,c) + sourcestate(p)%p(mysource)%deltaState(1:mysize,c)
1753 integer(HID_T) :: filehandle, grouphandle
1754 character(len=pStringLen) :: filename, datasetname
1756 write(6,
'(a)')
' writing field and constitutive data required for restart to file';
flush(6)
1758 write(filename,
'(a,i0,a)') trim(getsolverjobname())//
'_',worldrank,
'.hdf5'
1759 filehandle = hdf5_openfile(filename,
'a')
1768 grouphandle = hdf5_addgroup(filehandle,
'constituent')
1769 do i = 1,
size(phase_plasticity)
1770 write(datasetname,
'(i0,a)') i,
'_omega_plastic'
1771 call hdf5_write(grouphandle,plasticstate(i)%state,datasetname)
1773 call hdf5_closegroup(grouphandle)
1775 grouphandle = hdf5_addgroup(filehandle,
'materialpoint')
1776 do i = 1, material_nhomogenization
1777 write(datasetname,
'(i0,a)') i,
'_omega_homogenization'
1778 call hdf5_write(grouphandle,homogstate(i)%state,datasetname)
1780 call hdf5_closegroup(grouphandle)
1782 call hdf5_closefile(filehandle)
1794 integer(HID_T) :: filehandle, grouphandle
1795 character(len=pStringLen) :: filename, datasetname
1797 write(6,
'(/,a,i0,a)')
' reading restart information of increment from file'
1799 write(filename,
'(a,i0,a)') trim(getsolverjobname())//
'_',worldrank,
'.hdf5'
1800 filehandle = hdf5_openfile(filename)
1809 grouphandle = hdf5_opengroup(filehandle,
'constituent')
1810 do i = 1,
size(phase_plasticity)
1811 write(datasetname,
'(i0,a)') i,
'_omega_plastic'
1812 call hdf5_read(grouphandle,plasticstate(i)%state0,datasetname)
1814 call hdf5_closegroup(grouphandle)
1816 grouphandle = hdf5_opengroup(filehandle,
'materialpoint')
1817 do i = 1, material_nhomogenization
1818 write(datasetname,
'(i0,a)') i,
'_omega_homogenization'
1819 call hdf5_read(grouphandle,homogstate(i)%state0,datasetname)
1821 call hdf5_closegroup(grouphandle)
1823 call hdf5_closefile(filehandle)
1843 do i = 1,
size(plasticstate)
1844 plasticstate(i)%state0 = plasticstate(i)%state
1846 do i = 1,
size(sourcestate)
1847 do j = 1,phase_nsources(i)
1848 sourcestate(i)%p(j)%state0 = sourcestate(i)%p(j)%state
1850 do i = 1, material_nhomogenization
1851 homogstate(i)%state0 = homogstate(i)%state
1852 thermalstate(i)%state0 = thermalstate(i)%state
1853 damagestate(i)%state0 = damagestate(i)%state