forked from harshaa765/UMATFile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUMAT.for
2075 lines (1740 loc) · 65.4 KB
/
UMAT.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
SUBROUTINE UMAT(stress,statev,ddsdde,sse,spd,scd,
1 rpl, ddsddt, drplde, drpldt,
2 stran,dstran,time,dtime,temp,dtemp,predef,dpred,cmname,
3 ndi,nshr,ntens,nstatv,props,nprops,coords,drot,pnewdt,
4 celent,dfgrd0,dfgrd1,noel,npt,layer,kspt,kstep,kinc)
c
C
C----- Subroutines:
C
C ROTATION -- forming rotation matrix, i.e. the direction
C cosines of cubic crystal [100], [010] and [001]
C directions in global system at the initial
C state
C
C SLIPSYS -- calculating number of slip systems, unit
C vectors in slip directions and unit normals to
C slip planes in a cubic crystal at the initial
C state
C
C GSLPINIT -- calculating initial value of current strengths
C at initial state
C
C STRAINRATE -- based on current values of resolved shear
C stresses and current strength, calculating
C shear strain-rates in slip systems
C
C LATENTHARDEN -- forming self- and latent-hardening matrix
C
C ITERATION -- generating arrays for the Newton-Rhapson
C iteration
C
C LUDCMP -- LU decomposition
C
C LUBKSB -- linear equation solver based on LU
C decomposition method (must call LUDCMP first)
C----- Function subprogram:
C F -- shear strain-rates in slip systems
C----- Variables:
C
C STRESS -- stresses (INPUT & OUTPUT)
C Cauchy stresses for finite deformation
C STATEV -- solution dependent state variables (INPUT & OUTPUT)
C DDSDDE -- Jacobian matrix (OUTPUT)
C----- Variables passed in for information:
C
C STRAN -- strains
C logarithmic strain for finite deformation
C (actually, integral of the symmetric part of velocity
C gradient with respect to time)
C DSTRAN -- increments of strains
C CMNAME -- name given in the *MATERIAL option
C NDI -- number of direct stress components
C NSHR -- number of engineering shear stress components
C NTENS -- NDI+NSHR
C NSTATV -- number of solution dependent state variables (as
C defined in the *DEPVAR option)
C PROPS -- material constants entered in the *USER MATERIAL
C option
C NPROPS -- number of material constants
C
C----- This subroutine provides the plastic constitutive relation of
C single crystals for finite element code ABAQUS. The plastic slip
C of single crystal obeys the Schmid law. The program gives the
C choice of small deformation theory and theory of finite rotation
C and finite strain.
C The strain increment is composed of elastic part and plastic
C part. The elastic strain increment corresponds to lattice
C stretching, the plastic part is the sum over all slip systems of
C plastic slip. The shear strain increment for each slip system is
C assumed a function of the ratio of corresponding resolved shear
C stress over current strength, and of the time step. The resolved
C shear stress is the double product of stress tensor with the slip
C deformation tensor (Schmid factor), and the increment of current
C strength is related to shear strain increments over all slip
C systems through self- and latent-hardening functions.
C----- The present program is for a single CUBIC crystal. However,
C this code can be generalized for other crystals (e.g. HCP,
C Tetragonal, Orthotropic, etc.). Only subroutines ROTATION and
C SLIPSYS need to be modified to include the effect of crystal
C aspect ratio.
C
C----- Important notice:
C
C (1) The number of state variables NSTATV must be larger than (or
CFIX equal to) TEN (10) times the total number of slip systems in
C all sets, NSLPTL, plus FIVE (5)
CFIX NSTATV >= 10 * NSLPTL + 5
C Denote s as a slip direction and m as normal to a slip plane.
C Here (s,-m), (-s,m) and (-s,-m) are NOT considered
C independent of (s,m). The number of slip systems in each set
C could be either 6, 12, 24 or 48 for a cubic crystal, e.g. 12
C for {110}<111>.
C
C (2) The tangent stiffness matrix in general is not symmetric if
C latent hardening is considered. Users must declare "UNSYMM"
C in the input file, at the *USER MATERIAL card.
C
PARAMETER (ND=150)
C----- The parameter ND determines the dimensions of the arrays in
C this subroutine. The current choice 150 is a upper bound for a
C cubic crystal with up to three sets of slip systems activated.
C Users may reduce the parameter ND to any number as long as larger
C than or equal to the total number of slip systems in all sets.
C For example, if {110}<111> is the only set of slip system
C potentially activated, ND could be taken as twelve (12).
c
include 'aba_param.inc'
c
CHARACTER*8 CMNAME
dimension stress(ntens),statev(nstatv),
1 ddsdde(ntens,ntens),ddsddt(ntens),drplde(ntens),
2 stran(ntens),dstran(ntens),time(2),predef(1),dpred(1),
3 props(nprops),coords(3),drot(3,3),dfgrd0(3,3),dfgrd1(3,3)
DIMENSION ISPDIR(3), ISPNOR(3), NSLIP(3),
2 SLPDIR(3,ND), SLPNOR(3,ND), SLPDEF(6,ND),
3 SLPSPN(3,ND), DSPDIR(3,ND), DSPNOR(3,ND),
4 DLOCAL(6,6), D(6,6), ROTD(6,6), ROTATE(3,3),
5 FSLIP(ND), DFDXSP(ND),DDEMSD(6,ND),
6 H(ND,ND), DDGDDE(ND,6),
7 DSTRES(6), DELATS(6), DSPIN(3), DVGRAD(3,3),
8 DGAMMA(ND), DTAUSP(ND), DGSLIP(ND), DRHO(ND),
9 WORKST(ND,ND), INDX(ND), TERM(3,3), TRM0(3,3), ITRM(3)
C
DIMENSION FSLIP1(ND), STRES1(6), GAMMA1(ND),RHO1(ND),TERM8(ND),
2 TAUSP1(ND),GSLP1(ND),SPNOR1(3,ND),SPDIR1(3,ND),
3 DDSDE1(6,6)
c 4 DSOLD(6), DGAMOD(ND), DRHOOD(ND),DTAUOD(ND),
c 5 DGSPOD(ND),DSPNRO(3,ND), DSPDRO(3,ND), DHDGDG(ND,ND)
C
C----- NSLIP -- number of slip systems in each set
C----- SLPDIR -- slip directions (unit vectors in the initial state)
C----- SLPNOR -- normals to slip planes (unit normals in the initial
C state)
C----- SLPDEF -- slip deformation tensors (Schmid factors)
C SLPDEF(1,i) -- SLPDIR(1,i)*SLPNOR(1,i)
C SLPDEF(2,i) -- SLPDIR(2,i)*SLPNOR(2,i)
C SLPDEF(3,i) -- SLPDIR(3,i)*SLPNOR(3,i)
C SLPDEF(4,i) -- SLPDIR(1,i)*SLPNOR(2,i)+
C SLPDIR(2,i)*SLPNOR(1,i)
C SLPDEF(5,i) -- SLPDIR(1,i)*SLPNOR(3,i)+
C SLPDIR(3,i)*SLPNOR(1,i)
C SLPDEF(6,i) -- SLPDIR(2,i)*SLPNOR(3,i)+
C SLPDIR(3,i)*SLPNOR(2,i)
C where index i corresponds to the ith slip system
C----- SLPSPN -- slip spin tensors (only needed for finite rotation)
C SLPSPN(1,i) -- [SLPDIR(1,i)*SLPNOR(2,i)-
C SLPDIR(2,i)*SLPNOR(1,i)]/2
C SLPSPN(2,i) -- [SLPDIR(3,i)*SLPNOR(1,i)-
C SLPDIR(1,i)*SLPNOR(3,i)]/2
C SLPSPN(3,i) -- [SLPDIR(2,i)*SLPNOR(3,i)-
C SLPDIR(3,i)*SLPNOR(2,i)]/2
C where index i corresponds to the ith slip system
C----- DSPDIR -- increments of slip directions
C----- DSPNOR -- increments of normals to slip planes
C
C----- DLOCAL -- elastic matrix in local cubic crystal system
C----- D -- elastic matrix in global system
C----- ROTD -- rotation matrix transforming DLOCAL to D
C
C----- ROTATE -- rotation matrix, direction cosines of [100], [010]
C and [001] of cubic crystal in global system
C
C----- FSLIP -- shear strain-rates in slip systems
C----- DFDXSP -- derivatives of FSLIP w.r.t x=TAUSLP/GSLIP, where
C TAUSLP is the resolved shear stress and GSLIP is the
C current strength
C
C----- DDEMSD -- double dot product of the elastic moduli tensor with
C the slip deformation tensor plus, only for finite
C rotation, the dot product of slip spin tensor with
C the stress
C
C----- H -- self- and latent-hardening matrix
C H(i,i) -- self hardening modulus of the ith slip
C system (no sum over i)
C H(i,j) -- latent hardening molulus of the ith slip
C system due to a slip in the jth slip system
C (i not equal j)
C
C----- DDGDDE -- derivatice of the shear strain increments in slip
C systems w.r.t. the increment of strains
C
C----- DSTRES -- Jaumann increments of stresses, i.e. corotational
C stress-increments formed on axes spinning with the
C material
C----- DELATS -- strain-increments associated with lattice stretching
C DELATS(1) - DELATS(3) -- normal strain increments
C DELATS(4) - DELATS(6) -- engineering shear strain
C increments
C----- DSPIN -- spin-increments associated with the material element
C DSPIN(1) -- component 12 of the spin tensor
C DSPIN(2) -- component 31 of the spin tensor
C DSPIN(3) -- component 23 of the spin tensor
C
C----- DVGRAD -- increments of deformation gradient in the current
C state, i.e. velocity gradient times the increment of
C time
C
C----- DGAMMA -- increment of shear strains in slip systems
C----- DTAUSP -- increment of resolved shear stresses in slip systems
C----- DGSLIP -- increment of current strengths in slip systems
C
C
C----- Arrays for iteration:
C
C FSLIP1, STRES1, GAMMA1, TAUSP1, GSLP1 , SPNOR1, SPDIR1,
C DDSDE1, DSOLD , DGAMOD, DTAUOD, DGSPOD, DSPNRO, DSPDRO,
C DHDGDG
C
C
C----- Solution dependent state variable STATEV:
C Denote the number of total slip systems by NSLPTL, which
C will be calculated in this code.
C
C Array STATEV:
C 1 - NSLPTL : current strength in slip systems
C NSLPTL+1 - 2*NSLPTL : shear strain in slip systems
C 2*NSLPTL+1 - 3*NSLPTL : DISLOCATION DENSITY IN SLIP SYSTEMS
C 3*NSLPTL+1 - 4*NSLPTL : resolved shear stress in slip systems
C
C 4*NSLPTL+1 - 7*NSLPTL : current components of normals to slip
C slip planes
C 7*NSLPTL+1 - 10*NSLPTL : current components of slip directions
C
CFIX 10*NSLPTL+1 - 11*NSLPTL : total cumulative shear strain on each
CFIX slip system (sum of the absolute
CFIX values of shear strains in each slip
CFIX system individually)
CFIX 11*NSLPTL+1 - 12*NSLPTL : total cumulative DISLOCATION DENSITY on each
CFIX slip system (sum of the absolute
CFIX values of DISLOCATION DENSITY in each slip
CFIX system individually)
C
C
CFIX 12*NSLPTL+1 : total cumulative shear strain on all
C slip systems (sum of the absolute
C values of shear strains in all slip
C systems)
C 12*NSLPTL+2 : total cumulative shear strain on all
C slip systems (sum of the absolute
C values of shear strains in all slip
C systems)
CFIX 12*NSLPTL+2 - NSTATV-4 : additional parameters users may need
C to characterize the constitutive law
C of a single crystal (if there are
C any).
C
C NSTATV-3 : number of slip systems in the 1st set
C NSTATV-2 : number of slip systems in the 2nd set
C NSTATV-1 : number of slip systems in the 3rd set
C NSTATV : total number of slip systems in all
C sets
C
C
C----- Material constants PROPS:
C
C PROPS(1) - PROPS(21) -- elastic constants for a general elastic
C anisotropic material
C
C isotropic : PROPS(i)=0 for i>2
C PROPS(1) -- Young's modulus
C PROPS(2) -- Poisson's ratio
C
C cubic : PROPS(i)=0 for i>3
C PROPS(1) -- c11
C PROPS(2) -- c12
C PROPS(3) -- c44
C
C orthotropic : PORPS(i)=0 for i>9
C PROPS(1) - PROPS(9) are D1111, D1122, D2222,
C D1133, D2233, D3333, D1212, D1313, D2323,
C respectively, which has the same definition
C as ABAQUS for orthotropic materials
C (see *ELASTIC card)
C
C anisotropic : PROPS(1) - PROPS(21) are D1111, D1122,
C D2222, D1133, D2233, D3333, D1112, D2212,
C D3312, D1212, D1113, D2213, D3313, D1213,
C D1313, D1123, D2223, D3323, D1223, D1323,
C D2323, respectively, which has the same
C definition as ABAQUS for anisotropic
C materials (see *ELASTIC card)
C
C
C PROPS(25) - PROPS(56) -- parameters characterizing all slip
C systems to be activated in a cubic
C crystal
C
C PROPS(25) -- number of sets of slip systems (maximum 3),
C e.g. (110)[1-11] and (101)[11-1] are in the
C same set of slip systems, (110)[1-11] and
C (121)[1-11] belong to different sets of slip
C systems
C (It must be a real number, e.g. 3., not 3 !)
C
C PROPS(33) - PROPS(35) -- normal to a typical slip plane in
C the first set of slip systems,
C e.g. (1 1 0)
C (They must be real numbers, e.g.
C 1. 1. 0., not 1 1 0 !)
C PROPS(36) - PROPS(38) -- a typical slip direction in the
C first set of slip systems, e.g.
C [1 1 1]
C (They must be real numbers, e.g.
C 1. 1. 1., not 1 1 1 !)
C
C PROPS(41) - PROPS(43) -- normal to a typical slip plane in
C the second set of slip systems
C (real numbers)
C PROPS(44) - PROPS(46) -- a typical slip direction in the
C second set of slip systems
C (real numbers)
C
C PROPS(49) - PROPS(51) -- normal to a typical slip plane in
C the third set of slip systems
C (real numbers)
C PROPS(52) - PROPS(54) -- a typical slip direction in the
C third set of slip systems
C (real numbers)
C
C
C PROPS(57) - PROPS(72) -- parameters characterizing the initial
C orientation of a single crystal in
C global system
C The directions in global system and directions in local
C cubic crystal system of two nonparallel vectors are needed
C to determine the crystal orientation.
C
C PROPS(57) - PROPS(59) -- [p1 p2 p3], direction of first
C vector in local cubic crystal
C system, e.g. [1 1 0]
C (They must be real numbers, e.g.
C 1. 1. 0., not 1 1 0 !)
C PROPS(60) - PROPS(62) -- [P1 P2 P3], direction of first
C vector in global system, e.g.
C [2. 1. 0.]
C (It does not have to be a unit
C vector)
C
C PROPS(65) - PROPS(67) -- direction of second vector in
C local cubic crystal system (real
C numbers)
C PROPS(68) - PROPS(70) -- direction of second vector in
C global system
C
C
C PROPS(73) - PROPS(96) -- parameters characterizing the visco-
C plastic constitutive law (shear
C strain-rate vs. resolved shear
C stress), e.g. a power-law relation
C
C PROPS(73) - PROPS(80) -- parameters for the first set of
C slip systems
C PROPS(81) - PROPS(88) -- parameters for the second set of
C slip systems
C PROPS(89) - PROPS(96) -- parameters for the third set of
C slip systems
C
C
C PROPS(97) - PROPS(144)-- parameters characterizing the self-
C and latent-hardening laws of slip
C systems
C
C PROPS(97) - PROPS(104)-- self-hardening parameters for the
C first set of slip systems
C PROPS(105)- PROPS(112)-- latent-hardening parameters for
C the first set of slip systems and
C interaction with other sets of
C slip systems
C
C PROPS(113)- PROPS(120)-- self-hardening parameters for the
C second set of slip systems
C PROPS(121)- PROPS(128)-- latent-hardening parameters for
C the second set of slip systems
C and interaction with other sets
C of slip systems
C
C PROPS(129)- PROPS(136)-- self-hardening parameters for the
C third set of slip systems
C PROPS(137)- PROPS(144)-- latent-hardening parameters for
C the third set of slip systems and
C interaction with other sets of
C slip systems
C
C
C PROPS(145)- PROPS(152)-- parameters characterizing forward time
C integration scheme and finite
C deformation
C
C PROPS(145) -- parameter theta controlling the implicit
C integration, which is between 0 and 1
C 0. : explicit integration
C 0.5 : recommended value
C 1. : fully implicit integration
C
C PROPS(146) -- parameter NLGEOM controlling whether the
C effect of finite rotation and finite strain
C of crystal is considered,
C 0. : small deformation theory
C otherwise : theory of finite rotation and
C finite strain
C
C
C PROPS(153)- PROPS(160)-- parameters characterizing iteration
C method
C
C PROPS(153) -- parameter ITRATN controlling whether the
C iteration method is used,
C 0. : no iteration
C otherwise : iteration
C
C PROPS(154) -- maximum number of iteration ITRMAX
C
C PROPS(155) -- absolute error of shear strains in slip
C systems GAMERR
c
C----- Elastic matrix in local cubic crystal system: DLOCAL
WRITE(6,*) 'HARSH UMAT entered'
DO J=1,6
DO I=1,6
DLOCAL(I,J)=0.
END DO
END DO
CHECK=0.
DO J=10,21
CHECK=CHECK+ABS(PROPS(J))
END DO
IF (CHECK.EQ.0.) THEN
DO J=4,9
CHECK=CHECK+ABS(PROPS(J))
END DO
IF (CHECK.EQ.0.) THEN
IF (PROPS(3).EQ.0.) THEN
C----- Isotropic material
GSHEAR=PROPS(1)/2./(1.+PROPS(2))
E11=2.*GSHEAR*(1.-PROPS(2))/(1.-2.*PROPS(2))
E12=2.*GSHEAR*PROPS(2)/(1.-2.*PROPS(2))
DO J=1,3
DLOCAL(J,J)=E11
DO I=1,3
IF (I.NE.J) DLOCAL(I,J)=E12
END DO
DLOCAL(J+3,J+3)=GSHEAR
END DO
ELSE
C----- Cubic material
DO J=1,3
DLOCAL(J,J)=PROPS(1)
DO I=1,3
IF (I.NE.J) DLOCAL(I,J)=PROPS(2)
END DO
DLOCAL(J+3,J+3)=PROPS(3)
END DO
END IF
ELSE
C----- Orthotropic metarial
DLOCAL(1,1)=PROPS(1)
DLOCAL(1,2)=PROPS(2)
DLOCAL(2,1)=PROPS(2)
DLOCAL(2,2)=PROPS(3)
DLOCAL(1,3)=PROPS(4)
DLOCAL(3,1)=PROPS(4)
DLOCAL(2,3)=PROPS(5)
DLOCAL(3,2)=PROPS(5)
DLOCAL(3,3)=PROPS(6)
DLOCAL(4,4)=PROPS(7)
DLOCAL(5,5)=PROPS(8)
DLOCAL(6,6)=PROPS(9)
END IF
ELSE
C----- General anisotropic material
ID=0
DO J=1,6
DO I=1,J
ID=ID+1
DLOCAL(I,J)=PROPS(ID)
DLOCAL(J,I)=DLOCAL(I,J)
END DO
END DO
END IF
CONTINUE
C----- Rotation matrix: ROTATE, i.e. direction cosines of [100], [010]
C and [001] of a cubic crystal in global system
C
CALL ROTATION (PROPS(57), ROTATE)
C----- Rotation matrix: ROTD to transform local elastic matrix DLOCAL
C to global elastic matrix D
C
DO J=1,3
J1=1+J/3
J2=2+J/2
DO I=1,3
I1=1+I/3
I2=2+I/2
ROTD(I,J)=ROTATE(I,J)**2
ROTD(I,J+3)=2.*ROTATE(I,J1)*ROTATE(I,J2)
ROTD(I+3,J)=ROTATE(I1,J)*ROTATE(I2,J)
ROTD(I+3,J+3)=ROTATE(I1,J1)*ROTATE(I2,J2)+
2 ROTATE(I1,J2)*ROTATE(I2,J1)
END DO
END DO
C----- Elastic matrix in global system: D
C {D} = {ROTD} * {DLOCAL} * {ROTD}transpose
C
DO J=1,6
DO I=1,6
D(I,J)=0.
END DO
END DO
DO J=1,6
DO I=1,J
DO K=1,6
DO L=1,6
D(I,J)=D(I,J)+DLOCAL(K,L)*ROTD(I,K)*ROTD(J,L)
END DO
END DO
D(J,I)=D(I,J)
END DO
END DO
C----- Total number of sets of slip systems: NSET
NSET=NINT(PROPS(25))
IF (NSET.LT.1) THEN
WRITE (6,*) '***ERROR - ZERO SETS OF SLIP SYSTEMS'
STOP
ELSE IF (NSET.GT.3) THEN
WRITE (6,*)
2 '***ERROR - MORE THAN THREE SETS OF SLIP SYSTEMS'
STOP
END IF
C----- Implicit integration parameter: THETA
THETA=PROPS(145)
TERM1=THETA*DTIME
IF (PROPS(146).EQ.0.) THEN
NLGEOM=0
ELSE
NLGEOM=1
END IF
C----- Iteration?
C----- ITRATN = 0, no iteration
C otherwise, iteration (solving increments of stresses and
C solution dependent state variables)
C
c IF (PROPS(153).EQ.0.) THEN
c ITRATN=0
c ELSE
c ITRATN=1
c END IF
c ITRMAX=NINT(PROPS(154))
c GAMERR=PROPS(155)
c NITRTN=-1
c DO I=1,NTENS
c DSOLD(I)=0.
c END DO
c DO J=1,ND
c DGAMOD(J)=0.
c DRHOOD(J)=0.
c DTAUOD(J)=0.
c DGSPOD(J)=0.
c DO I=1,3
c DSPNRO(I,J)=0.
c DSPDRO(I,J)=0.
c END DO
c END DO
C
IF (NLGEOM.NE.0) THEN
DO J=1,3
DO I=1,3
TERM(I,J)=DROT(J,I)
TRM0(I,J)=DROT(J,I)
END DO
TERM(J,J)=TERM(J,J)+1.D0
TRM0(J,J)=TRM0(J,J)-1.D0
END DO
CALL LUDCMP (TERM, 3, 3, ITRM, DDCMP)
DO J=1,3
CALL LUBKSB (TERM, 3, 3, ITRM, TRM0(1,J))
END DO
DSPIN(1)=TRM0(2,1)-TRM0(1,2)
DSPIN(2)=TRM0(1,3)-TRM0(3,1)
DSPIN(3)=TRM0(3,2)-TRM0(2,3)
END IF
C----- Increment of dilatational strain: DEV
DEV=0.D0
DO I=1,NDI
DEV=DEV+DSTRAN(I)
END DO
C----- Iteration starts (only when iteration method is used)
c1000 CONTINUE
C----- Parameter NITRTN: number of iterations
C NITRTN = 0 --- no-iteration solution
C
c NITRTN=NITRTN+1
IF (STATEV(1).EQ.0.) THEN
NSLPTL=0
DO I=1,NSET
ISPNOR(1)=NINT(PROPS(25+8*I))
ISPNOR(2)=NINT(PROPS(26+8*I))
ISPNOR(3)=NINT(PROPS(27+8*I))
ISPDIR(1)=NINT(PROPS(28+8*I))
ISPDIR(2)=NINT(PROPS(29+8*I))
ISPDIR(3)=NINT(PROPS(30+8*I))
CALL SLIPSYS (ISPDIR, ISPNOR, NSLIP(I), SLPDIR(1,NSLPTL+1),
1 SLPNOR(1,NSLPTL+1), ROTATE)
NSLPTL=NSLPTL+NSLIP(I)
END DO
IF (ND.LT.NSLPTL) THEN
WRITE (6,*)
2 '***ERROR - PARAMETER ND CHOSEN BY THE PRESENT USERIS LESS THAN
3 THE TOTAL NUMBER OF SLIP SYSTEMS, NSLPTL'
STOP
END IF
C----- Slip deformation tensor: SLPDEF (Schmid factors)
DO J=1,NSLPTL
SLPDEF(1,J)=SLPDIR(1,J)*SLPNOR(1,J)
SLPDEF(2,J)=SLPDIR(2,J)*SLPNOR(2,J)
SLPDEF(3,J)=SLPDIR(3,J)*SLPNOR(3,J)
SLPDEF(4,J)=SLPDIR(1,J)*SLPNOR(2,J)+SLPDIR(2,J)*SLPNOR(1,J)
SLPDEF(5,J)=SLPDIR(1,J)*SLPNOR(3,J)+SLPDIR(3,J)*SLPNOR(1,J)
SLPDEF(6,J)=SLPDIR(2,J)*SLPNOR(3,J)+SLPDIR(3,J)*SLPNOR(2,J)
END DO
C----- Initial value of state variables: unit normal to a slip plane
C and unit vector in a slip direction
C
STATEV(NSTATV)=FLOAT(NSLPTL)
DO I=1,NSET
STATEV(NSTATV-4+I)=FLOAT(NSLIP(I))
END DO
IDNOR=3*NSLPTL
IDDIR=6*NSLPTL
DO J=1,NSLPTL
DO I=1,3
IDNOR=IDNOR+1
STATEV(IDNOR)=SLPNOR(I,J)
IDDIR=IDDIR+1
STATEV(IDDIR)=SLPDIR(I,J)
END DO
END DO
C----- Initial value of the current strength for all slip systems
DO I=1,NSLPTL
STATEV(NSLPTL+I)=0.
STATEV(9*NSLPTL+I)=PROPS(99)
STATEV(10*NSLPTL+1)=PROPS(100)
END DO
c
DO I=1,NSLPTL
CALL GSLPINIT (STATEV(I), NSLPTL, PROPS(97),
2 PROPS(98),STATEV(9*NSLPTL+I), I)
C GALPHA(I)=STATEV(1)
END DO
C-----------------------------------------------------------------------
C----- Initial value of the resolved shear stress in slip systems
DO I=1,NSLPTL
TERM1=0.
DO J=1,NTENS
IF (J.LE.NDI) THEN
TERM1=TERM1+SLPDEF(J,I)*STRESS(J)
ELSE
TERM1=TERM1+SLPDEF(J-NDI+3,I)*STRESS(J)
END IF
END DO
STATEV(2*NSLPTL+I)=TERM1
END DO
ELSE
C----- Current stress state
C
C----- Copying from the array of state variables STATVE the following
C parameters and variables at current stress state:
C Total number of slip systems in all the sets NSLPTL
C Number of slip systems in each set NSLIP
C Current slip directions SLPDIR
C Normals to current slip planes SLPNOR
C
NSLPTL=NINT(STATEV(NSTATV))
DO I=1,NSET
NSLIP(I)=NINT(STATEV(NSTATV-4+I))
END DO
IDNOR=3*NSLPTL
IDDIR=6*NSLPTL
DO J=1,NSLPTL
DO I=1,3
IDNOR=IDNOR+1
SLPNOR(I,J)=STATEV(IDNOR)
IDDIR=IDDIR+1
SLPDIR(I,J)=STATEV(IDDIR)
END DO
END DO
C----- Slip deformation tensor: SLPDEF (Schmid factors)
DO J=1,NSLPTL
SLPDEF(1,J)=SLPDIR(1,J)*SLPNOR(1,J)
SLPDEF(2,J)=SLPDIR(2,J)*SLPNOR(2,J)
SLPDEF(3,J)=SLPDIR(3,J)*SLPNOR(3,J)
SLPDEF(4,J)=SLPDIR(1,J)*SLPNOR(2,J)+SLPDIR(2,J)*SLPNOR(1,J)
SLPDEF(5,J)=SLPDIR(1,J)*SLPNOR(3,J)+SLPDIR(3,J)*SLPNOR(1,J)
SLPDEF(6,J)=SLPDIR(2,J)*SLPNOR(3,J)+SLPDIR(3,J)*SLPNOR(2,J)
END DO
END IF
C----- Slip spin tensor: SLPSPN (only needed for finite rotation)
IF (NLGEOM.NE.0) THEN
DO J=1,NSLPTL
SLPSPN(1,J)=0.5*(SLPDIR(1,J)*SLPNOR(2,J)-
2 SLPDIR(2,J)*SLPNOR(1,J))
SLPSPN(2,J)=0.5*(SLPDIR(3,J)*SLPNOR(1,J)-
2 SLPDIR(1,J)*SLPNOR(3,J))
SLPSPN(3,J)=0.5*(SLPDIR(2,J)*SLPNOR(3,J)-
2 SLPDIR(3,J)*SLPNOR(2,J))
END DO
END IF
C----- Double dot product of elastic moduli tensor with the slip
C deformation tensor (Schmid factors) plus, only for finite
C rotation, the dot product of slip spin tensor with the stress:
C DDEMSD
C
DO J=1,NSLPTL
DO I=1,6
DDEMSD(I,J)=0.
DO K=1,6
DDEMSD(I,J)=DDEMSD(I,J)+D(K,I)*SLPDEF(K,J)
END DO
END DO
END DO
IF (NLGEOM.NE.0) THEN
DO J=1,NSLPTL
DDEMSD(4,J)=DDEMSD(4,J)-SLPSPN(1,J)*STRESS(1)
DDEMSD(5,J)=DDEMSD(5,J)+SLPSPN(2,J)*STRESS(1)
IF (NDI.GT.1) THEN
DDEMSD(4,J)=DDEMSD(4,J)+SLPSPN(1,J)*STRESS(2)
DDEMSD(6,J)=DDEMSD(6,J)-SLPSPN(3,J)*STRESS(2)
END IF
IF (NDI.GT.2) THEN
DDEMSD(5,J)=DDEMSD(5,J)-SLPSPN(2,J)*STRESS(3)
DDEMSD(6,J)=DDEMSD(6,J)+SLPSPN(3,J)*STRESS(3)
END IF
IF (NSHR.GE.1) THEN
DDEMSD(1,J)=DDEMSD(1,J)+SLPSPN(1,J)*STRESS(NDI+1)
DDEMSD(2,J)=DDEMSD(2,J)-SLPSPN(1,J)*STRESS(NDI+1)
DDEMSD(5,J)=DDEMSD(5,J)-SLPSPN(3,J)*STRESS(NDI+1)
DDEMSD(6,J)=DDEMSD(6,J)+SLPSPN(2,J)*STRESS(NDI+1)
END IF
IF (NSHR.GE.2) THEN
DDEMSD(1,J)=DDEMSD(1,J)-SLPSPN(2,J)*STRESS(NDI+2)
DDEMSD(3,J)=DDEMSD(3,J)+SLPSPN(2,J)*STRESS(NDI+2)
DDEMSD(4,J)=DDEMSD(4,J)+SLPSPN(3,J)*STRESS(NDI+2)
DDEMSD(6,J)=DDEMSD(6,J)-SLPSPN(1,J)*STRESS(NDI+2)
END IF
IF (NSHR.EQ.3) THEN
DDEMSD(2,J)=DDEMSD(2,J)+SLPSPN(3,J)*STRESS(NDI+3)
DDEMSD(3,J)=DDEMSD(3,J)-SLPSPN(3,J)*STRESS(NDI+3)
DDEMSD(4,J)=DDEMSD(4,J)-SLPSPN(2,J)*STRESS(NDI+3)
DDEMSD(5,J)=DDEMSD(5,J)+SLPSPN(1,J)*STRESS(NDI+3)
END IF
END DO
END IF
C----- Shear strain-rate in a slip system at the start of increment:
ID=1
DO I=1,NSET
IF (I.GT.1) ID=ID+NSLIP(I-1)
CALL STRAINRATE(STATEV(2*NSLPTL+ID), STATEV(ID),NSLIP(I),
1 FSLIP(ID), DFDXSP(ID), PROPS(65+8*I))
C------------------------------------------------------------------------------------
END DO
CALL LATENTHARDEN (STATEV(9*NSLPTL+1), STATEV(10*NSLPTL+1),NSLIP,
1 NSLPTL,NSET,H, PROPS(97),ND)
C----- LU decomposition to solve the increment of shear strain
TERM1=THETA*DTIME
DO I=1,NSLPTL
TAUSLP=STATEV(2*NSLPTL+I)
GSLIP=STATEV(I)
X=TAUSLP/GSLIP
TERM1=THETA*DTIME
TERM2=TERM1*DFDXSP(I)/GSLIP
TERM3=TERM1*X*DFDXSP(I)/GSLIP
c
DO J=1,NSLPTL
TERM4=0.
DO K=1,6
TERM4=TERM4+DDEMSD(K,I)*SLPDEF(K,J)
END DO
WORKST(I,J)=TERM2*TERM4+H(I,J)*TERM3*DSIGN(1.D0,FSLIP(J))
c IF (NITRTN.GT.0) WORKST(I,J)=WORKST(I,J)+TERM3*DHDGDG(I,J)
END DO
C
WORKST(I,I)=WORKST(I,I)+1.
END DO
CALL LUDCMP (WORKST, NSLPTL, ND, INDX, DDCMP)
C----- Increment of shear strain in a slip system: DGAMMA
TERM1=THETA*DTIME
DO I=1,NSLPTL
c IF (NITRTN.EQ.0) THEN
C RHO=STATEV(9*NSLPTL+I)
C SUMRHO=STATEV(10*NSLPTL+1)
TAUSLP=STATEV(2*NSLPTL+I)
GSLIP=STATEV(I)
X=TAUSLP/GSLIP
TERM2=TERM1*DFDXSP(I)/GSLIP
DGAMMA(I)=0.
DO J=1,NDI
DGAMMA(I)=DGAMMA(I)+DDEMSD(J,I)*DSTRAN(J)
END DO
IF (NSHR.GT.0) THEN
DO J=1,NSHR
DGAMMA(I)=DGAMMA(I)+DDEMSD(J+3,I)*DSTRAN(J+NDI)
END DO
END IF
DGAMMA(I)=DGAMMA(I)*TERM2+FSLIP(I)*DTIME
c ELSE
c DGAMMA(I)=TERM1*(FSLIP(I)-FSLIP1(I))+FSLIP1(I)*DTIME
c 2 -DGAMOD(I)
c END IF
c TERM8(I)=((SQRT(SUMRHO))/PROPS(101)-2*PROPS(102)*RHO)
C DRHO(I)=(1/PROPS(97))*(TERM8(I)*ABS(DGAMMA(I)))-DRHOOD(I)
END DO
CALL LUBKSB (WORKST, NSLPTL, ND, INDX, DGAMMA)
SUMRHO=STATEV(10*NSLPTL+1)
DO I=1,NSLPTL
c DGAMMA(I)=DGAMMA(I)+DGAMOD(I)
C DRHO(I)=DRHO(I)+DRHOOD(I)
RHO=STATEV(9*NSLPTL+I)
TERM8(I)=((SQRT(SUMRHO))/PROPS(101)-2*PROPS(102)*RHO)
DRHO(I)=(1/PROPS(97))*(TERM8(I)*ABS(DGAMMA(I)))
END DO
C-
DO I=1,NSLPTL
STATEV(NSLPTL+I)=STATEV(NSLPTL+I)+DGAMMA(I)
C STATEV(NSLPTL+I)=STATEV(NSLPTL+I)+DGAMMA(I)-DGAMOD(I)
STATEV(9*NSLPTL+I)=STATEV(9*NSLPTL+I)+DRHO(I)
C STATEV(9*NSLPTL+I)=STATEV(9*NSLPTL+I)+DRHO(I)-DRHOOD(I)
STATEV(10*NSLPTL+1)= STATEV(10*NSLPTL+1)+ABS(DRHO(I))
C STATEV(10*NSLPTL+1)= STATEV(10*NSLPTL+1)+ABS(DRHO(I))
IF(STATEV(9*NSLPTL+I).LE.0.) THEN
STOP 'NEGATIVE RHO'
ENDIF
END DO
DO I=1,NSLPTL
DGSLIP(I)=0.
DO J=1,NSLPTL
DGSLIP(I)=DGSLIP(I)+H(I,J)*ABS(DGAMMA(J))
END DO
STATEV(I)=STATEV(I)+DGSLIP(I)
C STATEV(I)=STATEV(I)+DGSLIP(I)-DGSPOD(I)
END DO
DO J=1,6
DELATS(J)=0.
END DO
DO J=1,3
IF (J.LE.NDI) DELATS(J)=DSTRAN(J)
DO I=1,NSLPTL
DELATS(J)=DELATS(J)-SLPDEF(J,I)*DGAMMA(I)
END DO
END DO
c
DO J=1,3
IF (J.LE.NSHR) DELATS(J+3)=DSTRAN(J+NDI)
DO I=1,NSLPTL
DELATS(J+3)=DELATS(J+3)-SLPDEF(J+3,I)*DGAMMA(I)
END DO
END DO
IF (NLGEOM.NE.0) THEN
DO J=1,3
DO I=1,3
IF (I.EQ.J) THEN
DVGRAD(I,J)=DELATS(I)
ELSE
DVGRAD(I,J)=DELATS(I+J+1)
END IF
END DO
END DO
DO J=1,3
DO I=1,J
IF (J.GT.I) THEN
IJ2=I+J-2
IF (MOD(IJ2,2).EQ.1) THEN
TERM1=1.
ELSE
TERM1=-1.
END IF
DVGRAD(I,J)=DVGRAD(I,J)+TERM1*DSPIN(IJ2)