-
Notifications
You must be signed in to change notification settings - Fork 27
/
umat_general.for
1820 lines (1794 loc) · 51.9 KB
/
umat_general.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 PULL2(PK,SIG,FINV,DET,NDI)
C> PULL-BACK TIMES DET OF A 2ND ORDER TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER I1,J1,II1,JJ1,NDI
DOUBLE PRECISION PK(NDI,NDI),FINV(NDI,NDI)
DOUBLE PRECISION SIG(NDI,NDI)
DOUBLE PRECISION AUX,DET
C
DO I1=1,NDI
DO J1=1,NDI
AUX=ZERO
DO II1=1,NDI
DO JJ1=1,NDI
AUX=AUX+DET*FINV(I1,II1)*FINV(J1,JJ1)*SIG(II1,JJ1)
END DO
END DO
PK(I1,J1)=AUX
END DO
END DO
C
RETURN
END SUBROUTINE PULL2
SUBROUTINE PINVARIANTS(A,INV4,NDI,ST,LAMBDA,BARLAMBDA,DET)
C> AND 4TH PSEUDO-INVARIANTS OF A TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI,I,J
DOUBLE PRECISION A(NDI,NDI),DET,SCALE1,ST(NDI,NDI),LAMBDA
DOUBLE PRECISION BARLAMBDA,INV4
C
INV4=ZERO
DO I=1,NDI
DO J=1, NDI
INV4=INV4+A(I,J)*ST(I,J)
ENDDO
ENDDO
C STRETCH
SCALE1=DET**(-ONE /THREE)
BARLAMBDA=DSQRT(INV4)
LAMBDA=BARLAMBDA/SCALE1
C
RETURN
END SUBROUTINE PINVARIANTS
SUBROUTINE METVOL(CVOL,C,PV,PPV,DET,NDI)
C> VOLUMETRIC MATERIAL ELASTICITY TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI,I1,J1,K1,L1
DOUBLE PRECISION C(NDI,NDI),CINV(NDI,NDI),
1 CVOL(NDI,NDI,NDI,NDI)
DOUBLE PRECISION PV,PPV,DET
C
CALL MATINV3D(C,CINV,NDI)
C
DO I1 = 1, NDI
DO J1 = 1, NDI
DO K1 = 1, NDI
DO L1 = 1, NDI
CVOL(I1,J1,K1,L1)=
1 DET*PPV*CINV(I1,J1)*CINV(K1,L1)
2 -DET*PV*(CINV(I1,K1)*CINV(J1,L1)
3 +CINV(I1,L1)*CINV(J1,K1))
END DO
END DO
END DO
END DO
C
RETURN
END SUBROUTINE METVOL
SUBROUTINE CONTRACTION42(S,LT,RT,NDI)
C> DOUBLE CONTRACTION BETWEEN 4TH ORDER AND 2ND ORDER TENSOR
C> INPUT:
C> LT - RIGHT 4TH ORDER TENSOR
C> RT - LEFT 2ND ODER TENSOR
C> OUTPUT:
C> S - DOUBLE CONTRACTED TENSOR (2ND ORDER)
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER I1,J1,K1,L1,NDI
C
DOUBLE PRECISION RT(NDI,NDI),LT(NDI,NDI,NDI,NDI)
DOUBLE PRECISION S(NDI,NDI)
DOUBLE PRECISION AUX
C
DO I1=1,NDI
DO J1=1,NDI
AUX=ZERO
DO K1=1,NDI
DO L1=1,NDI
AUX=AUX+LT(I1,J1,K1,L1)*RT(K1,L1)
END DO
END DO
S(I1,J1)=AUX
END DO
END DO
RETURN
END SUBROUTINE CONTRACTION42
C>********************************************************************
C> Record of revisions: |
C> Date Programmer Description of change |
C> ==== ========== ===================== |
C> 15/11/2017 Joao Ferreira cont mech general eqs |
C> 01/11/2018 Joao Ferreira comments added |
C>--------------------------------------------------------------------
C> Description:
C> UMAT: IMPLEMENTATION OF THE CONSTITUTIVE EQUATIONS BASED UPON
C> A STRAIN-ENERGY FUNCTION (SEF).
C> THIS CODE, AS IS, EXPECTS A SEF BASED ON THE INVARIANTS OF THE
C> CAUCHY-GREEN TENSORS. A VISCOELASTIC COMPONENT IS ALSO
C> INCLUDED IF NEEDED.
C> YOU CAN CHOOSE TO COMPUTE AT THE MATERIAL FRAME AND THEN
C> PUSHFORWARD OR COPUTE AND THE SPATIAL FRAME DIRECTLY.
C>--------------------------------------------------------------------
C> IF YOU WANT TO ADAPT THE CODE ACCORDING TO YOUR SEF:
C> ISOMAT - DERIVATIVES OF THE SEF IN ORDER TO THE INVARIANTS
C> ADD OTHER CONTRIBUTIONS: STRESS AND TANGENT MATRIX
C>--------------------------------------------------------------------
C STATE VARIABLES: CHECK ROUTINES - INITIALIZE, WRITESDV, READSDV.
C>--------------------------------------------------------------------
C> UEXTERNALDB: READ FILAMENTS ORIENTATION AND PREFERED DIRECTION
C>--------------------------------------------------------------------
C>---------------------------------------------------------------------
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,NSTATEV,PROPS,NPROPS,COORDS,DROT,PNEWDT,
4 CELENT,DFGRD0,DFGRD1,NOEL,NPT,LAYER,KSPT,KSTEP,KINC)
C
C----------------------------------------------------------------------
C--------------------------- DECLARATIONS -----------------------------
C----------------------------------------------------------------------
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C ADD COMMON BLOCKS HERE IF NEEDED (and in uexternal)
C COMMON /KBLOCK/KBLOCK
COMMON /KFIB/FIBORI
C
CHARACTER*8 CMNAME
C
INTEGER NDI, NSHR, NTENS, NSTATEV, NPROPS, NOEL, NPT,
1 LAYER, KSPT, KSTEP, KINC
C
DOUBLE PRECISION STRESS(NTENS),STATEV(NSTATEV),
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),
4 FIBORI(NELEM,4)
C
DOUBLE PRECISION SSE, SPD, SCD, RPL, DRPLDT, DTIME, TEMP,
1 DTEMP,PNEWDT,CELENT
C
INTEGER NTERM
C
C FLAGS
C INTEGER FLAG1
C UTILITY TENSORS
DOUBLE PRECISION UNIT2(NDI,NDI),UNIT4(NDI,NDI,NDI,NDI),
1 UNIT4S(NDI,NDI,NDI,NDI),
2 PROJE(NDI,NDI,NDI,NDI),PROJL(NDI,NDI,NDI,NDI)
C KINEMATICS
DOUBLE PRECISION DISTGR(NDI,NDI),C(NDI,NDI),B(NDI,NDI),
1 CBAR(NDI,NDI),BBAR(NDI,NDI),DISTGRINV(NDI,NDI),
2 UBAR(NDI,NDI),VBAR(NDI,NDI),ROT(NDI,NDI),
3 DFGRD1INV(NDI,NDI)
DOUBLE PRECISION DET,CBARI1,CBARI2
C VOLUMETRIC CONTRIBUTION
DOUBLE PRECISION PKVOL(NDI,NDI),SVOL(NDI,NDI),
1 CVOL(NDI,NDI,NDI,NDI),CMVOL(NDI,NDI,NDI,NDI)
DOUBLE PRECISION KBULK,PV,PPV,SSEV
C ISOCHORIC CONTRIBUTION
DOUBLE PRECISION SISO(NDI,NDI),PKISO(NDI,NDI),PK2(NDI,NDI),
1 CISO(NDI,NDI,NDI,NDI),CMISO(NDI,NDI,NDI,NDI),
2 SFIC(NDI,NDI),CFIC(NDI,NDI,NDI,NDI),
3 PKFIC(NDI,NDI),CMFIC(NDI,NDI,NDI,NDI)
C ISOCHORIC ISOTROPIC CONTRIBUTION
DOUBLE PRECISION C10,C01,SSEISO,DISO(5),PKMATFIC(NDI,NDI),
1 SMATFIC(NDI,NDI),SISOMATFIC(NDI,NDI),
2 CMISOMATFIC(NDI,NDI,NDI,NDI),
3 CISOMATFIC(NDI,NDI,NDI,NDI)
C ISOCHORIC ANISOTROPIC CONTRIBUTION
DOUBLE PRECISION K1,K2,KDISP,SSEANISO,
1 DANISO(4),
2 PKMATFICANISO(NDI,NDI),
3 SANISOMATFIC(NDI,NDI),
4 CMANISOMATFIC(NDI,NDI,NDI,NDI),
6 CANISOMATFIC(NDI,NDI,NDI,NDI),
8 LAMBDA,BARLAMBDA,
9 CBARI4
DOUBLE PRECISION VORIF(3),VD(3),M0(3,3),MM(3,3),
1 VORIF2(3),VD2(3),N0(3,3),NN(3,3)
C LIST VARS OF OTHER CONTRIBUTIONS HERE
C
C VISCOUS PROPERTIES (GENERALIZED MAXWEL DASHPOTS)
DOUBLE PRECISION VSCPROPS(6)
INTEGER VV
C JAUMMAN RATE CONTRIBUTION (REQUIRED FOR ABAQUS UMAT)
DOUBLE PRECISION CJR(NDI,NDI,NDI,NDI)
C CAUCHY STRESS AND ELASTICITY TENSOR
DOUBLE PRECISION SIGMA(NDI,NDI),DDSIGDDE(NDI,NDI,NDI,NDI),
1 DDPKDDE(NDI,NDI,NDI,NDI)
C TESTING/DEBUG VARS
DOUBLE PRECISION STEST(NDI,NDI), CTEST(NDI,NDI,NDI,NDI)
C----------------------------------------------------------------------
C-------------------------- INITIALIZATIONS ---------------------------
C----------------------------------------------------------------------
C IDENTITY AND PROJECTION TENSORS
UNIT2=ZERO
UNIT4=ZERO
UNIT4S=ZERO
PROJE=ZERO
PROJL=ZERO
C KINEMATICS
DISTGR=ZERO
C=ZERO
B=ZERO
CBAR=ZERO
BBAR=ZERO
UBAR=ZERO
VBAR=ZERO
ROT=ZERO
DET=ZERO
CBARI1=ZERO
CBARI2=ZERO
C VOLUMETRIC
PKVOL=ZERO
SVOL=ZERO
CVOL=ZERO
KBULK=ZERO
PV=ZERO
PPV=ZERO
SSEV=ZERO
C ISOCHORIC
SISO=ZERO
PKISO=ZERO
PK2=ZERO
CISO=ZERO
CFIC=ZERO
SFIC=ZERO
PKFIC=ZERO
C ISOTROPIC
C10=ZERO
C01=ZERO
SSEISO=ZERO
DISO=ZERO
PKMATFIC=ZERO
SMATFIC=ZERO
SISOMATFIC=ZERO
CMISOMATFIC=ZERO
CISOMATFIC=ZERO
C INITIALIZE OTHER CONT HERE
C
C JAUMANN RATE
CJR=ZERO
C TOTAL CAUCHY STRESS AND ELASTICITY TENSORS
SIGMA=ZERO
DDSIGDDE=ZERO
C
C----------------------------------------------------------------------
C------------------------ IDENTITY TENSORS ----------------------------
C----------------------------------------------------------------------
CALL ONEM(UNIT2,UNIT4,UNIT4S,NDI)
C----------------------------------------------------------------------
C------------------- MATERIAL CONSTANTS AND DATA ----------------------
C----------------------------------------------------------------------
C VOLUMETRIC
KBULK = PROPS(1)
C ISOCHORIC ISOTROPIC NEO HOOKE
C10 = PROPS(2)
C01 = PROPS(3)
C ISOCHORIC ANISOTROPIC GHO
K1 = PROPS(4)
K2 = PROPS(5)
KDISP = PROPS(6)
C VISCOUS EFFECTS: MAXWELL ELEMENTS (MAX:3)
C VV = INT(PROPS(7))
C VSCPROPS = PROPS(8:13)
C NUMERICAL COMPUTATIONS
NTERM = 60
C
C STATE VARIABLES
C
IF ((TIME(1).EQ.ZERO).AND.(KSTEP.EQ.1)) THEN
CALL INITIALIZE(STATEV)
ENDIF
C READ STATEV
CALL SDVREAD(STATEV)
C
C----------------------------------------------------------------------
C---------------------------- KINEMATICS ------------------------------
C----------------------------------------------------------------------
C DISTORTION GRADIENT
CALL FSLIP(DFGRD1,DISTGR,DET,NDI)
C INVERSE OF DISTORTION GRADIENT
CALL MATINV3D(DFGRD1,DFGRD1INV,NDI)
C INVERSE OF DISTORTION GRADIENT
CALL MATINV3D(DISTGR,DISTGRINV,NDI)
C CAUCHY-GREEN DEFORMATION TENSORS
CALL DEFORMATION(DFGRD1,C,B,NDI)
CALL DEFORMATION(DISTGR,CBAR,BBAR,NDI)
C FIBER UNIT VECTOR AND STRUCTURAL TENSOR
CALL FIBDIR(FIBORI,M0,MM,NELEM,NOEL,NDI,VORIF,VD,DISTGR,DFGRD1)
C INVARIANTS OF DEVIATORIC DEFORMATION TENSORS
CALL INVARIANTS(CBAR,CBARI1,CBARI2,NDI)
C
CALL PINVARIANTS(CBAR,CBARI4,NDI,M0,LAMBDA,BARLAMBDA,DET)
C
C STRETCH TENSORS
CALL STRETCH(CBAR,BBAR,UBAR,VBAR,NDI)
C ROTATION TENSORS
CALL ROTATION(DISTGR,ROT,UBAR,NDI)
C DEVIATORIC PROJECTION TENSORS
CALL PROJEUL(UNIT2,UNIT4S,PROJE,NDI)
C
CALL PROJLAG(C,UNIT4,PROJL,NDI)
C----------------------------------------------------------------------
C--------------------- CONSTITUTIVE RELATIONS ------------------------
C----------------------------------------------------------------------
C
C---- VOLUMETRIC ------------------------------------------------------
C STRAIN-ENERGY AND DERIVATIVES (CHANGE HERE ACCORDING TO YOUR MODEL)
CALL VOL(SSEV,PV,PPV,KBULK,DET)
CALL ISOMAT(SSEISO,DISO,C10,C01,CBARI1,CBARI2)
CALL ANISOMAT(SSEANISO,DANISO,DISO,K1,K2,KDISP,CBARI4,CBARI1)
C
C---- ISOCHORIC ISOTROPIC ---------------------------------------------
C PK2 'FICTICIOUS' STRESS TENSOR
CALL PK2ISOMATFIC(PKMATFIC,DISO,CBAR,CBARI1,UNIT2,NDI)
C CAUCHY 'FICTICIOUS' STRESS TENSOR
CALL SIGISOMATFIC(SISOMATFIC,PKMATFIC,DISTGR,DET,NDI)
C 'FICTICIOUS' MATERIAL ELASTICITY TENSOR
CALL CMATISOMATFIC(CMISOMATFIC,CBAR,CBARI1,CBARI2,
1 DISO,UNIT2,UNIT4,DET,NDI)
C 'FICTICIOUS' SPATIAL ELASTICITY TENSOR
CALL CSISOMATFIC(CISOMATFIC,CMISOMATFIC,DISTGR,DET,NDI)
C
C---- FIBERS (ONE FAMILY) -------------------------------------------
C
CALL PK2ANISOMATFIC(PKMATFICANISO,DANISO,CBAR,CBARI4,M0,NDI)
CALL PUSH2(SANISOMATFIC,PKMATFICANISO,DISTGR,DET,NDI)
C
CALL CMATANISOMATFIC(CMANISOMATFIC,M0,DANISO,UNIT2,DET,NDI)
CALL PUSH4(CANISOMATFIC,CMANISOMATFIC,DISTGR,DET,NDI)
C----------------------------------------------------------------------
C SUM OF ALL ELASTIC CONTRIBUTIONS
C----------------------------------------------------------------------
C STRAIN-ENERGY
SSE=SSEV+SSEISO+SSEANISO
C PK2 'FICTICIOUS' STRESS
PKFIC=PKMATFIC+PKMATFICANISO
C CAUCHY 'FICTICIOUS' STRESS
SFIC=SISOMATFIC+SANISOMATFIC
C MATERIAL 'FICTICIOUS' ELASTICITY TENSOR
CMFIC=CMISOMATFIC+CMANISOMATFIC
C SPATIAL 'FICTICIOUS' ELASTICITY TENSOR
CFIC=CISOMATFIC+CANISOMATFIC
C
C----------------------------------------------------------------------
C-------------------------- STRESS MEASURES ---------------------------
C----------------------------------------------------------------------
C
C---- VOLUMETRIC ------------------------------------------------------
C PK2 STRESS
CALL PK2VOL(PKVOL,PV,C,NDI)
C CAUCHY STRESS
CALL SIGVOL(SVOL,PV,UNIT2,NDI)
C
C---- ISOCHORIC -------------------------------------------------------
C PK2 STRESS
CALL PK2ISO(PKISO,PKFIC,PROJL,DET,NDI)
C CAUCHY STRESS
CALL SIGISO(SISO,SFIC,PROJE,NDI)
C
C---- VOLUMETRIC + ISOCHORIC ------------------------------------------
C PK2 STRESS
PK2 = PKVOL + PKISO
C CAUCHY STRESS
SIGMA = SVOL + SISO
C
C----------------------------------------------------------------------
C-------------------- MATERIAL ELASTICITY TENSOR ----------------------
C----------------------------------------------------------------------
C
C---- VOLUMETRIC ------------------------------------------------------
C
CALL METVOL(CMVOL,C,PV,PPV,DET,NDI)
C
C---- ISOCHORIC -------------------------------------------------------
C
CALL METISO(CMISO,CMFIC,PROJL,PKISO,PKFIC,C,UNIT2,DET,NDI)
C
C----------------------------------------------------------------------
C
DDPKDDE= CMVOL + CMISO
C
C----------------------------------------------------------------------
C--------------------- SPATIAL ELASTICITY TENSOR ----------------------
C----------------------------------------------------------------------
C
C---- VOLUMETRIC ------------------------------------------------------
C
CALL SETVOL(CVOL,PV,PPV,UNIT2,UNIT4S,NDI)
C
C---- ISOCHORIC -------------------------------------------------------
C
CALL SETISO(CISO,CFIC,PROJE,SISO,SFIC,UNIT2,NDI)
C
C-----JAUMMAN RATE ----------------------------------------------------
C
CALL SETJR(CJR,SIGMA,UNIT2,NDI)
C
C----------------------------------------------------------------------
C
C ELASTICITY TENSOR
DDSIGDDE=CVOL+CISO+CJR
C
C----------------------------------------------------------------------
C------------------------- INDEX ALLOCATION ---------------------------
C----------------------------------------------------------------------
C VOIGT NOTATION - FULLY SIMMETRY IMPOSED
CALL INDEXX(STRESS,DDSDDE,SIGMA,DDSIGDDE,NTENS,NDI)
C
C----------------------------------------------------------------------
C--------------------------- STATE VARIABLES --------------------------
C----------------------------------------------------------------------
C DO K1 = 1, NTENS
C STATEV(1:27) = VISCOUS TENSORS
CALL SDVWRITE(DET,LAMBDA,STATEV)
C END DO
C----------------------------------------------------------------------
RETURN
END
C----------------------------------------------------------------------
C--------------------------- END OF UMAT ------------------------------
C----------------------------------------------------------------------
C
SUBROUTINE PROJEUL(A,AA,PE,NDI)
C> EULERIAN PROJECTION TENSOR
C INPUTS:
C IDENTITY TENSORS - A, AA
C OUTPUTS:
C 4TH ORDER SYMMETRIC EULERIAN PROJECTION TENSOR - PE
C
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER I,J,K,L,NDI
C
DOUBLE PRECISION A(NDI,NDI),AA(NDI,NDI,NDI,NDI),
1 PE(NDI,NDI,NDI,NDI)
C
DO I=1,NDI
DO J=1,NDI
DO K=1,NDI
DO L=1,NDI
PE(I,J,K,L)=AA(I,J,K,L)-(ONE/THREE)*(A(I,J)*A(K,L))
END DO
END DO
END DO
END DO
C
RETURN
END SUBROUTINE PROJEUL
SUBROUTINE SIGVOL(SVOL,PV,UNIT2,NDI)
C> VOLUMETRIC CAUCHY STRESS
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI,I1,J1
DOUBLE PRECISION UNIT2(NDI,NDI),SVOL(NDI,NDI)
DOUBLE PRECISION PV
C
DO I1=1,NDI
DO J1=1,NDI
SVOL(I1,J1)=PV*UNIT2(I1,J1)
END DO
END DO
C
RETURN
END SUBROUTINE SIGVOL
SUBROUTINE ISOMAT(SSEISO,DISO,C10,C01,CBARI1,CBARI2)
C> ISOTROPIC MATRIX : ISOCHORIC SEF AND DERIVATIVES
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
DOUBLE PRECISION SSEISO,DISO(5)
DOUBLE PRECISION C10,C01,CBARI1,CBARI2
C
SSEISO=C10*(CBARI1-THREE)+C01*(CBARI2-THREE)
C
!FIRST DERIVATIVE OF SSEISO IN ORDER TO I1
DISO(1)=C10
!FIRST DERIVATIVE OF SSEISO IN ORDER TO I2
DISO(2)=C01
!SECOND DERIVATIVE OF SSEISO IN ORDER TO I1
DISO(3)=ZERO
!SECOND DERIVATIVE OF SSEISO IN ORDER TO I2
DISO(4)=ZERO
!SECOND DERIVATIVE OF SSEISO IN ORDER TO I1 AND I2
DISO(5)=ZERO
C
RETURN
END SUBROUTINE ISOMAT
SUBROUTINE SDVREAD(STATEV)
C> VISCOUS DISSIPATION: READ STATE VARS
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
DOUBLE PRECISION STATEV(NSDV)
C read your sdvs here. they should be allocated.
C after the viscous terms (only if you use viscosity check hvread)
! POS1=9*VV
! DO I1=1,NCH
! POS2=POS1+I1
! FRAC(I1)=STATEV(POS2)
! ENDDO
C
C
RETURN
C
END SUBROUTINE SDVREAD
SUBROUTINE ANISOMAT(SSEANISO,DANISO,DISO,K1,K2,KDISP,I4,I1)
C> ANISOTROPIC PART : ISOCHORIC SEF AND DERIVATIVES
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
DOUBLE PRECISION SSEISO,DANISO(4),DISO(5)
DOUBLE PRECISION K1,K2,KDISP,I4,I1
DOUBLE PRECISION DUDI1,D2UD2I1,SSEANISO
DOUBLE PRECISION E1,EE2,EE3,DUDI4,D2UD2I4,D2DUDI1DI4,D2DUDI2DI4
C
DUDI1=DISO(1)
D2UD2I1=DISO(3)
C
E1=I4*(ONE-THREE*KDISP)+I1*KDISP-ONE
C
SSEANISO=(K1/K2)*(DEXP(K1*E1*E1)-ONE)
IF(E1.GT.ZERO) THEN
C
EE2=DEXP(K2*E1*E1)
EE3=(ONE+TWO*K2*E1*E1)
C
DUDI1=DUDI1+K1*KDISP*E1*EE2
D2UD2I1=D2UD2I1+K1*KDISP*KDISP*EE3*EE2
C
DUDI4=K1*(ONE-THREE*KDISP)*E1*EE2
C
D2UD2I4=K1*((ONE-THREE*KDISP)**TWO)*EE3*EE2
D2DUDI1DI4=K1*(ONE-THREE*KDISP)*KDISP*EE3*EE2
D2DUDI2DI4=ZERO
C
ELSE
DUDI4=ZERO
D2UD2I4=ZERO
D2DUDI1DI4=ZERO
D2DUDI2DI4=ZERO
D2UD2I1=ZERO
C
END IF
!FIRST DERIVATIVE OF SSEANISO IN ORDER TO I1
DANISO(1)=DUDI4
!FIRST DERIVATIVE OF SSEANISO IN ORDER TO I2
DANISO(2)=D2UD2I4
!2ND DERIVATIVE OF SSEANISO IN ORDER TO I1
DANISO(3)=D2DUDI1DI4
!2ND DERIVATIVE OF SSEANISO IN ORDER TO I2
DANISO(4)=D2DUDI2DI4
C
DISO(1)=DUDI1
DISO(3)=D2UD2I1
C
RETURN
END SUBROUTINE ANISOMAT
SUBROUTINE PK2VOL(PKVOL,PV,C,NDI)
C> VOLUMETRIC PK2 STRESS
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI,I1,J1
DOUBLE PRECISION PKVOL(NDI,NDI),C(NDI,NDI),CINV(NDI,NDI)
DOUBLE PRECISION PV
C
CALL MATINV3D(C,CINV,NDI)
C
DO I1=1,NDI
DO J1=1,NDI
PKVOL(I1,J1)=PV*CINV(I1,J1)
END DO
END DO
C
RETURN
END SUBROUTINE PK2VOL
SUBROUTINE PULL4(MAT,SPATIAL,FINV,DET,NDI)
C> PULL-BACK TIMES DET OF 4TH ORDER TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER I1,J1,K1,L1,II1,JJ1,KK1,LL1,NDI
DOUBLE PRECISION MAT(NDI,NDI,NDI,NDI),FINV(NDI,NDI)
DOUBLE PRECISION SPATIAL(NDI,NDI,NDI,NDI)
DOUBLE PRECISION AUX,DET
C
DO I1=1,NDI
DO J1=1,NDI
DO K1=1,NDI
DO L1=1,NDI
AUX=ZERO
DO II1=1,NDI
DO JJ1=1,NDI
DO KK1=1,NDI
DO LL1=1,NDI
AUX=AUX+DET*
+ FINV(I1,II1)*FINV(J1,JJ1)*
+ FINV(K1,KK1)*FINV(L1,LL1)*SPATIAL(II1,JJ1,KK1,LL1)
END DO
END DO
END DO
END DO
MAT(I1,J1,K1,L1)=AUX
END DO
END DO
END DO
END DO
C
RETURN
END SUBROUTINE PULL4
SUBROUTINE SETJR(CJR,SIGMA,UNIT2,NDI)
C> JAUMAN RATE CONTRIBUTION FOR THE SPATIAL ELASTICITY TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI,I1,J1,K1,L1
DOUBLE PRECISION UNIT2(NDI,NDI),
1 CJR(NDI,NDI,NDI,NDI),SIGMA(NDI,NDI)
C
DO I1 = 1, NDI
DO J1 = 1, NDI
DO K1 = 1, NDI
DO L1 = 1, NDI
CJR(I1,J1,K1,L1)=
1 (ONE/TWO)*(UNIT2(I1,K1)*SIGMA(J1,L1)
2 +SIGMA(I1,K1)*UNIT2(J1,L1)+UNIT2(I1,L1)*SIGMA(J1,K1)
3 +SIGMA(I1,L1)*UNIT2(J1,K1))
END DO
END DO
END DO
END DO
C
RETURN
END SUBROUTINE SETJR
SUBROUTINE CONTRACTION44(S,LT,RT,NDI)
C> DOUBLE CONTRACTION BETWEEN 4TH ORDER TENSORS
C> INPUT:
C> LT - RIGHT 4TH ORDER TENSOR
C> RT - LEFT 4TH ORDER TENSOR
C> OUTPUT:
C> S - DOUBLE CONTRACTED TENSOR (4TH ORDER)
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER I1,J1,K1,L1,M1,N1,NDI
C
DOUBLE PRECISION LT(NDI,NDI,NDI,NDI),RT(NDI,NDI,NDI,NDI)
DOUBLE PRECISION S(NDI,NDI,NDI,NDI)
DOUBLE PRECISION AUX
C
DO I1=1,NDI
DO J1=1,NDI
DO K1=1,NDI
DO L1=1,NDI
AUX=ZERO
DO M1=1,NDI
DO N1=1,NDI
AUX=AUX+LT(I1,J1,M1,N1)*RT(M1,N1,K1,L1)
END DO
END DO
S(I1,J1,K1,L1)=AUX
END DO
END DO
END DO
END DO
C
RETURN
END SUBROUTINE CONTRACTION44
SUBROUTINE INITIALIZE(STATEV)
C
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
C COMMON /KCOMMON/KBLOCK
C
C DOUBLE PRECISION TIME(2),KSTEP
INTEGER I1,POS,POS1,POS2,POS3
DOUBLE PRECISION STATEV(NSDV)
C DETERMINANT
STATEV(1)=ONE
C
RETURN
C
END SUBROUTINE INITIALIZE
SUBROUTINE SETVOL(CVOL,PV,PPV,UNIT2,UNIT4S,NDI)
C> VOLUMETRIC SPATIAL ELASTICITY TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI,I1,J1,K1,L1
DOUBLE PRECISION UNIT2(NDI,NDI),UNIT4S(NDI,NDI,NDI,NDI),
1 CVOL(NDI,NDI,NDI,NDI)
DOUBLE PRECISION PV,PPV
C
DO I1 = 1, NDI
DO J1 = 1, NDI
DO K1 = 1, NDI
DO L1 = 1, NDI
CVOL(I1,J1,K1,L1)=
1 PPV*UNIT2(I1,J1)*UNIT2(K1,L1)
2 -TWO*PV*UNIT4S(I1,J1,K1,L1)
END DO
END DO
END DO
END DO
C
RETURN
END SUBROUTINE SETVOL
SUBROUTINE PK2ISOMATFIC(FIC,DISO,CBAR,CBARI1,UNIT2,NDI)
C> ISOTROPIC MATRIX: 2PK 'FICTICIOUS' STRESS TENSOR
C INPUT:
C DISO - STRAIN-ENERGY DERIVATIVES
C CBAR - DEVIATORIC LEFT CAUCHY-GREEN TENSOR
C CBARI1,CBARI2 - CBAR INVARIANTS
C UNIT2 - 2ND ORDER IDENTITY TENSOR
C OUTPUT:
C FIC - 2ND PIOLA KIRCHOOF 'FICTICIOUS' STRESS TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER I1,J1,NDI
DOUBLE PRECISION FIC(NDI,NDI),DISO(5),CBAR(NDI,NDI),UNIT2(NDI,NDI)
DOUBLE PRECISION DUDI1,DUDI2,CBARI1
DOUBLE PRECISION AUX1,AUX2
C
DUDI1=DISO(1)
DUDI2=DISO(2)
C
AUX1=TWO*(DUDI1+CBARI1*DUDI2)
AUX2=-TWO*DUDI2
C
DO I1=1,NDI
DO J1=1,NDI
FIC(I1,J1)=AUX1*UNIT2(I1,J1)+AUX2*CBAR(I1,J1)
END DO
END DO
C
RETURN
END SUBROUTINE PK2ISOMATFIC
SUBROUTINE UEXTERNALDB(LOP,LRESTART,TIME,DTIME,KSTEP,KINC)
C> READ MESH DATA
INCLUDE 'ABA_PARAM.INC'
INCLUDE 'PARAM_UMAT.INC'
C
C UEXTERNAL just called once; work in parallel computing
C ADD COMMON BLOCKS HERE IF NEEDED (and in UMAT)
C COMMON /KBLOCK/KBLOCK
COMMON /KFIB/FIBORI
C
REAL*8 DTIME
DIMENSION TIME(2)
CHARACTER(256) FILENAME
CHARACTER(256) JOBDIR
INTEGER LENJOBDIR
REAL*8 FIBORI(NELEM,4)
C LOP=0 --> START OF THE ANALYSIS
IF(LOP.EQ.0.OR.LOP.EQ.4) THEN
C
CALL GETOUTDIR(JOBDIR,LENJOBDIR)
C DIR1 DEFNIED IN PARAM_UMAT.INC
FILENAME=JOBDIR(:LENJOBDIR)//'/'//DIR1
C
OPEN(15,FILE=FILENAME)
DO I=1,NELEM
READ(15,*) (FIBORI(I,J),J=1,4)
END DO
CLOSE(15)
!C
END IF
C
RETURN
C
END SUBROUTINE UEXTERNALDB
SUBROUTINE GETOUTDIR(OUTDIR, LENOUTDIR)
C> GET CURRENT WORKING DIRECTORY
INCLUDE 'aba_param.inc'
C
CHARACTER*256 OUTDIR
INTEGER LENOUTDIR
C
CALL GETCWD(OUTDIR)
c OUTDIR=OUTDIR(1:SCAN(OUTDIR,'\',BACK=.TRUE.)-1)
LENOUTDIR=LEN_TRIM(OUTDIR)
C
RETURN
END SUBROUTINE GETOUTDIR
SUBROUTINE SIGISOMATFIC(SFIC,PKFIC,F,DET,NDI)
C> ISOTROPIC MATRIX: ISOCHORIC CAUCHY STRESS
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI
DOUBLE PRECISION SFIC(NDI,NDI),F(NDI,NDI),
1 PKFIC(NDI,NDI)
DOUBLE PRECISION DET
C
CALL PUSH2(SFIC,PKFIC,F,DET,NDI)
C
RETURN
END SUBROUTINE SIGISOMATFIC
SUBROUTINE PK2ANISOMATFIC(AFIC,DANISO,CBAR,INV4,ST0,NDI)
C> ANISOTROPIC MATRIX: 2PK 'FICTICIOUS' STRESS TENSOR
C INPUT:
C DANISO - ANISOTROPIC STRAIN-ENERGY DERIVATIVES
C CBAR - DEVIATORIC LEFT CAUCHY-GREEN TENSOR
C INV1,INV4 -CBAR INVARIANTS
C UNIT2 - 2ND ORDER IDENTITY TENSOR
C OUTPUT:
C AFIC - 2ND PIOLA KIRCHOOF 'FICTICIOUS' STRESS TENSOR
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI
DOUBLE PRECISION AFIC(NDI,NDI),DANISO(3),CBAR(3,3)
DOUBLE PRECISION DUDI4,DI4DC(3,3),INV4
DOUBLE PRECISION ST0(3,3)
C
C
C-----------------------------------------------------------------------------
!FIRST DERIVATIVE OF SSEANISO IN ORDER TO I4
DUDI4=DANISO(1)
C
DI4DC=ST0
C
AFIC=TWO*(DUDI4*DI4DC)
C
RETURN
END SUBROUTINE PK2ANISOMATFIC
SUBROUTINE CONTRACTION22(AUX,LT,RT,NDI)
C> DOUBLE CONTRACTION BETWEEN 2ND ORDER AND 2ND ORDER TENSOR
C> INPUT:
C> LT - RIGHT 2ND ORDER TENSOR
C> RT - LEFT 4TH ODER TENSOR
C> OUTPUT:
C> AUX - DOUBLE CONTRACTED TENSOR (SCALAR)
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER I1,J1,K1,L1,NDI
C
DOUBLE PRECISION LT(NDI,NDI),RT(NDI,NDI)
DOUBLE PRECISION AUX
C
AUX=ZERO
DO I1=1,NDI
DO J1=1,NDI
AUX=AUX+LT(I1,J1)*RT(J1,I1)
END DO
END DO
RETURN
END SUBROUTINE CONTRACTION22
SUBROUTINE STRETCH(C,B,U,V,NDI)
C> STRETCH TENSORS
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER NDI
DOUBLE PRECISION C(NDI,NDI),B(NDI,NDI),U(NDI,NDI),V(NDI,NDI)
DOUBLE PRECISION EIGVAL(NDI),OMEGA(NDI),EIGVEC(NDI,NDI)
C
CALL SPECTRAL(C,OMEGA,EIGVEC)
C
EIGVAL(1) = DSQRT(OMEGA(1))
EIGVAL(2) = DSQRT(OMEGA(2))
EIGVAL(3) = DSQRT(OMEGA(3))
C
U(1,1) = EIGVAL(1)
U(2,2) = EIGVAL(2)
U(3,3) = EIGVAL(3)
C
U = MATMUL(MATMUL(EIGVEC,U),TRANSPOSE(EIGVEC))
C
CALL SPECTRAL(B,OMEGA,EIGVEC)
C
EIGVAL(1) = DSQRT(OMEGA(1))
EIGVAL(2) = DSQRT(OMEGA(2))
EIGVAL(3) = DSQRT(OMEGA(3))
C write(*,*) eigvec(1,1),eigvec(2,1),eigvec(3,1)
C
V(1,1) = EIGVAL(1)
V(2,2) = EIGVAL(2)
V(3,3) = EIGVAL(3)
C
V = MATMUL(MATMUL(EIGVEC,V),TRANSPOSE(EIGVEC))
RETURN
END SUBROUTINE STRETCH
SUBROUTINE MATINV3D(A,A_INV,NDI)
C> INVERSE OF A 3X3 MATRIX
C RETURN THE INVERSE OF A(3,3) - A_INV
IMPLICIT NONE
C
INTEGER NDI
C
DOUBLE PRECISION A(NDI,NDI),A_INV(NDI,NDI),DET_A,DET_A_INV
C
DET_A = A(1,1)*(A(2,2)*A(3,3) - A(3,2)*A(2,3)) -
+ A(2,1)*(A(1,2)*A(3,3) - A(3,2)*A(1,3)) +
+ A(3,1)*(A(1,2)*A(2,3) - A(2,2)*A(1,3))
IF (DET_A .LE. 0.D0) THEN
WRITE(*,*) 'WARNING: SUBROUTINE MATINV3D:'
WRITE(*,*) 'WARNING: DET OF MAT=',DET_A
RETURN
END IF
C
DET_A_INV = 1.D0/DET_A
C
A_INV(1,1) = DET_A_INV*(A(2,2)*A(3,3)-A(3,2)*A(2,3))
A_INV(1,2) = DET_A_INV*(A(3,2)*A(1,3)-A(1,2)*A(3,3))
A_INV(1,3) = DET_A_INV*(A(1,2)*A(2,3)-A(2,2)*A(1,3))
A_INV(2,1) = DET_A_INV*(A(3,1)*A(2,3)-A(2,1)*A(3,3))
A_INV(2,2) = DET_A_INV*(A(1,1)*A(3,3)-A(3,1)*A(1,3))
A_INV(2,3) = DET_A_INV*(A(2,1)*A(1,3)-A(1,1)*A(2,3))
A_INV(3,1) = DET_A_INV*(A(2,1)*A(3,2)-A(3,1)*A(2,2))
A_INV(3,2) = DET_A_INV*(A(3,1)*A(1,2)-A(1,1)*A(3,2))
A_INV(3,3) = DET_A_INV*(A(1,1)*A(2,2)-A(2,1)*A(1,2))
C
RETURN
END SUBROUTINE MATINV3D
SUBROUTINE SPECTRAL(A,D,V)
C> EIGENVALUES AND EIGENVECTOR OF A 3X3 MATRIX
C THIS SUBROUTINE CALCULATES THE EIGENVALUES AND EIGENVECTORS OF
C A SYMMETRIC 3X3 MATRIX A.
C
C THE OUTPUT CONSISTS OF A VECTOR D CONTAINING THE THREE
C EIGENVALUES IN ASCENDING ORDER, AND A MATRIX V WHOSE
C COLUMNS CONTAIN THE CORRESPONDING EIGENVECTORS.
C
IMPLICIT NONE
C
INTEGER NP,NROT
PARAMETER(NP=3)
C
DOUBLE PRECISION D(3),V(3,3),A(3,3),E(3,3)
C
E = A
C
CALL JACOBI(E,3,NP,D,V,NROT)
CALL EIGSRT(D,V,3,NP)
C
RETURN
END SUBROUTINE SPECTRAL
C***********************************************************************
SUBROUTINE JACOBI(A,N,NP,D,V,NROT)
C
C COMPUTES ALL EIGENVALUES AND EIGENVECTORS OF A REAL SYMMETRIC
C MATRIX A, WHICH IS OF SIZE N BY N, STORED IN A PHYSICAL
C NP BY NP ARRAY. ON OUTPUT, ELEMENTS OF A ABOVE THE DIAGONAL
C ARE DESTROYED, BUT THE DIAGONAL AND SUB-DIAGONAL ARE UNCHANGED
C AND GIVE FULL INFORMATION ABOUT THE ORIGINAL SYMMETRIC MATRIX.
C VECTOR D RETURNS THE EIGENVALUES OF A IN ITS FIRST N ELEMENTS.
C V IS A MATRIX WITH THE SAME LOGICAL AND PHYSICAL DIMENSIONS AS
C A WHOSE COLUMNS CONTAIN, UPON OUTPUT, THE NORMALIZED
C EIGENVECTORS OF A. NROT RETURNS THE NUMBER OF JACOBI ROTATION
C WHICH WERE REQUIRED.
C
C THIS SUBROUTINE IS TAKEN FROM 'NUMERICAL RECIPES.'
C
IMPLICIT NONE
INCLUDE 'PARAM_UMAT.INC'
C
INTEGER IP,IQ,N,NMAX,NP,NROT,I,J
PARAMETER (NMAX=100)
C
DOUBLE PRECISION A(NP,NP),D(NP),V(NP,NP),B(NMAX),Z(NMAX),
+ SM,TRESH,G,T,H,THETA,S,C,TAU