-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmaterial_law_GTN.for
1194 lines (1054 loc) · 53.3 KB
/
material_law_GTN.for
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
c=======================================================================
c subroutine GTN : Material model according to GURSON, TVERGAARD AND
c NEEDLEMAN (GTN) DAMAGE MODEL
c-----------------------------------------------------------------------
c This subroutine implement the nmerical solution for the GURSON,
c TVERGAARD AND NEEDLEMAN (GTN) DAMAGE MODEL according to the N.Aravas
c article.
c-----------------------------------------------------------------------
c Version 0.9.3
c Oct 2021
c-----------------------------------------------------------------------
c Inputs
c eps6 :epsilon ( current total strain in the form of a vector, latter
c is trasformed to matrix form, the vector comes from the history
c of the properties for the material)
c sdvl : internal state variables (in the form of a vector, contains 3
c ISV`(plastic strain, tensorial internal variable alpha,
c scalar hardening variable alpha)
c Options
c options(1) : type of tangent stiffnes computation
c 0: analytical
c 1: numerical
c options(2): stress_case
c 0: 3D
c 1: Plane stress
c options(3): Material law
c 0: Von Mises
c 1: GTN
c inputmat: vector with the material's intrinsic properties.
c-----------------------------------------------------------------
c Outputs
c sig6: sigma_n+1 (stress at n+1 as a vector)
c A66: algritmic tangent stiffness (ATS) tensor(4 grade tensor as a
c 6x6 tensor)
c sdvup: Updated Internal state variables (the updated 3 ISV of the s
c dvl input vector)
c==================================================================
subroutine kGTN (eps6,D_eps6,sdvl,options,inputmat,sig6,A66,sdvup)
!eps,epsn,epsen
c INCLUDE 'ABA_PARAM.INC'
use tensor_operations
implicit none
c material parameters
external plas_corre_GTN
double precision, dimension(6) :: eps6, D_eps6, epsn6
double precision, dimension(3,3) :: eps, D_eps, epsn, sig
c double precision, dimension(:),intent(in) :: sdvl
double precision, dimension(21) :: sdvl
double precision, dimension(21) :: sdvup
double precision, dimension(15):: inputmat
double precision :: xE ! Young's modulus
double precision :: xnu ! Poisson's ratio
double precision :: xsigy0 ! initial yield stress
double precision :: xHk ! kinematic hardening modulus
double precision :: xhi ! isotropic hardening modulus
double precision :: xmu !shear modulus
double precision :: xk ! bulk modulus
double precision :: q1, q2, q3, f_0, f_n, s_n, E_n, f_c, NU !Parameters GTN model
double precision, dimension (3,3) :: epspn, epsp, epse,epsen !plastic and elastic strain at t0 and t1
double precision, dimension (3,3):: Balphan, Balpha ! (B=bold= Tensor)strain-like ISV that thermodynamically conjugates to the kinematic hardening at time 0 (input) and t+1 (output)
double precision :: alphan, alpha, fn, f, epsp_b, epsp_b_n !(scalar) strain-like ISV that thermodynamically conjugates to the Isotropic hardening at time t (input) and t+1 (output)
double precision, dimension(6,6) :: A66
double precision, dimension(6) :: sig6
double precision, dimension (3,3)::sigtr, dsigtr !deviatoric part of the trial stress tensor
double precision, dimension (3,3)::dsig !deviatoric part of the stress tensor
double precision, dimension (3,3)::d_epsp !<----New
double precision, dimension(3,3,3,3):: P4sym_r !Fouth order identity tensor and deviatoriser tensor
double precision, dimension(3,3,3,3)::C, Cdev, C_e !Elasticity tensor
double precision , dimension (3,3) :: ntr, nxi_a !flow direction from trial state
double precision :: nxitr !norm of xitr (norm of relative stress tensor)
double precision :: phitr,q_tr,p_tr !elastic predictor (or trial stress)
double precision :: Beta1, Beta2 !Term for the ATS
double precision :: gamma !incremental plastic multiplier
c-------------------Auxiliary variables---------------------------------
double precision :: tol =1e-8
integer, dimension (6) :: ii = (/1,2,3,1,2,1/) !Auxiliar iterators
integer, dimension (6) :: jj = (/1,2,3,2,3,3/) !Auxiliar iterators
integer, dimension (3) ::ii_PS = (/1,2,2/)
integer, dimension (3) ::jj_PS = (/1,2,1/)
integer ::i, j, ATStype, Mat_L, str_case, rec,pru !Iterators and selectors
integer, dimension (3) :: options
double precision, dimension (3,3):: xid !Identity
real:: e, t1(2), t2(2)
double precision:: time_su (5,2)
c Especific variables according to the article N. ARAVAS, 1987
double precision :: q, p, sig_0, d_sig_0_d_epsp_b
double precision, dimension (3,3) :: D_eps3
c s_ve_33
double precision ::D_eps_p, D_eps_q !p: hydrotatyx stress and equivalent stress
double precision:: dg_dp, dg_dq, d2g_d2p, d2g_d2q, d2g_dpdq
c=======================================================================
c Retrieve material parameters
c=======================================================================
xE = inputmat(1) !Young's modulus
xnu = inputmat(2) !Poison
xsigy0 = inputmat(3) !Yield point
xHk = inputmat(4) !Kinematic hardeniing parameter
xhi = inputmat(5) !Isotropic hardeniing parameter
q1 = inputmat(6)
q2 = inputmat(7)
q3 = inputmat(8)
f_0 = inputmat(9)
f_n = inputmat(10)
s_n = inputmat(11)
E_n = inputmat(13)
!
xmu = xE/(2.0*(1.0+xnu)) !mu or G: Elastic Shear moduli
xk = xE/(3.0*(1.0-2.0*xnu)) !k: Compression (Bulk) Moduli
c=======================================================================
c Retrieve option parameters
c=======================================================================
ATStype=options(1) !type of tangent stiffnes computation
str_case=options(2) !stress_case
Mat_L=options(3) !Material law
c=======================================================================
c Retrieve strain drive of the current step and last step
c=======================================================================
if (str_case==0) then
c=======================================================================
c 3D
c=======================================================================
c-----Current strain drive input to compute stresses, ATS and ISV-------
eps = reshape((/eps6(1), eps6(4)/2.0, eps6(6)/2.0,
$ eps6(4)/2.0, eps6(2), eps6(5)/2.0,
$ eps6(6)/2.0, eps6(5)/2.0, eps6(3)/),
$ shape(eps), order=(/2,1/))
c---------------Strain drive input of the previous step-----------------
c <----------------------------------------------------------------------Change to implement and review
epsn6=eps6-D_eps6
epsn = reshape((/epsn6(1), epsn6(4)/2.0, epsn6(6)/2.0,
$ epsn6(4)/2.0, epsn6(2), epsn6(5)/2.0,
$ epsn6(6)/2.0, epsn6(5)/2.0, epsn6(3)/),
$ shape(eps), order=(/2,1/))
D_eps=eps-epsn
c <----------------------------------------------------------------------Change until here to implement and review
c--------------------plastic strain at t0-------------------------------
epspn = reshape((/sdvl(1), sdvl(4)/2.0, sdvl(6)/2.0,
$ sdvl(4)/2.0, sdvl(2), sdvl(5)/2.0,
$ sdvl(6)/2.0, sdvl(5)/2.0, sdvl(3)/),
$ shape(epspn), order=(/2,1/))
c-------------------------Elastic strain--------------------------------
epsen = reshape((/sdvl(1+13), sdvl(4+13)/2.0,sdvl(6+13)/2.0,
$ sdvl(4+13)/2.0,sdvl(2+13), sdvl(5+13)/2.0,
$ sdvl(6+13)/2.0,sdvl(5+13)/2.0,sdvl(3+13)/),
$ shape(epspn), order=(/2,1/))
elseif (str_case==1) then
c=======================================================================
c PLANE STRESS
c=======================================================================
c-----Current strain drive input to compute stresses, ATS and ISV-------
eps(1,1) = eps6(1)
eps(2,2) = eps6(2)
eps(1,2) = eps6(3)/2.0
eps(2,1) = eps6(3)/2.0
c---------------Strain drive input of the previous step-----------------
c <----------------------------------------------------------------------Change to implement and review
epsn6=eps6-D_eps6
epsn(1,1) = epsn6(1)
epsn(2,2) = epsn6(2)
epsn(1,2) = epsn6(3)/2.0
epsn(2,1) = epsn6(3)/2.0
epsn(1,3) = 0.0; epsn(2,3) = 0.0; epsn(3,1) = 0.0
epsn(3,2) = 0.0; epsn(3,3) = 0.0
c epsn(3,1:3,3)=(/0.0, 0.0 ,0.0/)
D_eps=eps-epsn
c--------------------plastic strain at t0-------------------------------
epspn(1,1) = sdvl(1)
epspn(2,2) = sdvl(2)
epspn(1,2) = sdvl(3)/2.0
epspn(2,1) = sdvl(3)/2.0
epspn(1,3) = 0.0; epspn(2,3) = 0.0; epspn(3,1) = 0.0
epspn(3,2) = 0.0; epspn(3,3) = 0.0
c-------------------------Elastic strain--------------------------------
epsen(1,1) = sdvl(1+13)
epsen(2,2) = sdvl(2+13)
epsen(1,2) = sdvl(3+13)/2.0
epsen(2,1) = sdvl(3+13)/2.0
epsen(1,3) = 0.0; epsen(2,3) = 0.0; epsen(3,1) = 0.0
epsen(3,2) = 0.0; epsen(3,3) = 0.0
end if
c=======================================================================
c Retrieve Internal State variables (last step)
c=======================================================================
c --------strain-like ISV that thermodynamically conjugates-------------
c---------------to the kinematic hardening at time t--------------------
Balphan = reshape((/sdvl(1+6), sdvl(4+6)/2, sdvl(6+6)/2.0,
$ sdvl(4+6)/2.0, sdvl(2+6), sdvl(5+6)/2.0,
$ sdvl(6+6)/2.0, sdvl(5+6)/2.0, sdvl(3+6)/),
$ shape(Balphan), order=(/2,1/))
c--------strain-like ISV that thermodynamically conjugates--------------
c---------------- to the sotropic hardening at time t-------------------
alphan = sdvl(13)
c-----------------------Void volume fraction----------------------------
fn = sdvl(20)
c--------------microscopic equivalent plastic strain--------------------
epsp_b_n= sdvl(21)
c=======================================================================
c Start computations
c=======================================================================
cFill the identity and deviatoriser tensor
call Ident1(xid,3)
call P4sym(P4sym_r)
call Iso_hard1(epsp_b_n, sig_0, d_sig_0_d_epsp_b, inputmat)
c sig_0=xsigy0
pru=0
c=======================================================================
c Elastic prediction
c=======================================================================
call dtime(t1,e) ! Startup etime - do not use result
!Mat_L=0 : VM, Mat_L=1 : GTN
if (Mat_L==0) then
call trial_step (eps,epspn,xmu,xHk,Balphan,alphan,xhi,
& xsigy0, phitr, dsigtr, ntr, nxitr)
else
call trial_step_GTN (eps,epsn,epsen,xmu,xk,phitr, sig_0,
& ntr,q1,q2,q3,fn,dsigtr,sigtr, q_tr,p_tr)
end if
call dtime(t1,e)
time_su(1,:)=t1
c Evalate if it is required a elastic or elastic-plastic step
if (phitr<tol) then !Tol is a number very close to zero
!print*, "elastic"
sig=sigtr
dsig=dsigtr
Beta1=1.0
Beta2=1.0
Balpha=Balphan
alpha=alphan
epsp=epspn
epse=eps
f=fn
epsp_b=epsp_b_n
if (ATStype==0) then
Cdev=2.0*xmu*P4sym_r
endif
if (Mat_L==0) then
c-------------------Update stress---------------------------------------
c-----------Addition of spherical contribution to stress----------------
sig=dsig+xk*Trace(eps)*xid
epse=eps-epsp
C=Cdev+xk*diadic_prod_T2_T2(xid,xid)
end if
if (Mat_L==1) then
c-------------------Update stress---------------------------------------
c-----------Addition of spherical contribution to stress----------------
epse=eps-epsp
C=Cdev+xk*diadic_prod_T2_T2(xid,xid)
call m4th_2_66_sym (C, A66)
end if
c=======================================================================
c plastic correction
c=======================================================================
call dtime(t2,e)
else
c Mat_L=0 : VM, Mat_L=1 : GTN
if (Mat_L==0) then
!print*, "plastic return VM"
call plas_corre_VM (phitr, xmu, xHk, xhi,dsig, dsigtr,ntr,
& nxitr, epsp, epspn, Balpha, Balphan, alpha, alphan,
& beta1,beta2 )
if (ATStype==0) then
Cdev=2*xmu*beta1*P4sym_r-2*xmu*beta2*diadic_prod_T2_T2
$ (ntr,ntr)
c------------ -------Update stress---------------------------------------
c-----------A ddition of spherical contribution to stress----------------
sig=dsig+xk*Trace(eps)*xid
epse=eps-epsp
C=Cdev+xk*diadic_prod_T2_T2(xid,xid)
end if
c------------------Algorithmic Tangen Stifness-------------------------
else
rec=1
call plas_corre_GTN (rec, q_tr,p_tr, sigtr,inputmat,fn,
& dsigtr, phitr, epsp_b,eps, D_eps, epsp, epse, Balpha,
& alpha,sig_0,sig,dsig,f, ATStype, str_case, epspn, epsp_b_n,
& A66, plas_corre_GTN)
end if
end if
call dtime(t2,e)
time_su(2,:)=t2
c=======================================================================
c Retrieve condensed form of tensors to export information
c=======================================================================
if (ATStype==0 .and. Mat_L==0 ) then
c-----------------restore stiffness tensor as matrix--------------------
c Due to the symmetry the tangent stiffness 4 grade tensor can be
c expressed as a 6x6 matrix
call m4th_2_66_sym (C, A66)
end if
c=======================================================================
c 3D
c=======================================================================
c-----------------------stress tensor as vector-------------------------
if (str_case==0) then
do i=1,6
sig6(i) = sig(ii(i),jj(i))
end do
c---------------------- store ISV as vector-----------------------------
c-------------------------plastic strain--------------------------------
sdvup(1:6) =(/epsp(1,1), epsp(2,2), epsp(3,3),
$ 2.0*epsp(1,2), 2.0*epsp(2,3), 2.0*epsp(1,3)/)
c---------------------------Back stress---------------------------------
sdvup(7:12)=(/Balpha(1,1), Balpha(2,2), Balpha(3,3),
$ 2.0*Balpha(1,2), 2.0*Balpha(2,3), 2.0*Balpha(1,3)/)
sdvup(14:19)=(/epse(1,1), epse(2,2), epse(3,3),
$ 2.0*epse(1,2), 2.0*epse(2,3), 2.0*epse(1,3)/)
elseif (str_case==1) then
c=======================================================================
c Plane stress
c=======================================================================
do i=1,3
sig6(i) = sig(ii_PS(i),jj_PS(i))
end do
c---------------------- store ISV as vector-----------------------------
c-------------------------plastic strain--------------------------------
sdvup(1:3) =(/epsp(1,1), epsp(2,2), 2.0*epsp(1,2)/)
c---------------------------Back stress---------------------------------
sdvup(7:9)=(/Balpha(1,1), Balpha(2,2), 2.0*Balpha(1,2)/)
sdvup(14:16)=(/epse(1,1), epse(2,2), 2.0*epse(1,2)/)
end if
c--------------------------drag stress----------------------------------
sdvup(13) = alpha
sdvup(20)=f
sdvup(21)=epsp_b
end subroutine kGTN
c==================================================================
c subroutine trial_step (eps,epspn,xmu,xHk,Balphan,alphan,xhi,
c xsigy0, phitr, dsigtr, ntr, nxitr)
c------------------------------------------------------------------]
c Inputs
c eps : stain tensor
c epspn : plastic strain tensor
c xmu : shear modulus
c xHk : kinematic hardening modulus, scalar
c Balphan: tensorial internal variable alpha
c alphan: scalar hardening variable alpha
c xh : isotropic hardening modulus, scalar
c xsigy0: initial yield stress, uniaxial test
c-----------------------------------------------------------------
c Outputs
c phitr : trial yield function
c dsigtr : deviatoric part of the trial stress tensor
c ntr : flow direction from trial state
c nxitr : norm of xitr
c------------------------------------------------------------------------
c coded by: W. Mora Sep 2021
c=======================================================================
subroutine trial_step (eps,epspn,xmu,xHk,Balphan,alphan,xhi,
$ xsigy0, phitr, dsigtr, ntr, nxitr)
c INCLUDE 'ABA_PARAM.INC'
use tensor_operations
implicit none
double precision, dimension (3,3) :: eps, xid,deps, dsigtr,
$ Bbetatr,Balphan, epspn
double precision:: betatr, xHk, xhi, xmu, alphan, xsigy0
double precision, dimension (3,3) :: xitr !trial value of deviatoric stress difference
double precision :: nxitr !norm of xitr
double precision , dimension (3,3) :: ntr !flow direction from trial state
double precision :: phitr !trial value of the yield function
call Ident1(xid,3)
!deviatoric part of the strain tensor
deps = eps - Trace(eps)*xid/3.0
!deviatoric part of the trial stress tensor
dsigtr = 2.0*xmu*(deps-epspn)
!trial value of the back-stress tensor
Bbetatr = xHk*Balphan
!trial value of the increase in yield stress (scalar beta: drag stress)
betatr =xhi*alphan
!trial value of deviatoric stress difference
xitr =dsigtr-Bbetatr
!norm of xitr
nxitr = (contrac_2nd_2nd(xitr,xitr))**0.5
!flow direction from trial state
ntr = xitr/nxitr
c-----------------------trial yield function----------------------------
phitr = nxitr-(2.0/3.0)**(0.5)*(xsigy0+betatr)
end subroutine trial_step
c=======================================================================
c subroutine trial_step_GTN (eps,epsn,epsen,xmu,xk,phitr, sig_0,ntr)
c=======================================================================
c=======================================================================
c Inputs
c eps : stain tensor acording to load
c epsn : strain tensor last step
c epsen : elastic strain tensor last step
c xmu : shear moduli
c xk : Bulk moduli
c phitr : trial yield function
c sig_0 : equivalent tensile flow stress
c ntr : normalized flow direction from trial state (according to article)
c------------------------------------------------------------------------
c coded by: W. Mora Sep 2021
c=======================================================================
subroutine trial_step_GTN (eps,epsn,epsen,xmu,xk,phitr, sig_0,
$ n_a_tr,q1,q2,q3,f,dsig_tr,sig_e_tr, q_tr,p_tr)
c INCLUDE 'ABA_PARAM.INC'
use tensor_operations
implicit none
double precision, dimension (3,3) :: eps, epsn, xid,deps,
$ dsigtr,sig_e_tr, sig_test
double precision:: xhi, xmu,xk, alphan, sig_0, q1, q2,q3
double precision, dimension (3,3) :: xitr, dsig_tr !trial value of deviatoric stress difference
double precision , dimension (3,3) :: s_tr, n_a_tr !flow direction from trial state
double precision , dimension (3,3) :: C_e !Elasticity tensor in voigth notation due to simmetry
double precision :: phitr, q_tr, p_tr, f !trial value of the yield function
double precision , dimension (3,3) :: epsen !elastic strain last step
double precision , dimension (3,3):: D_eps !Change strain
!Variables plain strain
double precision:: pe
double precision , dimension (3,3)::D_eps_b !Delta Strain in the plane of stressing
double precision , dimension (3,3)::dD_eps_b !viatoric of D_eps_b
double precision , dimension (3,3)::D_epse !Delta elastic eps
double precision , dimension (3,3):: depse !Deviatoric elastic eps
double precision , dimension (3,3)::a,ad !e3e3 and its deviatoric
call Ident1(xid,3)
!Elasticity tensor
C_e=2.0*xmu*Xid
!Change strain in the step
D_eps=eps-epsn
!Elastic predictor (trial). All the strain is supoused to be elastic
sig_e_tr=C_e*(epsen+D_eps)
!trial values for p, s and q
p_tr= - 1.0/3.0*Trace(sig_e_tr)
dsig_tr=sig_e_tr-1.0/3.0*Trace(sig_e_tr)*xid
q_tr=(3.0/2.0*contrac_2nd_2nd(dsig_tr,dsig_tr))**0.5
!norm according to the article
n_a_tr = 3.0/2.0*dsig_tr/q_tr
sig_test=-p_tr*xid+(2.0/3.0)*q_tr*n_a_tr
phitr = (q_tr/sig_0)**2+2.0*q1*f*cosh(-3.0*q2*p_tr/
& (2.0*sig_0))-(1.0+q3*f**2)
end subroutine trial_step_GTN
c=======================================================================
c subroutine plas_corre_VM (phitr, xmu, xHk, xhi,dsig, dsigtr,ntr,
c epsp, epspn, Balpha, Balphan, alpha, alphan)
c=======================================================================
c
c------------------------------------------------------------------------
c coded by: W. Mora Sep 2021
c=======================================================================
subroutine plas_corre_VM (phitr, xmu, xHk, xhi,dsig, dsigtr,ntr,
& nxitr, epsp, epspn, Balpha, Balphan, alpha, alphan,beta1,beta2)
c INCLUDE 'ABA_PARAM.INC'
implicit none
double precision, dimension (3,3) :: dsig, dsigtr,ntr,
& epsp, epspn, Balpha, Balphan
double precision :: phitr, xmu, xHk, alpha, alphan, beta1, beta2,
& gamma,xhi, nxitr
gamma=phitr/(2.0*xmu+xHk+2.0*xhi/3.0)
dsig=dsigtr-2.0*xmu*gamma*ntr
epsp=epspn+(dsigtr-dsig)/(2*xmu) !This is the same, you can solve from the avobe equation this expression
Balpha = Balphan+gamma*ntr ! tensorial internal variable alpha
alpha = alphan+(2.0/3.0)**(0.5)*gamma !scalar hardening variable alpha
beta1=1.0-(phitr/nxitr)*(1.0/(1.0+xHk/(2.0*xmu)+
$ xhi/(3.0*xmu)))
beta2=(1.0-phitr/nxitr)*(1.0/(1.0+xHk/(2.0*xmu)+
$ xhi/(3.0*xmu)))
end subroutine plas_corre_VM
c=======================================================================
c subroutine plas_corre_GTN (q, p, sig,inputmat,fn, dsig,PHI,
c d_epsp, epsp_b,epsp,epse)
c=======================================================================
c=======================================================================
c Inputs
c q : hydrostac stress trial
c p : equivalent stress trial
c sig : stress trial
c inputmat : vector with the material's intrinsic properties.
c fn : void fraction trial
c dsig : deviatoric stress trial
c PHI : yield suface trial
c-----------------------------------------------------------------------
c Outputs
c phitr :
c------------------------------------------------------------------------
c coded by: W. Mora Oct 2021
c=======================================================================
subroutine plas_corre_GTN (rec, q,p, sig,inputmat,f, dsig,phi,
& epsp_b,eps,D_eps, epsp, epse, Balpha, alpha, sig_0, sig1,
& dsig1,f1,ATStype, str_case, epspn, epsp_b_n, ATS66,dumbsub)
c INCLUDE 'ABA_PARAM.INC'
use tensor_operations
implicit none
external dumbsub
c Especific variables according to the article N. ARAVAS, 1987
!Parameters material
double precision, dimension (15)::inputmat
!Material parameters
double precision :: q, p, sig_0, q1, q2, q3,f,f1, xE,
& xsigy0, xk, xmu, xnu, q_e, p_tr, q_tr
double precision :: f_c, f_s, f_f, df_s_df, k_b, f_su !Parameters GTN model (Needleman part)
double precision ::A_c
!Change of parameter between steps
double precision ::D_eps_p, D_eps_q, D_epsp_b,D_f, D_eps_pn,
& D_eps_qn
double precision, dimension (3,3) ::D_epsp,D_epspn1, dsig,
& dsig_e, D_eps
!Current value of ISV
double precision :: epsp_b, epsp_b1, alpha, alphan ! microscopic equivalent plastic strain
double precision, dimension (3,3) ::sig ,epsp, eps, epsn,
& eps_pp, epse, n_a, sign_l, Balpha, Balphan, sig1,dsig1
!derivates defined in article of real type
double precision:: dg_dp, dg_dq, d2g_d2p, d2g_d2q, d2g_dpdq,
& d2g_dpdf, d2g_dqdf, d2g_dq_d_epsp,
& dDf_dDeps_p, dDepsp_b_dDeps_p, dDf_dDeps_q, dDepsp_b_dq,
& dDf_dp, dDepsp_b_dDeps_q, dPHI_dp, dPHI_dq, dPHI_df,
& dPHI_d_epsp_b, d_epsp_b_dDeps_p, d_epsp_b_dp, dDepsp_b_dp,
& A11, A12, A21, A22, b1, b2, PHI, A11_D, A12_D, A21_D,
& A22_D, B11_D, B12_D, B21_D, B22_D, b1_D, b2_D, df_dp,
& d_epsp_dp, d_epsp_b_dq, df_dq, d_epsp_dq, df_d_epsp_b,
& d2g_dq_d_epsp_b, d2g_dp_d_epsp, d2g_dp_d_epsp_b,
& df_dDeps_p, dH_alpha_dDeps_p, dDf_dq, df_dDeps_q,
& dH_alpha_dDeps_q, d_epsp_b_dDeps_q, d_sig0_d_f,
& d_sig0_d_epsp_b, dA_d_epsp_b, dDepsp_b_df, d2g_dqdsig_0,
& dDf_d_epsp_b, dDf_df,dDepsp_b_d_epsp_b, NU,
& d_sig_0_d_epsp_b
!derivates defined in article of tensorial (3,3) type
double precision, dimension (3,3) :: dDepsp_dDeps_p,
& dDepsp_dp,d_epsp_dDeps_p, dDepsp_dDeps_q, dDepsp_dq,
& d_epsp_dDeps_q, dPHI_d_epsp
double precision, dimension (3,3,1) :: dou_sum1_P2,
& dou_sum2_P2
!Secondary derivatives and variables
double precision:: c_f_f, c_f_epsp, c_f_epsp_b
& , c_epsp_b_epsp , c_epsp_b_f, c_epsp_b_epsp_b
& , sum1, sum2, sum3, sum4 , dou_sum1, dou_sum1_P1,
& dou_sum2, dou_sum3, dou_sum4, dou_sum5, dou_sum6,
& sum32, sum42,
& dou_sum7, dou_sum8 , dD_eps_p,dD_eps_q
double precision, dimension (3,3) :: nxi_a,
& c_epsp_f, c_epsp_epsp, c_epsp_epsp_b, D_sig
!Parameters nucleation
double precision :: f_0, f_n, s_n, E_n ! E_n: mean value Parameter used in the nucleation equations
!Auxiliar variables
double precision, dimension (3,3) :: xid, Delta_sig66
double precision :: pi, tol_conv_cor,conv_D_eps_p,
& conv_D_eps_q, pert, con, ATS_ave
double precision, dimension(2,2) :: M,M_inv,ML,MR,dD_eps_pq
double precision, dimension(2) :: b_v, c_corr
double precision, dimension(6) :: eps6_pp, sig6_pp,
& Delta_sig6
double precision, dimension(6,6) :: ATS66,A66_t,
& C_e66_tem
double precision, dimension(3,3,3,3)::C, Cdev, C_e, C_e_inv,
& M_4T, ATS, dn_d_sig,I4dikdjl_r,I4dijdkl_r
integer :: iterartion, i,j, rc,sc, ATStype, str_case,rec
double precision :: Beta1, Beta2, tol
integer, dimension(6):: ii, jj
c Variables for plane stress elastoplastic equations
c
double precision ::A23_PS, A31_PS, A32_PS, A33_PS, b3_PS,
& A13_PS, D_eps3, dev_e_33, dq_dDeps3, pe, D_eps3n,
& conv_d_eps3, ome31, ome32, ome33
double precision, dimension(3,3) :: M_ps, M_ps_inv,D_eps_b,
& dD_eps_b, depse, se, a, da, ATS_PS
double precision, dimension(3) :: b_ps_v, c_corr_ps
!Auxiliar variables
double precision::conv_D_eps_p_ps, conv_D_eps_q_ps,D_eps11,
& D_eps22
double precision, dimension (3,3) :: sigtr, dsigtr, epsen,
& epspn, ntr
double precision:: epsp_b_n, fn, phitr
c rec : number of recursive iterations
c ATStype : Type of computation of algorithmic tangent
c str_case : Tyoe of analysis 3D or plane stress
c conv_ : convergence
c PS : variable for the plane stress case
c D_ or D.. : : Delta
c D_ : variable used in computation of ATS lineaation module
c d: : derivative, total or partial depending of the context
c d2 : second derivative, total or partial depending of the context
c sum ;auxiliary variable to store the result of a summatory
c dou_sum :auxiliary variable store the result of a double summatory
c _P1, _P2 : auxiliary variable to assign the part of a long equation
c eps : total strain
c epse : elastic strain
c epsp : plastic strain
c epsp_b : microscopic eqivalent platic strain
c ..tr : trial value
c ATS : Algorithmic tangent stiffness 4th order tensor
c ATS66 : ATS retrieved in 6x6 2nd order tensor
c A66_t : auxiliary ATS66 matrix to run the recursive code
c p : hydrotatic stress
c q : equivalent stress
c dsig : stress deviatoric
c A_c : Parmeter for nucleation strain Chu and Needleman
c M_4T : Variable M, 4th order tensor used in solutions ATS
c M,ML, MR : matrix representing linear systems of equations (LSE)
c b : colum vector independent terms LSE.
c iterartion : iterator
c i,j, rc,sc : iterators
c f_s : f* function of the void volume fraction
c f_su : ultimate value of f* at ductile rupture
c k_b : Relation in the Needleman model
c f_c : critical void volume at which coids coalesce
c f_F : void volume fraction at final failure of the
xE = inputmat(1)
xnu = inputmat(2) !Poison
xsigy0 = inputmat(3) !Yield point
q1 = inputmat(6)
q2 = inputmat(7)
q3 = inputmat(8)
f_0 = inputmat(9)
f_n = inputmat(10)
s_n = inputmat(11)
f_f = inputmat(12)
E_n = inputmat(13)
f_c = inputmat(14)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Constants
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
xmu = xE/(2.0*(1.0+xnu)) !(G)Shear modulus
xk = xE/(3.0*(1-2.0*xnu)) !(K) Compression Modulus
call Ident1(xid,3)
pi=4.D0*DATAN(1.D0)
tol_conv_cor=0.5e-10
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Initial values to start iteration
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
f_su=1.0/q1
k_b=(f_su-f_c)/(f_F-f_c)
if (f .le. f_c) then
df_s_df=1
f_s=f
else
df_s_df=k_b
f_s=f_c+k_b*(f-f_c)
end if
PHI=(q/sig_0)**2+2.0*f*q1*cosh(-3.0*q2*p/(2.0*sig_0))
& -(1.0+q3*f**2)
if (str_case==0) then
c-----------------------------------------------------------------------
c THREE DIMENSIONAL GEOMETRIES
c-----------------------------------------------------------------------
c return direction (only depends on the trial step)
dsig_e=sig-Trace(sig)*xid
q_e=(3.0/2.0*contrac_2nd_2nd(dsig_e,dsig_e))**0.5
n_a=3.0/2.0*dsig_e/q_e !<--------This is computed only with the trial values, does not include correction. Last equation of page 1399
p_tr=p
q_tr=q
sig1=sig
else
c-----------------------------------------------------------------------
c PLAIN STRAIN CASE
c-----------------------------------------------------------------------
PHI=(q/sig_0)**2+2.0*f*q1*cosh(-3.0*q2*p/(2.0*sig_0))
& -(1.0+q3*f**2)
c return direction (only depends on the trial step )
dsig_e=sig-Trace(sig)*xid
q_e=(3.0/2.0*contrac_2nd_2nd(dsig_e,dsig_e))**0.5
n_a=3.0/2.0*dsig_e/q_e !<--------This is computed only with the trial values, does not include correction. Last equation of page 1399
D_eps_p=0.0
D_eps_q=0.0
D_eps11=D_eps(1,1)
D_eps22=D_eps(2,2)
D_eps3=D_eps(3,3)
pe=-xk*(Trace(epse)+D_eps11+D_eps22)
D_eps_b(:2,:2)=D_eps(:2,:2) !In the aricle is called Delta e bar
dD_eps_b=D_eps_b-1.0/3.0*Trace(D_eps_b)*xid !In the aricle is called deviatoric Delta e bar
depse=epse-1.0/3.0*Trace(epse)*xid !In the article is called e^e, deviatoric elastic eps
se=2*xmu*(depse+dD_eps_b) !se is the article name. This is a deviatoric with out name
a=reshape((/0,0,0,0,0,0,0,0,1/),shape(a), order=(/2,1/))
da=a-1.0/3.0*Trace(a)*xid !Deviatoric of e33
dsig=se+2.0*xmu*(D_eps3*da-3.0/2.0*D_eps_q/q*dsig)
p_tr=pe
q_tr=q !This q is qe, which comes form the arguments, does not change before this point
end if
sig1=sig
c Set guess values to enter to the iterative algorithm
D_eps_p=0.000
D_eps_q=0.0000001
D_eps3=0.000
iterartion=0
D_eps_pn=D_eps_p
D_eps_qn=D_eps_q
D_eps3n=D_eps3
conv_D_eps_p=1.0
conv_D_eps_q=3.0
c_corr(1)=1.0
c_corr(2)=2.0
f1=f
c=======================================================================
c Volumetric and deviatoric plastic strain increments according to
c a Newton scheme, and D_eps3 for in case of the plain stress case
c=======================================================================
10 if ((abs(c_corr(1)) .gt. tol_conv_cor) .or.
$ (abs(c_corr(2)).gt. tol_conv_cor ) .and. (PHI>1e-1)) then
iterartion=iterartion+1
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C Materal parameter initial values
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c------------------Relation between f and f*----------------------------
if (f1 .le. f_c) then
df_s_df=1
f_s=f1
else
df_s_df=k_b
f_s=f_c+k_b*(f1-f_c)
end if
if (str_case==0) then
c-----------------------------------------------------------------------
c THREE DIMENSIONAL GEOMETRIES
c-----------------------------------------------------------------------
c------- Update microscopic equivalent plasic strain and sig_0----------
D_epsp_b=(-p*D_eps_p+q*D_eps_q)/(1.0-f1)/sig_0
epsp_b1=epsp_b+D_epsp_b
if (epsp_b1 < 0.0) then
epsp_b1=epsp_b_n
end if
call Iso_hard1(epsp_b1, sig_0, d_sig_0_d_epsp_b, inputmat)
c----------- Update Hydrostatic and equivalent stress-------------------
p=p_tr+xk*D_eps_p
q=q_tr-3.0*xmu*D_eps_q
A_c=f_n/(s_n*(2.0*pi)**0.5)*DEXP(-1.0/2.0*((epsp_b1-E_n)/
& s_n)**2) !Chu and Needleman parameter A
D_f=(1.0-f1)*D_eps_p+A_c*D_epsp_b
f1=f+D_f
else
c-----------------------------------------------------------------------
c PLAIN STRAIN CASE
c-----------------------------------------------------------------------
c Update Hydrostatic and equivalent stress
D_epsp_b=(-p*D_eps_p+q*D_eps_q)/(1.0-f1)/sig_0
epsp_b1=epsp_b+D_epsp_b
call Iso_hard1(epsp_b1, sig_0, d_sig_0_d_epsp_b, inputmat)
p=p_tr-xk*(D_eps3-D_eps_p)
q=-3.0*xmu*D_eps_q+(q_tr**2+6.0*xmu*se(3,3)*D_eps3+
& 4.0*xmu**2*D_eps3**2)**0.5 !here q^e is q_tr
A_c=f_n/(s_n*(2.0*pi)**0.5)*DEXP(-1.0/2.0*((epsp_b1-E_n)/
& s_n)**2) !Chu and Needleman parameter A
D_f=(1.0-f1)*D_eps_p+A_c*D_epsp_b
f1=f+D_f
c & "D_epsp", D_epsp,
end if
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C Compute the required derivates to compute the constant of the LSE
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Derivatives to solve system of equations to solve D_eps_p and D_eps_q
dg_dq =2.0*(q/sig_0**2)
dg_dp = -3.0*q1*q2/sig_0*f1*sinh(-3.0*q2*p/(2.0*sig_0))
d2g_dpdq=0.0
d2g_d2p=(9.0/2.0) *q1*f1*(q2/sig_0)**2
& *cosh((-3.0*q2*p)/(2.0*sig_0)) !
d2g_d2q=(2.0/(sig_0**2))
d_sig0_d_epsp_b= 3.0*xmu*NU*(sig_0/xsigy0+3.0*xmu*epsp_b1/
& xsigy0)**(NU-1)/(1.0-NU*(sig_0/xsigy0+3.0*xmu*epsp_b1/
& xsigy0)**(NU-1))
d2g_dpdf=-3.0*q1*q2*sinh(-3.0*q2*p/(2.0*sig_0))/sig_0
& *df_s_df
dA_d_epsp_b=f_n/(s_n*(2.0*pi)**0.5)*DEXP(-0.5*((epsp_b1-
& E_n)/s_n)**2.0)*(-((epsp_b1-E_n)/s_n)*(1/s_n))
dDepsp_b_df=(-p*D_eps_p+q*D_eps_q)/((1-f1)**2*sig_0)
df_d_epsp_b=(dA_d_epsp_b*D_epsp_b)/(1.0+D_eps_p)
dDepsp_b_d_epsp_b=0.0
d2g_dp_d_epsp_b= -3.0*q1*q2*( -df_d_epsp_b/sig_0*sinh(-q2*
& 3.0*p/(2.0*sig_0))-f1/sig_0**2*d_sig0_d_epsp_b*sinh(-q2*
& 3.0*p/(2.0*sig_0))+f1/sig_0*cosh(-q2*3.0*p/(2.0*sig_0))*
& q2*3.0*p/(2.0*sig_0**2)*d_sig0_d_epsp_b)
d2g_dqdsig_0=(-4.0*q/sig_0**3)
d2g_dqdf= 0 !d2g_dqdsig_0*d_sig0_d_f
d2g_dq_d_epsp_b= d2g_dqdsig_0*d_sig0_d_epsp_b
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c !dH_alpha_dDeps_p = df_dDeps_p + d_epsp_dDeps_p + d_epsp_b_dDeps_p
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c !Compute df_dDeps_p
dDf_dDeps_p=(1.0-f1)
dDf_d_epsp_b=dA_d_epsp_b*D_epsp_b+ A_c*dDepsp_b_d_epsp_b
d_epsp_b_dp=-D_eps_p/((1.0-f1)*sig_0)
dDf_dp=dDf_d_epsp_b*d_epsp_b_dp
dDepsp_b_dDeps_p=-p/((1.0-f1)*sig_0)
dDepsp_b_dp=-D_eps_p/((1.0-f1)*sig_0)
dDf_df= -D_eps_p
c_f_f = 1.0/(Kron_d(1,1)-dDf_df)
c_f_epsp_b=1.0/(Kron_d(1,3)-dDf_d_epsp_b)
df_dDeps_p=c_f_f*(dDf_dDeps_p+xk*dDf_dp)
& +c_f_epsp_b*(dDepsp_b_dDeps_p+xk*dDepsp_b_dp)
c_epsp_b_f =1.0/(Kron_d(3,1)-dDepsp_b_df)
c_epsp_b_epsp_b=1/(Kron_d(3,3)-dDepsp_b_d_epsp_b)
d_epsp_b_dDeps_p=c_epsp_b_f*(dDf_dDeps_p+xk*dDf_dp)
& +c_epsp_b_epsp_b*(dDepsp_b_dDeps_p+xk*dDepsp_b_dp)
dH_alpha_dDeps_p= df_dDeps_p + d_epsp_b_dDeps_p
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c dH_alpha_dDeps_q = df_dDeps_q + d_epsp_dDeps_q+ d_epsp_b_dDeps_q
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Compute df_dDeps_q
dDf_dDeps_q=0
d_epsp_b_dq=D_eps_q/((1-f1)*sig_0)
!dDf_dq=A_c * D_eps_q/(1.0-f)/sig_0
dDf_dq=dDf_d_epsp_b*d_epsp_b_dq
dDepsp_b_dDeps_q= q/((1.0-f1)*sig_0)
dDepsp_b_dq = D_eps_q/((1.0-f1)*sig_0)
df_dDeps_q=c_f_f*(dDf_dDeps_q-3.0*xmu*dDf_dq)
& +c_f_epsp_b*(dDepsp_b_dDeps_q-3.0*xmu*d_epsp_b_dq)
c Compute d_epsp_b_dDeps_q
d_epsp_b_dDeps_q=c_epsp_b_f*(dDf_dDeps_q-3.0*xmu*dDf_dq)
& +c_epsp_b_epsp_b*(dDepsp_b_dDeps_q-3.0*xmu*d_epsp_b_dq)
c Finally compute dH_alpha_dDeps_q
dH_alpha_dDeps_q = df_dDeps_q + d_epsp_b_dDeps_q
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c dPHI_d
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dPHI_dp =dg_dp !q1*f*sinh(-3.0*q2*p/(2.0*sig_0))
dPHI_dq=dg_dq !2*(q/sig_0**2)
c Compute all dPHI_dH_alpha = dPHI_df, dPHI_d_epsp
dPHI_df = (2*q1-cosh(-3*q2*p/(2*sig_0))-2*q3*f1)*df_s_df
dPHI_d_epsp_b= (-2.0*q**2/sig_0**3)*d_sig0_d_epsp_b+2*q1*
& (df_d_epsp_b *cosh(-3.0/2.0*q2*p/sig_0) + f_s*sinh
& (-3.0/2.0*q2*p/sig_0)*(3.0/2.0*q2*p/sig_0**2)*
& d_sig0_d_epsp_b)-2.0*f_s*q3*df_d_epsp_b ! Option 2 considering relation between f on epsp_b
PHI=(q/sig_0)**2+2.0*f_s*q1*cosh(-3.0*q2*p/(2.0*sig_0))
& -(1.0+q3*f_s**2)
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Consolidation of Elastoplastic equation constants A11, A12, A21, A22,
c b1, b2 and solution of LSE
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c
sum1=d2g_dqdf*df_dDeps_p+d2g_dq_d_epsp_b*d_epsp_b_dDeps_p
sum2=d2g_dpdf*df_dDeps_p+d2g_dp_d_epsp_b*d_epsp_b_dDeps_p
A11=dg_dq+D_eps_p*(xk*d2g_dpdq+sum1)+D_eps_q*(xk*d2g_d2p
& +sum2)
sum3=d2g_dqdf*df_dDeps_q+d2g_dq_d_epsp_b*d_epsp_b_dDeps_q
sum4=d2g_dpdf*df_dDeps_q+d2g_dp_d_epsp_b*d_epsp_b_dDeps_q
c A12= dg_dp+D_eps_p*(-3.0*xmu*d2g_d2q+sum1)
c & + D_eps_p*(-3*xmu*d2g_dpdq+sum2) !The article has this error, the derivative is not with respect to dDeps_q
A12= dg_dp+D_eps_p*(-3.0*xmu*d2g_d2q+sum3)
& + D_eps_q*(-3*xmu*d2g_dpdq+sum4)
sum32=dPHI_df*df_dDeps_p+dPHI_d_epsp_b*d_epsp_b_dDeps_p
A21=xk*dPHI_dp+sum32
sum42=dPHI_df*df_dDeps_q+dPHI_d_epsp_b*d_epsp_b_dDeps_q
A22=-3.0*xmu*dPHI_dq+sum42
b1=-D_eps_p*dg_dq-D_eps_q*dg_dp
b2= -PHI
if (str_case==1) then
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Consolidation of Elastoplastic equation constants A13, A23, A31, A32,
c b3 / Applies only to plane stress
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A13_PS=D_eps_p*(-xk*d2g_dpdq+dq_dDeps3*d2g_d2q)+
& D_eps_q*(-xk*d2g_d2p+dq_dDeps3*d2g_dpdq)
A23_PS=-xk*dPHI_dp+dq_dDeps3*dPHI_dq
A31_PS=xk*(q+3.0*xmu*D_eps_q)
A32_PS=3.0*xmu*dev_e_33
A33_PS=dq_dDeps3*p-xk*(q+3.0*xmu*D_eps_q)-(4.0/3.0)*
& xmu*q-(dev_e_33+(4.0/3.0)*xmu*D_eps3)*dq_dDeps3
dq_dDeps3= (3.0*xmu*dev_e_33+4.0*xmu**2*D_eps3)/
& (q+3.0*xmu*D_eps_q)
b3_PS=-(q+3.0*xmu*D_eps_q)*p+(dev_e_33+
& (4.0/3.0)*xmu*D_eps3)*q
end if
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Solution of LSE for the correction values and update of volumetric
c and deviatoric plastic strain increments
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (str_case==0) then
c-----------------------------------------------------------------------
c THREE DIMENSIONAL GEOMETRIES
c-----------------------------------------------------------------------
c Solution of LSE for the correction values
M = reshape((/A11, A12,
$ A21, A22/),shape(M), order=(/2,1/))
b_v=(/b1,b2/)
M_inv = inv_T_2D(M)
c_corr = matmul(inv_T_2D(M), b_v)
c Update volumetric and deviatoric plastic strain increments
D_eps_p=D_eps_p+c_corr(1)
D_eps_q=D_eps_q+c_corr(2)
c Evaluate step convergence
conv_D_eps_p=abs(D_eps_p-D_eps_pn)
conv_D_eps_q=abs(D_eps_p-D_eps_pn)
D_eps_pn=D_eps_p
D_eps_qn=D_eps_q
else
c-----------------------------------------------------------------------
c PLAIN STRESS CASE
c-----------------------------------------------------------------------
c Solution of LSE for the correction values
M_ps = reshape ((/A11, A12, A13_PS,
& A21, A22, A23_PS,
& A31_PS, A32_PS, A33_PS/),
& shape(M_ps), order=(/2,1/))
b_ps_v =(/b1, b2, b3_PS/)
M_ps_inv=inv_T_2D(M_ps)
c_corr_ps=matmul(M_ps_inv, b_ps_v)
c Update volumetric and deviatoric plastic strain increments and D_eps3
D_eps_p=D_eps_p+c_corr_ps(1)
D_eps_q=D_eps_q+c_corr_ps(2)
D_eps3=D_eps_q+c_corr_ps(3)
c Evaluate step convergence
conv_D_eps_p=abs(D_eps_p-D_eps_pn)
conv_D_eps_q=abs(D_eps_p-D_eps_pn)