35 . X,SENSORS,BUFMAT,PM,GEO,
36 . IDDLEVEL,KNOD2ELC,NOD2ELC,IXC,IGEO,
45 use element_mod ,
only : nixc,nixr
49#include "implicit_f.inc"
57#include "tabsiz_c.inc"
61 INTEGER IDDLEVEL,IXR(NIXR,*),ITAB(*),KNOD2EL1D(*),NOD2EL1D(*),IPM(NPROPMI,*),
62 . KNOD2ELC(*),NOD2ELC(*),IXC(NIXC,*)
63 INTEGER,
INTENT(INOUT) :: IGEO(NPROPGI,NUMGEO),ISKN(SISKWN)
64 my_real x(3,*),bufmat(*),pm(npropm,*),geo(npropg,*)
65 TYPE (SENSORS_) ,
INTENT(IN) :: SENSORS
66 INTEGER ,
INTENT(IN) :: NPC(SNPC)
71 INTEGER I,J,K,L,JJ,NOD_START,SEATBELT_ID
75 . func1,func2,isk,n1,n2,seatbelt_elem_found,imov,iecrou,nb_elem_1d,nb_branch,
76 . branch_cpt,nb_elem_2d,j1,npt,npt2,stat,warnfunc,same_func,mid2,mtyp2
77 my_real dist2,lmin,rho,xk,xc,
area,longi_direction(3),edge_direction(3),scal,e11,e22,g12,det,
78 . n12,n21,nu,fscale1,fscale2,a11,a22,a12,c1,ssp,rho0,fscalet,kmax,a1c,a2c
79 my_real x1,x2,y1,y2,shift,deri,min_slope,min_slope_abs,deri_p
81 INTEGER ,
DIMENSION(:),
ALLOCATABLE:: TAG_RES,TAG_SHELL,TAG_NOD,,CPT_MAT,TAG_MAT_2D,
82 . tag_nod_shell,tag_nod_spring,fram_tab,tag_fram_seatbelt,
83 . nnod_fram_seatbelt,belt_end_nfram,belt_end_addr,tag_prop_2d,
84 . branch_tab,tag_spring_2d,tag_nod_spri2d,tag_comn_1d_2d
85 my_real ,
DIMENSION(:),
ALLOCATABLE:: av_len_mat,av_area_mat,elemsize_mat,belt_end_section,
95 IF (iddlevel == 0)
THEN
100 DO k=1,sensors%NSENSOR
101 IF(
slipring(i)%SENSID == sensors%SENSOR_TAB(k)%SENS_ID) isens_loc(1) = k
103 IF(isens_loc(1) == 0)
THEN
106 . anmode=aninfo_blind_1,
120 DO k=1,sensors%NSENSOR
121 IF(
retractor(i)%ISENS(j) == sensors%SENSOR_TAB(k)%SENS_ID) isens_loc(j) = k
123 IF(isens_loc(j) == 0)
THEN
126 . anmode=aninfo_blind_1,
141 ELSEIF (npt == npt2)
THEN
146 y1 = tf(npc(
retractor(i)%IFUNC(1)) + j1 + 1)
148 y2 = tf(npc(
retractor(i)%IFUNC(2)) + j1 + 1)
149 IF ((x1 /= x2).OR.(y1 /= y2)) same_func = 0
160 ALLOCATE (
retractor(i)%TABLE(j)%X(1),stat=stat)
161 ALLOCATE (
retractor(i)%TABLE(j)%X(1)%VALUES(npt),stat=stat)
162 ALLOCATE (
retractor(i)%TABLE(j)%Y,stat=stat)
163 ALLOCATE (
retractor(i)%TABLE(j)%Y%VALUES(npt),stat=stat)
171 y1 = tf(npc(
retractor(i)%IFUNC(j)) + j1 + 1)
173 y2 = tf(npc(
retractor(i)%IFUNC(j)) + j1 + 3)
174 deri = (y2-y1)/(x2-x1)
175 IF (abs(deri) > em20)
THEN
176 min_slope =
min(min_slope,deri)
177 min_slope_abs =
min(min_slope_abs,abs(deri))
183 IF(warnfunc == 1)
THEN
185 . msgtype=msgwarning,
186 . anmode=aninfo_blind_1,
188 . i2=npc(nfunct+
retractor(i)%IFUNC(j)+1),
189 . r1=em05*min_slope_abs)
193 IF ((same_func == 0).and.((j==2).and.(min_slope<zero)))
THEN
195 . msgtype=msgwarning,
196 . anmode=aninfo_blind_1,
198 . i2=npc(nfunct+
retractor(i)%IFUNC(j)+1))
202 . .or.(
retractor(i)%TENS_TYP==3)).and.(min_slope<zero))
THEN
205 . anmode=aninfo_blind_1,
207 . i2=npc(nfunct+
retractor(i)%IFUNC(j)+1))
217 y1 = tf(npc(
retractor(i)%IFUNC(j)) + j1 + 1) + shift
219 y2 = tf(npc(
retractor(i)%IFUNC(j)) + j1 + 3)
220 deri = (y2-y1)/(x2-x1)
221 IF (abs(deri) < em05*min_slope_abs)
THEN
222 shift = shift+em05*sign(min_slope_abs*(x2-x1),deri_p)
228 retractor(i)%TABLE(j)%X(1)%VALUES(k) = x2
229 retractor(i)%TABLE(j)%Y%VALUES(k) = y2 + shift
245 CALL my_alloc(tag_nod_shell,numnod)
246 CALL my_alloc(tag_prop_2d,numgeo)
247 tag_nod_shell(1:numnod) = 0
248 tag_prop_2d(1:numgeo) = 0
254 IF (mtyp == 119)
THEN
255 nb_elem_2d = nb_elem_2d + 1
257 tag_nod_shell(ixc(j,i)) = tag_nod_shell(ixc(j,i)) + 1
260 IF (tag_prop_2d(ipid)==0) tag_prop_2d(ipid) = 1
261 IF (tag_prop_2d(ipid)==-1) tag_prop_2d(ipid) = -2
262 ELSEIF (igeo(11,ipid)==9)
THEN
264 IF (tag_prop_2d(ipid)==0) tag_prop_2d(ipid) = -1
265 IF (tag_prop_2d(ipid)==1) tag_prop_2d(ipid) = -2
271 CALL my_alloc(tag_nod_spring,numnod)
272 CALL my_alloc(tag_nod_spri2d,numnod)
273 CALL my_alloc(tag_spring_2d,numelr)
274 tag_nod_spring(1:numnod) = 0
275 tag_nod_spri2d(1:numnod) = 0
276 tag_spring_2d(1:numelr) = 0
281 IF (mtyp == 114)
THEN
282 nb_elem_1d = nb_elem_1d + 1
284 tag_nod_spring(ixr(j,i)) = tag_nod_spring(ixr(j,i)) + 1
289 DO k=knod2elc(n1)+1,knod2elc(n1+1)
290 elem_cur = nod2elc(k)
291 mid2 = ixc(1,elem_cur)
295 IF (ixc(j,elem_cur)==n2) tag_spring_2d(i) = 1
300 tag_nod_spri2d(ixr(j,i)) = tag_nod_spri2d(ixr(j,i)) + tag_spring_2d(i)
309 IF ((nb_elem_1d > 0).or.(nb_elem_2d > 0))
THEN
317 IF (igeo(14,i) /= 24)
THEN
318 IF (tag_prop_2d(i) == 1)
THEN
321 . msgtype=msgwarning,
322 . anmode=aninfo_blind_1,
327 imov = iskn(liskn*(isk-1)+5)
331 . anmode=aninfo_blind_1,
335 ELSEIF (tag_prop_2d(i) == -2)
THEN
338 . anmode=aninfo_blind_1,
343 IF (tag_prop_2d(i)==1)
THEN
346 imov = iskn(liskn*(isk-1)+5)
348 n1 = iskn(liskn*(isk-1)+1)
349 n2 = iskn(liskn*(isk-1)+2)
350 seatbelt_elem_found = 0
351 DO k=knod2elc(n1)+1,knod2elc(n1+1)
352 elem_cur = nod2elc(k)
353 mid = ixc(1,elem_cur)
357 IF (ixc(j,elem_cur)==n2) seatbelt_elem_found = 1
361 IF (seatbelt_elem_found == 0)
THEN
364 . anmode=aninfo_blind_1,
365 . i1=igeo(1,i),i2=iskn(liskn*(isk-1)+4))
372 DEALLOCATE(tag_prop_2d)
385 CALL my_alloc(tag_comn_1d_2d,numnod)
387 tag_comn_1d_2d(1:numnod) = 0
390 IF ((tag_nod_spring(i) > tag_nod_spri2d(i)).and.(tag_nod_spri2d(i) > 0))
THEN
393 tag_comn_1d_2d(i) = 1
396 DEALLOCATE(tag_nod_spri2d)
398 CALL my_alloc(tag_nod,numnod)
399 tag_nod(1:numnod) = 0
403 IF (((tag_nod_shell(i) < 2).AND.(tag_nod_spring(i)==1).AND.(tag_nod(i)==0)).OR.
404 . (tag_comn_1d_2d(i) == 1))
THEN
405 compt_belt_end = compt_belt_end + 1
406 compt_fram = compt_fram + 1
408 IF (tag_nod_shell(i) == 1)
THEN
410 DO WHILE(next_node > 0)
413 DO k=knod2elc(node_cur)+1,knod2elc(node_cur+1)
414 elem_cur = nod2elc(k)
415 mid = ixc(1,elem_cur)
419 IF (((tag_nod_spring(ixc(j,elem_cur))==1).OR.(tag_comn_1d_2d(ixc
420 . .AND.(tag_nod(ixc(j,elem_cur))==0))
THEN
422 next_node = ixc(j,elem_cur)
423 tag_nod(next_node) = 1
424 compt_fram = compt_fram + 1
431 IF (tag_comn_1d_2d(i) == 1) tag_nod(i) = 0
435 tag_nod(1:numnod) = 0
436 CALL my_alloc(belt_end_nfram,compt_belt_end)
437 CALL my_alloc(belt_end_addr,compt_belt_end)
438 CALL my_alloc(fram_tab,compt_fram)
439 CALL my_alloc(belt_end_section,compt_belt_end)
440 belt_end_nfram(1:compt_belt_end) = 0
441 belt_end_addr(1:compt_belt_end) = 0
442 belt_end_section(1:compt_belt_end) = zero
443 fram_tab(1:compt_fram) = 0
446 node_longi = -huge(node_longi)
448 IF (((tag_nod_shell(i) < 2).AND.(tag_nod_spring
449 . (tag_comn_1d_2d(i) == 1))
THEN
450 compt_belt_end = compt_belt_end + 1
453 belt_end_nfram(compt_belt_end) = 1
454 belt_end_addr(compt_belt_end) = compt_fram
455 fram_tab(compt_fram) = i
456 IF (tag_nod_shell(i) == 1)
THEN
459 DO k=knod2el1d(i)+1,knod2el1d(i+1)
460 IF (nod2el1d(k) > numelt+numelp)
THEN
461 elem_cur = nod2el1d(k)-numelt-numelp
462 mid = ixr(5,elem_cur)
465 IF ((mtyp == 114).AND.(ixr(2,elem_cur)/= i))
THEN
466 node_longi = ixr(2,elem_cur)
467 ELSEIF (mtyp == 114)
THEN
468 node_longi = ixr(3,elem_cur)
473 dist2 = (x(1,i)-x(1,node_longi))**2+(x(2,i)-x(2,node_longi))**2+(x(3,i)-x(3,node_longi))**2
474 longi_direction(1) = (x(1,i)-x(1,node_longi))/sqrt(
max(em20,dist2))
475 longi_direction(2) = (x(2,i)-x(2,node_longi))/sqrt(
max(em20,dist2))
476 longi_direction(3) = (x(3,i)-x(3,node_longi))/sqrt(
max(em20,dist2))
479 DO WHILE(next_node > 0)
482 DO k=knod2elc(node_cur)+1,knod2elc(node_cur+1)
483 elem_cur = nod2elc(k)
484 mid = ixc(1,elem_cur)
488 IF (((tag_nod_spring(ixc(j,elem_cur))==1).OR.(tag_comn_1d_2d(ixc(j,elem_cur))==1))
489 . .AND.(tag_nod(ixc(j,elem_cur))==0))
THEN
491 next_node = ixc(j,elem_cur)
492 tag_nod(next_node) = 1
493 compt_fram = compt_fram + 1
494 fram_tab(compt_fram) = next_node
499 IF (next_node > 0)
THEN
501 dist2 = (x(1,node_cur)-x(1,next_node))**2+(x(2,node_cur)-x(2,next_node))**2
502 . +(x(3,node_cur)-x(3,next_node))**2
503 edge_direction(1) = (x(1,node_cur)-x(1,next_node))/sqrt(
max(em20,dist2))
504 edge_direction(2) = (x(2,node_cur)-x(2,next_node))/sqrt(
max(em20,dist2))
505 edge_direction(3) = (x(3,node_cur)-x(3,next_node))/sqrt(
max(em20,dist2))
506 scal = longi_direction(1)*edge_direction(1)+longi_direction(2)*edge_direction(2)
507 . +longi_direction(3)*edge_direction(3)
508 dist2 = dist2*(one-scal*scal)
509 ipid = ixc(6,elem_cur)
510 belt_end_section(compt_belt_end) = belt_end_section(compt_belt_end) + sqrt(
max(em20,dist2))*geo(1,ipid)
513 belt_end_nfram(compt_belt_end) = compt_fram - belt_end_addr(compt_belt_end) + 1
515 IF (tag_comn_1d_2d(i) == 1) tag_nod(i) = 0
526 DEALLOCATE(tag_nod_spring,tag_nod_shell,tag_comn_1d_2d)
528 CALL my_alloc(tag_res,numelr)
529 CALL my_alloc(tag_fram_seatbelt,compt_belt_end)
530 CALL my_alloc(nnod_fram_seatbelt,compt_belt_end)
531 tag_nod(1:numnod) = 0
532 tag_res(1:numelr) = 0
536 tag_fram_seatbelt(1:compt_belt_end) = 0
537 nnod_fram_seatbelt(1:compt_belt_end) = 0
543 IF (compt_belt_end == 0)
THEN
546 . anmode=aninfo_blind_1)
549 CALL my_alloc(branch_tab,2*nb_elem_1d)
551 DO i=1,compt_belt_end
555 IF (tag_nod(fram_tab(belt_end_addr(i)))==0)
THEN
556 seatbelt_id = seatbelt_id + 1
559 IF (belt_end_nfram(i) > 1) nb_2d_seatbelt = nb_2d_seatbelt + 1
561 DO j=1,belt_end_nfram(i)
564 nod_start = fram_tab(belt_end_addr(i)+j-1)
567 DO k=knod2el1d(nod_start)+1,knod2el1d(nod_start+1)
568 IF (nod2el1d(k) > numelt+numelp)
THEN
569 elem_cur = nod2el1d(k)-numelt-numelp
570 mid = ixr(5,elem_cur)
573 IF (mtyp == 114)
THEN
575 IF (((belt_end_nfram(i)==1).and.(tag_spring_2d(elem_cur)==0)).OR.
576 . ((belt_end_nfram(i) >1).and.(tag_spring_2d(elem_cur)==1)))
THEN
580 CALL new_seatbelt(ixr,itab,knod2el1d,nod2el1d,nod_start,
581 . elem_cur,tag_res,tag_nod,seatbelt_id,flag,
582 . nnod,ipm,nb_elem_1d,nb_branch,branch_tab,
586 DO WHILE(nb_branch > 0)
587 nod_start = branch_tab(2*(branch_cpt-nb_branch)+1)
588 elem_cur = branch_tab(2*(branch_cpt-nb_branch)+2)
589 nb_branch = nb_branch -1
590 CALL new_seatbelt(ixr,itab,knod2el1d,nod2el1d,nod_start,
591 . elem_cur,tag_res,tag_nod,seatbelt_id,flag,
592 . nnod,ipm,nb_elem_1d,nb_branch,branch_tab,
604 tag_fram_seatbelt(i) = seatbelt_id
605 nnod_fram_seatbelt(i) = nnod
607 ELSEIF(belt_end_nfram(i) > 1)
THEN
610 DO j=1,belt_end_nfram(i)
611 IF (tag_nod(fram_tab(belt_end_addr(i))) /= 0) compt = compt + 1
613 IF (compt /= belt_end_nfram(i))
THEN
616 . anmode=aninfo_blind_1,
624 DEALLOCATE(branch_tab,tag_spring_2d)
630 n_seatbelt = seatbelt_id
632 CALL my_alloc(tag_mat_2d,nummat)
633 tag_mat_2d(1:nummat) = 0
634 IF (nb_2d_seatbelt > 0)
THEN
635 CALL my_alloc(tag_shell,numelc)
636 CALL my_alloc(section_mat,nummat)
637 tag_shell(1:numelc) = 0
638 section_mat(1:nummat) = zero
647 DO j=1,compt_belt_end
648 IF (tag_fram_seatbelt(j)==i)
THEN
655 IF (tag_res(j) == i)
THEN
659 IF (tag_mat_2d(mid)==0) tag_mat_2d(mid) = -mid
663 DO l=knod2elc(node)+1,knod2elc(node+1)
664 elem_cur = nod2elc(l)
665 mid_2d = ixc(1,elem_cur)
669 IF (ixc(jj,elem_cur)==n2) flag_shell = 1
672 IF ((mtyp==119).AND.(flag_shell==1))
THEN
673 IF (tag_shell(elem_cur)==0)
THEN
674 tag_shell(elem_cur) = i
675 compt_2d = compt_2d + 1
676 tag_mat_2d(mid) = mid_2d
677 IF (section_mat(mid_2d) == zero)
THEN
679 ELSEIF (abs(
seatbelt_tab(i)%SECTION-section_mat(mid_2d)) > em05)
THEN
682 . anmode=aninfo_blind_1,
692 IF (iddlevel == 0)
CALL my_alloc(
seatbelt_tab(i)%SPRING,compt)
695 IF (tag_res(j) == i)
THEN
702 DEALLOCATE(belt_end_nfram,belt_end_section,belt_end_addr,fram_tab,tag_res,tag_fram_seatbelt,nnod_fram_seatbelt)
709 seatbelt_id = tag_nod(
retractor(i)%NODE(1))
719 CALL my_alloc(cpt_mat,nummat)
720 CALL my_alloc(av_len_mat,nummat)
721 CALL my_alloc(av_area_mat,nummat)
722 CALL my_alloc(elemsize_mat,nummat)
724 cpt_mat(1:nummat) = 0
725 av_len_mat(1:nummat) = zero
726 av_area_mat(1:nummat) = zero
727 elemsize_mat(1:nummat) = zero
732 ipid = ixr(1,elem_cur)
737 dist2 = (x(1,i1)-x(1,i2))**2+(x(2,i1)-x(2,i2))**2+(x(3,i1)-x(3,i2))**2
738 IF (dist2 > zero)
THEN
739 av_len_mat(mid) = av_len_mat(mid) + sqrt(dist2)
740 av_area_mat(mid) = av_area_mat(mid) + geo(1,ipid)
741 cpt_mat(mid) = cpt_mat(mid) + 1
749 IF (cpt_mat(mid) > 0)
THEN
750 lmin = bufmat(iadbuf+119-1)
751 IF (lmin == zero)
THEN
753 bufmat(iadbuf+119-1) = em02 * (av_len_mat(mid) / cpt_mat(mid))
754 IF (tag_print == 0)
WRITE(iout,1000)
756 WRITE(iout,
'(5X,I10,8X,G16.9)') ipm(1,abs(tag_mat_2d(mid))),bufmat(iadbuf+119-1)
759 bufmat(iadbuf+126-1) = elemsize_mat(mid)
766 IF (cpt_mat(mid) > 0)
THEN
767 xc = bufmat(iadbuf+70)
768 xk = bufmat(iadbuf+64)
769 iecrou = int(bufmat(iadbuf+76))
773 area = av_area_mat(mid) / cpt_mat(mid)
774 xc = zep3 * sqrt(rho*
area*xk) * (av_len_mat(mid) / cpt_mat(mid))
775 bufmat(iadbuf+70) = xc
776 IF (tag_print == 0)
WRITE(iout,1100)
778 WRITE(iout,
'(5X,I10,8X,G16.9)') ipm(1,abs(tag_mat_2d(mid))),bufmat(iadbuf+70)
780 bufmat(iadbuf+71) = 0.1*xc
781 bufmat(iadbuf+72) = 0.1*xc
783 IF ((tag_mat_2d(mid) > 0).AND.(iddlevel==0))
THEN
784 bufmat(iadbuf+127-1) = one
785 bufmat(iadbuf+128-1) = 0.9*pm(1,mid)
787 bufmat(iadbuf+71) = 0.3*xc
788 bufmat(iadbuf+72) = 0.3*xc
792 bufmat(iadbuf+76) = iecrou + em01
798 DEALLOCATE(cpt_mat,av_len_mat,av_area_mat,elemsize_mat,tag_mat_2d)
804 IF ((nb_2d_seatbelt > 0).AND.(iddlevel==0))
THEN
809 IF (mtyp == 119)
THEN
813 rho0=pm(1,mid)/section_mat(mid)
815 e11 = bufmat(iadbuf)/section_mat(mid)
816 e22 = bufmat(iadbuf+1)
817 fscalet = bufmat(iadbuf+12)
818 IF (e22 == em20) e22 = fscalet*e11
819 n12 = bufmat(iadbuf+2)
825 kmax =
max(one,fscalet)*bufmat(iadbuf+21)/section_mat(mid)
828 g12 = bufmat(iadbuf+5)
829 IF (g12 == em20) g12 = e11/(two*(one + n12))
830 det = one / (one - n12*n21)
836 a1c = bufmat(iadbuf+13)
837 a2c = bufmat(iadbuf+14)
838 c1 =
max(a11,a22,a1c)
845 . c1=
'SEATBELT MATERIAL')
847 fscale1 = bufmat(iadbuf+10)/section_mat(mid)
848 fscale2 = bufmat(iadbuf+11)/section_mat(mid)
851 bufmat(iadbuf+1) = e22
852 bufmat(iadbuf+3) = n21
853 bufmat(iadbuf+4) = nu
854 bufmat(iadbuf+5) = g12
855 bufmat(iadbuf+6) = a11
856 bufmat(iadbuf+7) = a22
857 bufmat(iadbuf+8) = a12
858 bufmat(iadbuf+10) = fscale1
859 bufmat(iadbuf+11) = fscale2
860 bufmat(iadbuf+16) = ssp
864 pm(20,mid) = kmax/(one - nu**2)
866 pm(22,mid) = half*kmax/(one + nu)
867 pm(24,mid) = kmax/(one - nu**2)
879 IF (tag_print == 0)
WRITE(iout,1200)
881 WRITE(iout,
'(5X,I10,8X,G16.9,G16.9,G16.9,G16.9)') ipm(1,mid),section_mat(mid),
887 IF (nb_2d_seatbelt > 0)
DEALLOCATE(section_mat)
895 offc = numels + numelq
896 offr = numels + numelq + numelc + numelp + numelt
914 CALL my_alloc(cc_elem,nb_elem)
915 cc_elem(1:nb_elem) = 0
922 IF (tag_shell(j) == i)
THEN
924 cc_elem(compt) = offc + j
939 IF (nb_2d_seatbelt > 0)
DEALLOCATE(tag_shell)
942 IF ((nb_elem_1d==0).and.(nb_elem_2d == 0))
THEN
943 DEALLOCATE(tag_nod_shell,tag_nod_spring,tag_nod_spri2d)
944 DEALLOCATE(tag_prop_2d,tag_spring_2d)
950 .
' SEATBELTS DEFAULT LMIN COMPUTATION '/
951 .
' ---------------------------------- '/
952 .
' MAT ID DEFAULT LMIN '/)
955 .
' SEATBELTS DEFAULT DAMPING COMPUTATION '/
956 .
' ---------------------------------- '/
957 .
' MAT ID DEFAULT DAMPING '/)
960 .
' 2D SEATBELTS SECTION COMPUTATION '/
961 .
' ---------------------------------- '/
962 .
' MAT ID SEATBELT SECTION E11 E22 G12'/)