-
Notifications
You must be signed in to change notification settings - Fork 0
/
dyn21b.f
15848 lines (15848 loc) · 541 KB
/
dyn21b.f
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 $Id: dyn21b.F 105368 2016-02-03 12:58:52Z thomask $
c
subroutine usrshl(rule,ixp,x,rhs,rhr,vt,vr,strain,yhatn,fibl,
1 auxvec,mtype,ro,cm,csprop,nsubgv,mtnum,nfegp,ihgq,hgq,ies,ener,
2 mpusr,lav,nmel,nnm1,mxe,ibqshl,iqtype,bkqs,gmi,ihgenf,hgener,
3 lft,llt,rhssav,eig,eign,qextra,nmtcon,ithxpid,ietyp,cmusr,
4 lenvec8,xipn,drlstr,rhsl,loceps,epsint,eosp,isdrill,rots)
c
c******************************************************************
c| Livermore Software Technology Corporation (LSTC) |
c| ------------------------------------------------------------ |
c| Copyright 1987-2008 Livermore Software Tech. Corp |
c| All rights reserved |
c******************************************************************
c
c main subroutine for the user defined shell
c
include 'nlqparm'
include 'implicit1.inc'
c ... implicit common ...
integer lnodim,ndofpn,nnpke,melemt,imlft,imllt,is17loc,is18loc,
& imp_mxe
common/bki03iloc/lnodim(nlq,48),ndofpn,nnpke,melemt,imlft,imllt,
& is17loc,is18loc,imp_mxe
c
real ske,sme,ske_unsym(nlq,100,100)
equivalence ( ske, ske_unsym )
common/bki03rloc/ske(nlq,10440),sme(nlq,10440)
c
integer lmke
common/bki04iloc/lmke(nlq,144)
include 'memaia.inc'
include 'nhisparm.inc'
include 'shlioc.inc'
common/aux00loc/
& ds11(nlq),ds12(nlq),ds13(nlq),ds22(nlq),ds23(nlq),
& ds33(nlq),sjunk(nlq,4),
& str33(nlq),enginc(nlq)
common/aux01loc/
&ft11(nlq),ft12(nlq),ft13(nlq),ft21(nlq),ft22(nlq),ft23(nlq),
&fm11(nlq),fm12(nlq),fm21(nlq),fm22(nlq),
&fm31(nlq),fm32(nlq),fm41(nlq),fm42(nlq),
&fmr11(nlq),fmr12(nlq),fmr21(nlq),fmr22(nlq),fmr31(nlq),
&fmr32(nlq),fmr41(nlq),fmr42(nlq),sg5(nlq),sg6(nlq)
common/aux2loc/dstrn(nlq,6),
1 wzzdt(nlq),wyydt(nlq),wxxdt(nlq),einc(nlq)
common/aux5loc/
&b1vx(nlq),b1vy(nlq),b1vz(nlq),b2vx(nlq),b2vy(nlq),b2vz(nlq),
&b1tx(nlq),b1ty(nlq),b2tx(nlq),b2ty(nlq),bxyv(nlq),bxyt(nlq),
&epyz(nlq),epzx(nlq)
common/aux7loc/
1 vx1(nlq),vx2(nlq),vx3(nlq),vx4(nlq),
2 vx5(nlq),vx6(nlq),vx7(nlq),vx8(nlq),
3 vy1(nlq),vy2(nlq),vy3(nlq),vy4(nlq),
4 vy5(nlq),vy6(nlq),vy7(nlq),vy8(nlq),
5 vz1(nlq),vz2(nlq),vz3(nlq),vz4(nlq),
6 vz5(nlq),vz6(nlq),vz7(nlq),vz8(nlq)
common/aux9loc/vlrho(nlq),vol(nlq)
common/aux10loc/area(nlq),
1 px1(nlq),px2(nlq),px3(nlq),px4(nlq),
& px5(nlq),px6(nlq),px7(nlq),px8(nlq),
2 py1(nlq),py2(nlq),py3(nlq),py4(nlq),
& py5(nlq),py6(nlq),py7(nlq),py8(nlq),
3 pz1(nlq),pz2(nlq),pz3(nlq),pz4(nlq),
& pz5(nlq),pz6(nlq),pz7(nlq),pz8(nlq),
4 dx1(nlq),dx2(nlq),dx3(nlq),dx4(nlq),
5 dx5(nlq),dx6(nlq),dx7(nlq),dx8(nlq),
6 dy1(nlq),dy2(nlq),dy3(nlq),dy4(nlq),
7 dy5(nlq),dy6(nlq),dy7(nlq),dy8(nlq),
8 dz1(nlq),dz2(nlq),dz3(nlq),dz4(nlq),
9 dz5(nlq),dz6(nlq),dz7(nlq),dz8(nlq)
real mx1,my1,mz1,mx2,my2,mz2,mx3,my3,mz3,mx4,my4,mz4
common/aux13loc/
&zeta(nlq),thick(nlq),fga(nlq),fgb(nlq),fgc(nlq),
&gl11(nlq),gl12(nlq),gl13(nlq),gl21(nlq),gl22(nlq),gl23(nlq),
&gl31(nlq),gl32(nlq),gl33(nlq),
&x1(nlq),y1(nlq),z1(nlq),x2(nlq),y2(nlq),z2(nlq),
&x3(nlq),y3(nlq),z3(nlq),x4(nlq),y4(nlq),z4(nlq),
&fx1(nlq),fy1(nlq),fz1(nlq),fx2(nlq),fy2(nlq),fz2(nlq),
&fx3(nlq),fy3(nlq),fz3(nlq),fx4(nlq),fy4(nlq),fz4(nlq),
&mx1(nlq),my1(nlq),mz1(nlq),mx2(nlq),my2(nlq),mz2(nlq),
&mx3(nlq),my3(nlq),mz3(nlq),mx4(nlq),my4(nlq),mz4(nlq)
common/aux12loc/
1 wxx1(nlq),wxx2(nlq),wxx3(nlq),wxx4(nlq),
2 wyy1(nlq),wyy2(nlq),wyy3(nlq),wyy4(nlq),
3 wzz1(nlq),wzz2(nlq),wzz3(nlq),wzz4(nlq),
4 a13(nlq),a23(nlq),a33(nlq)
common/aux14loc/ax(nlq,7)
common/aux33loc/
1 ix1(nlq),ix2(nlq),ix3(nlq),ix4(nlq),ixs(nlq,4),mxt(nlq)
common/aux35loc/rhoa(nlq),cxx(nlq),fcl(nlq),sidem(nlq)
common/aux45loc/crap(nlq,124),
1 dndx(nlq,4),dndy(nlq,4),hnhx(nlq,4),hnhy(nlq,4)
common/bel7loc/ixsld(nlq,8,5),ixshl(nlq,4,5),
. bmtrx(nlq,3,3,8*(3+NXDOFUE)),
. cmtrx(nlq,3,3,8*(3+NXDOFUE)),xdof(nlq,8,NXDOFUE),
. dxdof(nlq,8,NXDOFUE),xhdof(nlq,8,NXDOFUE),
. bvec(nlq,8*(3+NXDOFUE)),cvec(nlq,8*(3+NXDOFUE)),
. frc(nlq,8*(3+NXDOFUE)),
. stiff(nlq,64*(3+NXDOFUE)*(3+NXDOFUE)),
. sigv(nlq),
. gmtrx(nlq,3,3),hmtrx(nlq,3,3),cvltot(nlq),
. xh1(nlq),xh2(nlq),xh3(nlq),xh4(nlq),
. xh5(nlq),xh6(nlq),xh7(nlq),xh8(nlq),
. yh1(nlq),yh2(nlq),yh3(nlq),yh4(nlq),
. yh5(nlq),yh6(nlq),yh7(nlq),yh8(nlq),
. zh1(nlq),zh2(nlq),zh3(nlq),zh4(nlq),
. zh5(nlq),zh6(nlq),zh7(nlq),zh8(nlq),
. hl11(nlq),hl12(nlq),hl13(nlq),hl21(nlq),hl22(nlq),
. hl23(nlq),hl31(nlq),hl32(nlq),hl33(nlq),
. xx1(nlq),xx2(nlq),xx3(nlq),xx4(nlq),
. xx5(nlq),xx6(nlq),xx7(nlq),xx8(nlq),
. yy1(nlq),yy2(nlq),yy3(nlq),yy4(nlq),
. yy5(nlq),yy6(nlq),yy7(nlq),yy8(nlq),
. zz1(nlq),zz2(nlq),zz3(nlq),zz4(nlq),
. zz5(nlq),zz6(nlq),zz7(nlq),zz8(nlq),vlm(nlq)
common/failuloc/sieu(nlq),fail(nlq),ifaili(nlq)
common/maxsvloc/mxsave,ipt_type(300)
common/prescloc/voltot(nlq)
common/shloptloc/ibelyt
common/hourgloc/ymod(nlq),gmod(nlq),ifsv(nlq)
common/sidesloc/sidmn(nlq)
common/soundloc/sndspd(nlq),sndsp(nlq),diagm(nlq),sarea(nlq),
. dxl(nlq)
common/subtssloc/dt1siz(nlq)
common/vect13loc/
1 yhtnx1(nlq),yhtny1(nlq),yhtnz1(nlq),
2 yhtnx2(nlq),yhtny2(nlq),yhtnz2(nlq),
3 yhtnx3(nlq),yhtny3(nlq),yhtnz3(nlq),
4 yhtnx4(nlq),yhtny4(nlq),yhtnz4(nlq),
5 yhatx1(nlq),yhaty1(nlq),yhatz1(nlq),
6 yhatx2(nlq),yhaty2(nlq),yhatz2(nlq),
7 yhatx3(nlq),yhaty3(nlq),yhatz3(nlq),
8 yhatx4(nlq),yhaty4(nlq),yhatz4(nlq),
9 yhtmx1(nlq),yhtmy1(nlq),yhtmz1(nlq),
& yhtmx2(nlq),yhtmy2(nlq),yhtmz2(nlq),
& yhtmx3(nlq),yhtmy3(nlq),yhtmz3(nlq),
& yhtmx4(nlq),yhtmy4(nlq),yhtmz4(nlq)
c
common/bk00/numnp,numpc,numlp,neq,ndof,nlcur,numcl,numvc,
1 ndtpts,nelmd,nmmat,numelh,numelb,numels,numelt,numdp,
2 grvity,idirgv,nodspc,nspcor
common/bk02/iburn,dt1,dt2,isdo
common/bk25/iflg,dfavg,detavg,davg,ielmtc,ityptc
common/bk26/begtim,nintcy
common/bk28/summss,xke,xpe,tt,xte0,erodeke,erodeie,selie,selke,
1 erodehg
common/bktb/ntbsl,nods,nodm,ips,ipm,ipa,ipb,ipc,ipd,
1 ipe,ipf,ipg,iph,ipi,ipj,ipk
common/eigvc/eke,eme,rsav,dt2std,isavdt2,iegflg,iegflg0(10)
common/hour11loc/ebar(nlq),ebarmn(nlq),eyld(nlq),etanmd(nlq)
logical failur,failgl
common/failcm/failur,failgl
common/neicmm/neiph,neips,maxint,itrist,itetst,labatto,neifut(2),
. ldarry,lmarry,lcdamp,valdmp,dsclfcs(6)
common/numcpu/ncpu,ncpua,ncpub,lenvec(8)
common/shel/xi(4),eta(4),zetq(6,6),qw(6,6),xinod(4),etand(4),nz(6)
common/ssbsis/h(8,10,10),pr(8,10,10),ps(8,10,10),pt(8,10,10),
1 wgts(10,10),zet(10,10),iptz(2)
common/shlopt/istrn,istupd,ibelyts,miter,wrpang,ipstpd,intsts,
1 nodsts,intstn,nodstn,jstrn
c
real ies(1)
real*8 x,rots
dimension ixp(5,*),x(3,*),rhs(*),rhr(*),vt(3,*),vr(3,*),
1 yhatn(12,*),rots(3,*),
1 auxvec(*),mtype(*),ro(*),cm(*),csprop(24,*),rule(mpusr,3,*),
2 fibl(9,*),nsubgv(*),mtnum(*),
3 nfegp(*),ihgq(1),hgq(*),strain(12,*),isrn(2,10),ener(*),
4 iqtype(*),bkqs(3,*),gmi(4,*),hgener(*),rhssav(27,*),eig(3,*),
5 eign(3,*),qextra(*),failjw(nlq),drlstr(4,*),rhsl(24,*)
dimension cmusr(48,*),xipn(4,100,*),loceps(*),epsint(*)
dimension scr(nlq,12)
c
data isrn/1,1,1,2,2,3,1,4,2,5,1,6,1,7,1,8,1,9,1,10/
data zero/0.0/
c
c mxe = internal part number
c
c Inverse of density
c
c$omp threadprivate (/bki03iloc/)
c$omp threadprivate (/bki03rloc/)
c$omp threadprivate (/bki04iloc/)
c$omp threadprivate (/aux00loc/)
c$omp threadprivate (/aux01loc/)
c$omp threadprivate (/aux2loc/)
c$omp threadprivate (/aux5loc/)
c$omp threadprivate (/aux7loc/)
c$omp threadprivate (/aux9loc/)
c$omp threadprivate (/aux10loc/)
c$omp threadprivate (/aux12loc/)
c$omp threadprivate (/aux13loc/)
c$omp threadprivate (/aux14loc/)
c$omp threadprivate (/aux33loc/)
c$omp threadprivate (/aux35loc/)
c$omp threadprivate (/aux45loc/)
c$omp threadprivate (/bel7loc/)
c$omp threadprivate (/failuloc/)
c$omp threadprivate (/hourgloc/)
c$omp threadprivate (/hour11loc/)
c$omp threadprivate (/maxsvloc/)
c$omp threadprivate (/prescloc/)
c$omp threadprivate (/shloptloc/)
c$omp threadprivate (/sidesloc/)
c$omp threadprivate (/soundloc/)
c$omp threadprivate (/subtssloc/)
c$omp threadprivate (/vect13loc/)
rho=1./ro(mxe)
c
c Number of integration points in the plane and
c through the thickness
c
nipp=nint(cmusr(1,mxe))
nipt=0
if (nipp.gt.0) nipt=nint(csprop(2,mxe))/nipp
c
c User shell properties
c
nxdof=nint(cmusr(2,mxe))
ihgf=nint(cmusr(4,mxe))
if (nipp.eq.0) ihgf=0
iunf=nint(cmusr(3,mxe))
itaj=nint(cmusr(5,mxe))
lmc=nint(cmusr(6,mxe))
nhsv=nint(cmusr(7,mxe))
iloc=nint(cmusr(8,mxe))
c
c Quadrature rule or integration rule ID
c
if (nipt.gt.0) then
irl=nint(csprop(4,mxe))
nrl=iabs(irl)
c
c Switch to trapezoidal rule
c
if (nipt.gt.10.and.irl.eq.0) then
irl=1
endif
c
c User defined integration rule is specified
c check for failure option for mixed material types
c
if (irl.lt.0) then
ifl=rule(mpusr-1,1,nrl)
if (ifl.eq.1) ifaili(lft)=1
endif
endif
c
c Material type
c
mte=mtype(mxe)
c
c Sound speed initialization
c
sndspd(lft)=1.e-16
c
c Gather geometry and kinematical properties
c
c xi,yi,zi = Nodal coordinates at t_{n+1}
c xhi,yhi,zhi = Nodal coordinates at t_{n+1/2}
c dxi,dyi,dzi = Translational increments
c wxxi,wyyi,wzzi = Rotational increments
c
do i=lft,llt
x1(i) =x(1,ix1(i))
y1(i) =x(2,ix1(i))
z1(i) =x(3,ix1(i))
dx1(i)=vt(1,ix1(i))*dt1siz(i)
dy1(i)=vt(2,ix1(i))*dt1siz(i)
dz1(i)=vt(3,ix1(i))*dt1siz(i)
wxx1(i)=vr(1,ix1(i))*dt1siz(i)
wyy1(i)=vr(2,ix1(i))*dt1siz(i)
wzz1(i)=vr(3,ix1(i))*dt1siz(i)
x2(i) =x(1,ix2(i))
y2(i) =x(2,ix2(i))
z2(i) =x(3,ix2(i))
dx2(i)=vt(1,ix2(i))*dt1siz(i)
dy2(i)=vt(2,ix2(i))*dt1siz(i)
dz2(i)=vt(3,ix2(i))*dt1siz(i)
wxx2(i)=vr(1,ix2(i))*dt1siz(i)
wyy2(i)=vr(2,ix2(i))*dt1siz(i)
wzz2(i)=vr(3,ix2(i))*dt1siz(i)
x3(i) =x(1,ix3(i))
y3(i) =x(2,ix3(i))
z3(i) =x(3,ix3(i))
dx3(i)=vt(1,ix3(i))*dt1siz(i)
dy3(i)=vt(2,ix3(i))*dt1siz(i)
dz3(i)=vt(3,ix3(i))*dt1siz(i)
wxx3(i)=vr(1,ix3(i))*dt1siz(i)
wyy3(i)=vr(2,ix3(i))*dt1siz(i)
wzz3(i)=vr(3,ix3(i))*dt1siz(i)
x4(i) =x(1,ix4(i))
y4(i) =x(2,ix4(i))
z4(i) =x(3,ix4(i))
dx4(i)=vt(1,ix4(i))*dt1siz(i)
dy4(i)=vt(2,ix4(i))*dt1siz(i)
dz4(i)=vt(3,ix4(i))*dt1siz(i)
wxx4(i)=vr(1,ix4(i))*dt1siz(i)
wyy4(i)=vr(2,ix4(i))*dt1siz(i)
wzz4(i)=vr(3,ix4(i))*dt1siz(i)
enddo
c
c Coordinates and increments are expressed in global system
c
if (nxdof.gt.0) then
do k=1,4
do j=1,nxdof
nsnd=(j-1)/3+1
nsdf=j-(nsnd-1)*3
do i=lft,llt
xdof(i,k,j)=x(nsdf,ixshl(i,k,nsnd))
dxdof(i,k,j)=vt(nsdf,ixshl(i,k,nsnd))*dt1siz(i)
enddo
enddo
enddo
endif
c
c
c Accuracy option is on, compute half step geometry
c
if (lenvec8.ne.0) then
do i=lft,llt
xh1(i)=x1(i)-.5*dx1(i)
yh1(i)=y1(i)-.5*dy1(i)
zh1(i)=z1(i)-.5*dz1(i)
xh2(i)=x2(i)-.5*dx2(i)
yh2(i)=y2(i)-.5*dy2(i)
zh2(i)=z2(i)-.5*dz2(i)
xh3(i)=x3(i)-.5*dx3(i)
yh3(i)=y3(i)-.5*dy3(i)
zh3(i)=z3(i)-.5*dz3(i)
xh4(i)=x4(i)-.5*dx4(i)
yh4(i)=y4(i)-.5*dy4(i)
zh4(i)=z4(i)-.5*dz4(i)
enddo
c
if (nxdof.gt.0) then
do k=1,4
do j=1,nxdof
do i=lft,llt
xhdof(i,k,j)=xdof(i,k,j)-.5*dxdof(i,k,j)
enddo
enddo
enddo
endif
c
else
do i=lft,llt
xh1(i)=x1(i)
yh1(i)=y1(i)
zh1(i)=z1(i)
xh2(i)=x2(i)
yh2(i)=y2(i)
zh2(i)=z2(i)
xh3(i)=x3(i)
yh3(i)=y3(i)
zh3(i)=z3(i)
xh4(i)=x4(i)
yh4(i)=y4(i)
zh4(i)=z4(i)
enddo
c
if (nxdof.gt.0) then
do k=1,4
do j=1,nxdof
do i=lft,llt
xhdof(i,k,j)=xdof(i,k,j)
enddo
enddo
enddo
endif
endif
c
c Coordinates for X-tra dofs are expressed in
c global system (if for some reason directionally dependent)
c
if (iunf.ne.0) then
c
c Load nodal vectors from previous step
c
do i=lft,llt
yhtnx1(i)=yhatn(1,i+nnm1)
yhtny1(i)=yhatn(2,i+nnm1)
yhtnz1(i)=yhatn(3,i+nnm1)
yhtnx2(i)=yhatn(4,i+nnm1)
yhtny2(i)=yhatn(5,i+nnm1)
yhtnz2(i)=yhatn(6,i+nnm1)
yhtnx3(i)=yhatn(7,i+nnm1)
yhtny3(i)=yhatn(8,i+nnm1)
yhtnz3(i)=yhatn(9,i+nnm1)
yhtnx4(i)=yhatn(10,i+nnm1)
yhtny4(i)=yhatn(11,i+nnm1)
yhtnz4(i)=yhatn(12,i+nnm1)
enddo
c
c Update nodal vectors
c
call usrshl_nvu(lenvec8,lft,llt)
c
endif
c
c Initialize some parameters
c
do i=lft,llt
c failure
fail(i) =1.0
failjw(i)=1.0
c internal energy
sieu(i) =ies(nnm1+i)
c volume at t_{n+1/2} and t_{n+1}
voltot(i)=0.
cvltot(i)=0.
enddo
c
c For shell thickness changes
c
if (istupd.ne.0) then
if (iunf.ne.0) then
do i=lft,llt
ds11(i)=0.
ds22(i)=0.
ds33(i)=0.
ds12(i)=0.
ds23(i)=0.
ds13(i)=0.
enddo
else
do i=lft,llt
str33(i) =0.0
enddo
endif
endif
c
c Check jacobian and delete distorted elements
c
if (ioshl(12).ge.1) then
call crnjac (lft,llt,xh1,yh1,zh1,xh2,yh2,zh2,
. xh3,yh3,zh3,xh4,yh4,zh4)
call pscrnr(lft,llt,nnm1,failjw)
if (rioshl(20).gt.0.0) then
call crnjac_diag(lft,llt,xh1,yh1,zh1,xh2,yh2,zh2,
. xh3,yh3,zh3,xh4,yh4,zh4,ix1,ix2,ix3,ix4,rots,
. rioshl(20))
endif
endif
c
c Set up lamina coordinate system at t_{n+1/2} (if requested)
c for strain calculations and at t_{n+1} for force and
c stiffness calculations
c
call usrshl_ls(lenvec8,lft,llt)
c
c Modify velocities for Nastran type offsets
c
if (ioshl(36).eq.1) call mod_vel (a(ioshl(37)+nnm1),lft,llt)
c
c Transform coordinates and increments to local system
c
if (iloc.eq.0) call usrshl_g2l(lenvec8,lft,llt)
c
c Gather length of fibers and transforms fiber directions
c
call usrshl_fbl(fibl(1,nnm1+1),iunf,lenvec8,lft,llt,iloc)
c
c Compute element properties for time step calculations
c
do i=lft,llt
x13=xh3(i)-xh1(i)
x24=xh4(i)-xh2(i)
y13=yh3(i)-yh1(i)
y24=yh4(i)-yh2(i)
z13=zh3(i)-zh1(i)
z24=zh4(i)-zh2(i)
fs1=x13-x24
ft1=x13+x24
fs2=y13-y24
ft2=y13+y24
fs3=z13-z24
ft3=z13+z24
e=fs1*fs1+fs2*fs2+fs3*fs3
f=fs1*ft1+fs2*ft2+fs3*ft3
g=ft1*ft1+ft2*ft2+ft3*ft3
diag1 =x13**2+y13**2+z13**2
diag2 =x24**2+y24**2+z24**2
diagm(i)= max(diag1,diag2)
sidmn(i)=0.0
sarea(i)=sqrt((e*g-f*f)/16.)
area(i)=1./(sarea(i)+1.e-16)
x21=xh2(i)-xh1(i)
y21=yh2(i)-yh1(i)
z21=zh2(i)-zh1(i)
side1 =x21*x21+y21*y21+z21*z21
x32=xh3(i)-xh2(i)
y32=yh3(i)-yh2(i)
z32=zh3(i)-zh2(i)
side2 =x32*x32+y32*y32+z32*z32
x43=xh4(i)-xh3(i)
y43=yh4(i)-yh3(i)
z43=zh4(i)-zh3(i)
side3 =x43*x43+y43*y43+z43*z43-1.e-10
x14=xh1(i)-xh4(i)
y14=yh1(i)-yh4(i)
z14=zh1(i)-zh4(i)
side4 =x14*x14+y14*y14+z14*z14
sida3 =side4*(.5-sign(.5,side3))+side3
sidmn(i)= min(side1,side2,sida3,side4)
sidem(i)= max(side1,side2,side3,side4)*(.625+sign(.375,side3))
enddo
if (isdo.eq.0.or.isdo.eq.2) then
do i=lft,llt
diagm(i)= min(diagm(i),sidem(i))
enddo
endif
c
if (nipt.gt.0) then
c
c Initialize parameters
c
mxsave =0
ipt_type(mte)=1
c
c Process user defined integration rule
c
if (irl.lt.0) then
do m=1,nipt
mtu=nint(rule(m,3,nrl))
if (mtu.ne.0) then
ipt_type(mtype(mtu))=1
endif
enddo
endif
c
endif
c
c Zero internal force vector
c
ndtot=4*(6+nxdof)
do j=1,ndtot
do i=lft,llt
frc(i,j)=0.
enddo
enddo
c
if (nipp.gt.0) then
c
c strain needed for user-defined failure like matusr_24
c
neps=6*nipp*nipt
eps2df=0.
if ((cm(5+48*(mxt(lft)-1)).lt.0..and.
. (mte.eq.24.or.mte.eq.114.or.mte.eq.123.or.mte.eq.124.or.
. mte.eq.155.or.mte.eq.182.or.mte.eq.238.or.mte.eq.255)).or.
. (cm(30+48*(mxt(lft)-1)).gt.0..and.(mte.eq.36.or.mte.eq.243))
. .or.(cm(9+48*(mxt(lft)-1)).lt.0..and.mte.eq.133))then
inteps=1
else
inteps=0
endif
c
c Loop over integration points in plane
c
do ipp=1,nipp
c
c Data for quadrature point
c
xiq=xipn(1,ipp,mxe)
etaq=xipn(2,ipp,mxe)
wgt=xipn(4,ipp,mxe)
c
c Loop over integration points through thickness
c
do m=1,nipt
c
mtv=mxt(lft)
mtf=mte
sds=sndspd(lft)
c
c Integration point number
c
ipt=nipp*(m-1)+ipp
c
c Get parental coordinate through the thickness
c
if (irl.eq.0) then
c Gauss
ztaq=zet(m,nipt)
zwgt=wgts(m,nipt)
elseif (irl.gt.0) then
c Trapezoidal
ztaq=(-1.0+(m-1)*2./(nipt-1))
zwgt=2./(nipt-1)
if (m.eq.1.or.m.eq.nipt) zwgt=zwgt/2.
else
c User defined
ztaq=rule(m,1,nrl)
zwgt=rule(m,2,nrl)
mtu=nint(rule(m,3,nrl))
if (mtu.ne.0) then
mxt(lft)=mtu
mte =mtype(mtu)
endif
endif
c
c Call routine for computing b-matrix and g-matrix
c
call usrshl_b(ietyp,xiq,etaq,ztaq,lenvec8,lft,llt,iloc)
c
c Set volume of quadrature point and compute "real" b-matrix
c
call usrshl_b2b(itaj,nxdof,zwgt*wgt,lenvec8,lft,llt)
do i=lft,llt
vol(i)=vol(i)*zwgt*wgt
enddo
c
c Compute strain and spin increments
c
call usrshl_str(nxdof,lft,llt,iloc)
c
c Zero energy increments
c
do i=lft,llt
einc(i)=0.
enddo
c
c If thermal expansion modify strain increment
c
if (ithxpid.gt.0)
. call adthstr(lft,llt,0)
c
c users need strain for user-defined failure like matusr_24
c
if (ioshl(557).ge.1) then
leps=loceps(nnm1+lft)+6*(m-1)+6*nipt*(ipp-1)
if (inteps.gt.0)
. call psseps4um(inteps,neps,epsint(leps),lft,llt,eps2df)
endif
c
c Constitutive model evaluation
c
call usrshl_con(nmtcon,auxvec,cm,lav,mte,nipp*nipt,ipt,
1 csprop(1,mxe),mxe,lft,llt,nnm1,
2 xiq,etaq,ztaq,m,ihgf,vol,nhsv,iunf,eosp)
c
c If thermal expansion, reset strain increment
c
if (ithxpid.gt.0)
. call sbthstr(lft,llt,0)
c
c Update internal energy, volume and plastic strain
c
if (isolvr(18).eq.0) then
do i=lft,llt
ies(nnm1+i)=ies(nnm1+i)+.5*vol(i)*einc(i)
enddo
if (ipi.ne.iph) then
if (mte.eq.224) then
iep=19
else
iep=7
endif
do i=lft,llt
a(ipi-1+nnm1+i)=a(ipi-1+nnm1+i)+vol(i)
a(iph-1+nnm1+i)=a(iph-1+nnm1+i)+vol(i)*ax(i,iep)
enddo
endif
endif
c
c Get strains for post-processing
c
if (istrn.ne.0) then
if (irl.eq.0) then
if (m.eq.isrn(1,nipt)) then
call usrshl_istr(strain(1,nnm1+1),wgt,lft,llt)
endif
if (m.eq.isrn(2,nipt)) then
call usrshl_istr(strain(7,nnm1+1),wgt,lft,llt)
endif
else
if (m.eq.1 ) then
call usrshl_istr(strain(1,nnm1+1),wgt,lft,llt)
endif
if (m.eq.nipt) then
call usrshl_istr(strain(7,nnm1+1),wgt,lft,llt)
endif
endif
endif
c
c store all integration point strains if requested
c
if (ioshl(557).ge.1) call psseps(neps,epsint(leps),lft,llt)
c
if (istupd.ne.0) then
c
c Shell thickness changes
c
call usrshl_igs(.125*wgt*zwgt,iunf,lft,llt)
c
endif
c
c Compute force components in local/global system
c
call usrshl_frc(nxdof,lft,llt)
c
if (is17loc.eq.1) then
c
c Assemble stiffness matrix
c
if (iloc.eq.0) call usrshl_trb(nxdof,lft,llt)
if (isolvr(23).eq.1)
. call usrshl_kgm(ske,nxdof,lft,llt)
if (isolvr(91).ne.2)
. call usrshl_kmt(ske,nxdof,lft,llt)
c
endif
c
ipt_type(mte)=m+1
mxt(lft)=mtv
mte =mtf
sndspd(lft)=max(sndspd(lft),sds)
c
enddo
c
enddo
c
else
c
c Resultant element
c
do i=lft,llt
sndspd(i)=cm(48*(mxe-1)+1)/(1.-cm(48*(mxe-1)+6)*2)
enddo
call usrshl_h(ietyp,cmusr(9,mxe),lmc,nhsv,nxdof,lft,llt,iloc,
. ihgf)
c
endif
c
c Compute sound speed for time step calculations
c
sndspd(lft)=sqrt(sndspd(lft)*rho)
c
if (ihgf.eq.1) then
c
c LS-DYNA hourglass force requested
c
c Compute shape function derivatives
c
call usrshl_sfd(lenvec8,lft,llt)
c
c Assemble hourglass forces
c
call usrshl_hgf(fibl(5,nnm1+1),ihgenf,hgener,
1 mte,nxdof,lenvec8,lft,llt,iloc)
c
elseif (ihgf.eq.2.or.ihgf.eq.3) then
c
c User defined hourglass force requested
c
call usrshl_h(ietyp,cmusr(9,mxe),lmc,nhsv,nxdof,lft,llt,iloc,
. ihgf)
c
endif
c
if (ioshl(12).ge.1) then
if (failur) then
do i=lft,llt
fail(i)=min(fail(i),failjw(i))
enddo
endif
endif
c
if (lenvec8.ne.0) then
c
c Recompute element properties for time step calculations
c
do i=lft,llt
x13=x3(i)-x1(i)
x24=x4(i)-x2(i)
y13=y3(i)-y1(i)
y24=y4(i)-y2(i)
z13=z3(i)-z1(i)
z24=z4(i)-z2(i)
fs1=x13-x24
ft1=x13+x24
fs2=y13-y24
ft2=y13+y24
fs3=z13-z24
ft3=z13+z24
e=fs1*fs1+fs2*fs2+fs3*fs3
f=fs1*ft1+fs2*ft2+fs3*ft3
g=ft1*ft1+ft2*ft2+ft3*ft3
diag1 =x13**2+y13**2+z13**2
diag2 =x24**2+y24**2+z24**2
diagm(i)= max(diag1,diag2)
sidmn(i)=0.0
sarea(i)=sqrt((e*g-f*f)/16.)
area(i)=1./(sarea(i)+1.e-16)
x21=x2(i)-x1(i)
y21=y2(i)-y1(i)
z21=z2(i)-z1(i)
side1 =x21*x21+y21*y21+z21*z21
x32=x3(i)-x2(i)
y32=y3(i)-y2(i)
z32=z3(i)-z2(i)
side2 =x32*x32+y32*y32+z32*z32
x43=x4(i)-x3(i)
y43=y4(i)-y3(i)
z43=z4(i)-z3(i)
side3 =x43*x43+y43*y43+z43*z43-1.e-10
x14=x1(i)-x4(i)
y14=y1(i)-y4(i)
z14=z1(i)-z4(i)
side4 =x14*x14+y14*y14+z14*z14
sida3 =side4*(.5-sign(.5,side3))+side3
sidmn(i)= min(side1,side2,sida3,side4)
sidem(i)= max(side1,side2,side3,side4)*(.625+sign(.375,side3))
enddo
if (isdo.eq.0.or.isdo.eq.2) then
do i=lft,llt
diagm(i)= min(diagm(i),sidem(i))
enddo
endif
c
endif
c
if (ihgf.eq.1) then
c
c LS-DYNA hourglass force requested
c
if (is17loc.eq.1.and.isolvr(91).ne.2) then
c
c Assemble hourglass stiffness
c
call usrshl_hgs(ske,lft,llt)
c
endif
c
endif
c
c Transform force to global system
c
if (iloc.eq.0) call usrshl_trf(nxdof,lft,llt)
c
if (istupd.ne.0) then
c
c Handle shell thickness updates
c
istpd=max(1,istupd)
call usrshl_stc(fibl(1,nnm1+1),rhssav(1,nnm1+1),a(istpd),
1 iunf,nipp,lft,llt,iloc)
endif
c
do i=lft,llt
gl11(i)=hl11(i)
gl21(i)=hl21(i)
gl31(i)=hl31(i)
gl12(i)=hl12(i)
gl22(i)=hl22(i)
gl32(i)=hl32(i)
gl13(i)=hl13(i)
gl23(i)=hl23(i)
gl33(i)=hl33(i)
enddo
c
if (nipp.ne.0) then
if (ioshl(36).eq.1) then
do i=lft,llt
fx1(i)=frc(i,1)
fy1(i)=frc(i,2)
fz1(i)=frc(i,3)
mx1(i)=frc(i,4)
my1(i)=frc(i,5)
mz1(i)=frc(i,6)
fx3(i)=frc(i,13+2*nxdof)
fy3(i)=frc(i,14+2*nxdof)
fz3(i)=frc(i,15+2*nxdof)
mx3(i)=frc(i,16+2*nxdof)
my3(i)=frc(i,17+2*nxdof)
mz3(i)=frc(i,18+2*nxdof)
fx2(i)=frc(i,7+nxdof)
fy2(i)=frc(i,8+nxdof)
fz2(i)=frc(i,9+nxdof)
mx2(i)=frc(i,10+nxdof)
my2(i)=frc(i,11+nxdof)
mz2(i)=frc(i,12+nxdof)
fx4(i)=frc(i,19+3*nxdof)
fy4(i)=frc(i,20+3*nxdof)
fz4(i)=frc(i,21+3*nxdof)
mx4(i)=frc(i,22+3*nxdof)
my4(i)=frc(i,23+3*nxdof)
mz4(i)=frc(i,24+3*nxdof)
enddo
call nasofrc(a(ioshl(37)+nnm1),lft,llt)
do i=lft,llt
frc(i,4)=mx1(i)
frc(i,5)=my1(i)
frc(i,6)=mz1(i)
frc(i,16+2*nxdof)=mx3(i)
frc(i,17+2*nxdof)=my3(i)
frc(i,18+2*nxdof)=mz3(i)
frc(i,10+nxdof)=mx2(i)
frc(i,11+nxdof)=my2(i)
frc(i,12+nxdof)=mz2(i)
frc(i,22+3*nxdof)=mx4(i)
frc(i,23+3*nxdof)=my4(i)
frc(i,24+3*nxdof)=mz4(i)
enddo
endif
endif
c
if (lenvec(1).ne.0) then
call usrshl_fs(nxdof,rhssav(1,nnm1+1),mte,lft,llt,
. rhsl(1,nnm1+1))
else
call usrshl_ft (nxdof,rhs,rhr,mte,lft,llt)
endif
c
if (iunf.ne.0) then
c
c Save nodal vectors for next step
c
if (isolvr(18).eq.0) then
do i=lft,llt
yhatn(1,i+nnm1)=yhatx1(i)
yhatn(2,i+nnm1)=yhaty1(i)
yhatn(3,i+nnm1)=yhatz1(i)
yhatn(4,i+nnm1)=yhatx2(i)
yhatn(5,i+nnm1)=yhaty2(i)
yhatn(6,i+nnm1)=yhatz2(i)
yhatn(7,i+nnm1)=yhatx3(i)
yhatn(8,i+nnm1)=yhaty3(i)
yhatn(9,i+nnm1)=yhatz3(i)
yhatn(10,i+nnm1)=yhatx4(i)
yhatn(11,i+nnm1)=yhaty4(i)
yhatn(12,i+nnm1)=yhatz4(i)
enddo
endif
c
endif
c
c Add drilling contribution
c
if (nipp.ne.0) then
if ((isolvr(1).eq.1.and.ascntl(40).gt.0.0.and.isolvr(76).eq.4)
& .or.isdrill.eq.1) then
if (iunf.ne.0) then
do i=lft,llt
thick(i)=.25*(thick(i)+fga(i)+fgb(i)+fgc(i))
enddo
endif
call drlfrc(rhs,rhr,rhssav(1,nnm1+1),lenvec(1),
. thick,sarea,ymod(lft),
. ske,drlstr(1,nnm1+1),lft,llt,
. x,vt,vr,dt1siz,
. 4)
endif
endif
c
if (is17loc.eq.1) then
c
c Take care of drilling DOFs
c
if (isolvr(91).ne.2) then
c
if (ascntl(40).gt.0.0) then
if (isolvr(76).ne.4) then
do i=lft,llt
dy2(i)=cvltot(i)/sarea(i)
enddo
call psszk(is17loc,lft,llt,ske,
& x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,
& hl11,hl12,hl13,hl21,hl22,hl23,hl31,hl32,hl33)
c$$$ call zlen(lft,llt,scr,hl13,hl23,hl33,
c$$$ & x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4)
c$$$ call ttkt(lft,llt,ske,scr)
endif
else
call bfixrt(ske,lft,llt)
endif
endif
c
c Assemble tangent stiffness
c
ndofpn=6
if (nipp.ne.0) then
if (ioshl(36).eq.1) call nasostf(a(ioshl(37)+nnm1),lft,llt)
if (ascntl(40).gt.0.0.and.isolvr(76).eq.4) then
if (iunf.ne.0) then
do i=lft,llt
thick(i)=.25*(thick(i)+fga(i)+fgb(i)+fgc(i))
enddo
endif
call drlstf(rhs,rhr,rhssav(1,nnm1+1),lenvec(1),
. thick,sarea,ymod(lft),
. ske,drlstr(1,nnm1+1),is17loc,lft,llt,
. x,vt,vr,dt1siz,
. 4)
endif
endif