Télécharger impo32.eso

Retour à la liste

Numérotation des lignes :

impo32
  1. C IMPO32 SOURCE CB215821 25/04/08 21:15:21 12227
  2.  
  3. * impo bloc en 3D
  4.  
  5. SUBROUTINE IMPO32(ipt1,ipt6,ipt8,itcont,mchel1,mrigid,mchpoi)
  6.  
  7. IMPLICIT INTEGER(I-N)
  8. IMPLICIT REAL*8 (A-H,O-Z)
  9.  
  10. -INC PPARAM
  11. -INC CCOPTIO
  12. -INC CCREEL
  13. -INC CCGEOME
  14.  
  15. -INC SMCOORD
  16. -INC SMELEME
  17. -INC SMRIGID
  18. -INC SMCHPOI
  19. -INC SMCHAML
  20.  
  21. * Contact en formulation forte :
  22. * Segments utiles dans les cas dits pathologiques
  23. segment mfopa1
  24. integer lpoin(nfopa1,3)
  25. real*8 xpoin(nfopa1,3)
  26. real*8 zje1(nfopa1)
  27. endsegment
  28. segment mfopa2
  29. integer lsegm(nfopa2,4)
  30. real*8 xsegm(nfopa2,3)
  31. real*8 zje2(nfopa2)
  32. endsegment
  33. * directions moyennes aux sommets
  34. segment mfopa3
  35. real*8 xms(nbpts),yms(nbpts),zms(nbpts)
  36. integer ims(nbpts)
  37. endsegment
  38. * positions compressees
  39. segment mfopa4
  40. real*8 tco(nbel1),xw(nbel1)
  41. integer ipnum(nbel1),ico(nbel1),iw(nbel1)
  42. endsegment
  43. segment mfopa5
  44. integer ind(indt)
  45. endsegment
  46.  
  47. * Contact en formulation faible :
  48. * Segment utile pour le calcul de l'intersection des 2 triangles
  49. * projetes dans le plan de contact intermediaire
  50. segment mfaible
  51. real*8 cPT1C(3,3),cPT2C(3,3), cPT1A(4,2),cPT2A(4,2)
  52. real*8 cPIn0(6,2), cPIn(6,2), test(6)
  53. real*8 vT1A(3,2), vT2A(3,2)
  54. real*8 SuT1A, SuT2A, SuPIn
  55. *DBG-F real*8 xGIn,yGIn, b1T1,b2T1,b3T1, b1T2,b2T2,b3T2
  56. endsegment
  57.  
  58. PARAMETER ( X1s3=0.333333333333333333333333333333333333333333D0 )
  59. PARAMETER ( sqr3=1.7320508075688772935D0)
  60.  
  61. character*4 modepl(3),moforc(3)
  62.  
  63. data modepl /'UX ','UY ','UZ '/
  64. data moforc /'FX ','FY ','FZ '/
  65. *
  66. idimp1 = IDIM + 1
  67. *
  68. * Lecture du maillage support des conditions de contact
  69. * il s(agit la du premier maillage de contact, de type tri3
  70. *
  71. ** write(6,*) ' ipt1 dans impo32 ',ipt1
  72. ** write(6,*) ' ipt6 dans impo32 ',ipt6
  73. ** write(6,*) ' ipt8 dans impo32 ',ipt8
  74. *
  75. * Activation du maillage et petites verifications
  76. *
  77. segact ipt8
  78. segact ipt6
  79. segact ipt1
  80. ** write(6,*) ' ipt1 2 dans impo32 ',ipt1
  81. nbno6 = ipt6.num(/1)
  82. nbel6 = ipt6.num(/2)
  83. nbno8 = ipt8.num(/1)
  84. nbel8 = ipt8.num(/2)
  85. nbel1 = ipt1.num(/2)
  86. ** write(6,*) 'nbel6 ',nbel6
  87. ** write(6,*) 'nbel1 ',nbel1
  88. if (ipt1.lisous(/1).ne.0) call erreur(25)
  89. if (ipt6.itypel.ne.4) call erreur(16)
  90. if (nbno6.ne.3 ) call erreur(16)
  91. if (ierr.ne.0) goto 900
  92. *
  93. * Increment sur le nombre d'elements de contact retenus et utilises
  94. * dans le chpoint (mpoval et igeoc) et rigidite pour agrandir les
  95. * longueurs des segments adequats
  96. incnel = 2000
  97. *
  98. * Creation de la raideur des conditions de contact
  99. * Remplissage de l'entete commun
  100. *
  101. nrigel = 1
  102. segini,mrigid
  103. ichole = 0
  104. imgeo1 = 0
  105. imgeo2 = 0
  106. isupeq = 0
  107. iforig = ifour
  108. coerig(1) = 1.
  109. mtymat='RIGIDITE'
  110. *
  111. * MCHAML materiau associe au MMODEL
  112. MELVA1 = 0
  113. MELVA2 = 0
  114. IF (MCHEL1.NE.0) THEN
  115. SEGACT, MCHEL1
  116. * recherche rapide d'un maillage correspondant dans le mchaml
  117. DO 210 n2 = 1,mchel1.imache(/1)
  118. * write(ioimp,*) ' n2 imache(n2) ipt1 ',n2,mchel1.imache(n2),ipt1
  119. if (mchel1.imache(n2).eq.ipt1) goto 220
  120. 210 continue
  121.  
  122. goto 230
  123. 220 continue
  124. MCHAM1 = MCHEL1.ICHAML(n2)
  125. SEGACT, MCHAM1
  126. NBCO = MCHAM1.NOMCHE(/2)
  127. DO JCMP = 1,NBCO
  128. IF (MCHAM1.NOMCHE(JCMP).EQ.'JEU') THEN
  129. MELVA1 = MCHAM1.IELVAL(JCMP)
  130. SEGACT, MELVA1
  131. NELJ = MELVA1.VELCHE(/2)
  132. NPTELJ = min(MELVA1.VELCHE(/1),4)
  133. C
  134. C Utilise pour le zonage
  135. xjmax = -xgrand
  136. xjmin = xgrand
  137. DO IJI2=1,NELJ
  138. DO IJI1=1,MELVA1.VELCHE(/1)
  139. xjmax=max(xjmax,MELVA1.VELCHE(IJI1,IJI2))
  140. xjmin=min(xjmin,MELVA1.VELCHE(IJI1,IJI2))
  141. ENDDO
  142. ENDDO
  143. C
  144. ENDIF
  145. IF (MCHAM1.NOMCHE(JCMP).EQ.'ADHE') THEN
  146. MELVA2 = MCHAM1.IELVAL(JCMP)
  147. SEGACT, MELVA2
  148. NELA = MELVA2.VELCHE(/2)
  149. NPTELA = min(MELVA2.VELCHE(/1),4)
  150. ENDIF
  151. ENDDO
  152. ENDIF
  153. 230 continue
  154. *
  155. * Creation du chpoint de depi
  156. *
  157. nat=1
  158. nsoupo=1
  159. segini mchpoi
  160. mtypoi='DEPIMP'
  161. mochde='engendré par impose'
  162. ifopoi=ifour
  163. jattri(1)=2
  164. *
  165. nc=2
  166. IF (MELVA2.NE.0) nc=3
  167. segini msoupo
  168. ipchp(1)=msoupo
  169. nocomp(1)='FLX '
  170. nocomp(2)='SCAL'
  171. IF (MELVA2.NE.0) THEN
  172. nocomp(3)='FADH'
  173. ENDIF
  174. *
  175. nbnn =1
  176. nbelem=incnel
  177. nbref =0
  178. nbsous=0
  179. segini ipt7
  180. ipt7.itypel=1
  181. igeoc=ipt7
  182. *
  183. n=incnel
  184. segini mpoval
  185. ipoval=mpoval
  186. *
  187. * Nombre de noeuds dans le chpoint (en totalite) : ipt7 et mpoval
  188. nelch = 0
  189.  
  190. *=======================================================================
  191. * Formulation "forte" (standard) du contact :
  192. *=======================================================================
  193. * Element de contact 3D a 3 noeuds
  194. ** write(6,*) ' itcont dans impo32 ',itcont
  195. * itcont 2: formulation faible
  196. if (itcont.eq.2) goto 500
  197.  
  198. * Calcul des directions moyennes de la boite d'encadrement, et de la taille max
  199. segact mcoord
  200. segini mfopa3
  201.  
  202. xmin=xgrand
  203. xmax=-xgrand
  204. ymin=xgrand
  205. ymax=-xgrand
  206. zmin=xgrand
  207. zmax=-xgrand
  208. tamax=0.d0
  209.  
  210. do 820 iel6=1,nbel6
  211. *
  212. ip1=ipt6.num(1,iel6)
  213. ip2=ipt6.num(2,iel6)
  214. ip3=ipt6.num(3,iel6)
  215. ipv1 = (ip1-1)*idimp1
  216. xp1 = xcoor(ipv1+1)
  217. yp1 = xcoor(ipv1+2)
  218. zp1 = xcoor(ipv1+3)
  219. ipv2 = (ip2-1)*idimp1
  220. xp2 = xcoor(ipv2+1)
  221. yp2 = xcoor(ipv2+2)
  222. zp2 = xcoor(ipv2+3)
  223. ipv3 = (ip3-1)*idimp1
  224. xp3 = xcoor(ipv3+1)
  225. yp3 = xcoor(ipv3+2)
  226. zp3 = xcoor(ipv3+3)
  227.  
  228. xmin=min(xmin,xp1,xp2,xp3)
  229. xmax=max(xmax,xp1,xp2,xp3)
  230. ymin=min(ymin,yp1,yp2,yp3)
  231. ymax=max(ymax,yp1,yp2,yp3)
  232. zmin=min(zmin,zp1,zp2,zp3)
  233. zmax=max(zmax,zp1,zp2,zp3)
  234.  
  235. *
  236. * normale au plan (123)
  237. *
  238. x12 = xp2 - xp1
  239. y12 = yp2 - yp1
  240. z12 = zp2 - zp1
  241. x23 = xp3 - xp2
  242. y23 = yp3 - yp2
  243. z23 = zp3 - zp2
  244. xn = y12*z23 - z12*y23
  245. yn = z12*x23 - x12*z23
  246. zn = x12*y23 - y12*x23
  247. sn = xn*xn + yn*yn + zn*zn
  248. sn = max(sqrt(abs(sn)),xpetit*1d10)
  249. tamax=max(sn,tamax)
  250.  
  251. xn = xn/sn
  252. yn = yn/sn
  253. zn = zn/sn
  254. ims(ip1)=1
  255. xms(ip1)=xms(ip1)+xn
  256. yms(ip1)=yms(ip1)+yn
  257. zms(ip1)=zms(ip1)+zn
  258. ims(ip2)=1
  259. xms(ip2)=xms(ip2)+xn
  260. yms(ip2)=yms(ip2)+yn
  261. zms(ip2)=zms(ip2)+zn
  262. ims(ip3)=1
  263. xms(ip3)=xms(ip3)+xn
  264. yms(ip3)=yms(ip3)+yn
  265. zms(ip3)=zms(ip3)+zn
  266. 820 continue
  267. ** write(6,*) 'xmin xmax ymin ymax zmin zmax',
  268. ** > xmin,xmax,ymin,ymax,zmin,zmax
  269. tamax = tamax * 5.
  270.  
  271. do 822 iel8=1,nbel8
  272. *
  273. ip1=ipt8.num(1,iel8)
  274. ip2=ipt8.num(2,iel8)
  275. ip3=ipt8.num(3,iel8)
  276. ipv1 = (ip1-1)*idimp1
  277. xp1 = xcoor(ipv1+1)
  278. yp1 = xcoor(ipv1+2)
  279. zp1 = xcoor(ipv1+3)
  280. ipv2 = (ip2-1)*idimp1
  281. xp2 = xcoor(ipv2+1)
  282. yp2 = xcoor(ipv2+2)
  283. zp2 = xcoor(ipv2+3)
  284. ipv3 = (ip3-1)*idimp1
  285. xp3 = xcoor(ipv3+1)
  286. yp3 = xcoor(ipv3+2)
  287. zp3 = xcoor(ipv3+3)
  288. *
  289. * normale au plan (123)
  290. *
  291. x12 = xp2 - xp1
  292. y12 = yp2 - yp1
  293. z12 = zp2 - zp1
  294. x23 = xp3 - xp2
  295. y23 = yp3 - yp2
  296. z23 = zp3 - zp2
  297. xn = y12*z23 - z12*y23
  298. yn = z12*x23 - x12*z23
  299. zn = x12*y23 - y12*x23
  300. sn = xn*xn + yn*yn + zn*zn
  301. sn = max(sqrt(abs(sn)),xpetit*1d10)
  302. xn = xn/sn
  303. yn = yn/sn
  304. zn = zn/sn
  305. ims(ip1)=1
  306. xms(ip1)=xms(ip1)+xn
  307. yms(ip1)=yms(ip1)+yn
  308. zms(ip1)=zms(ip1)+zn
  309. ims(ip2)=1
  310. xms(ip2)=xms(ip2)+xn
  311. yms(ip2)=yms(ip2)+yn
  312. zms(ip2)=zms(ip2)+zn
  313. ims(ip3)=1
  314. xms(ip3)=xms(ip3)+xn
  315. yms(ip3)=yms(ip3)+yn
  316. zms(ip3)=zms(ip3)+zn
  317. 822 continue
  318. xyzmax=xpetit/xzprec
  319. do ip = 1,nbpts
  320. if (ims(ip).ne.0) then
  321. xyzmax=max(xyzmax,abs(xms(ip)))
  322. xyzmax=max(xyzmax,abs(yms(ip)))
  323. xyzmax=max(xyzmax,abs(zms(ip)))
  324. endif
  325. enddo
  326. do 821 ip = 1,nbpts
  327. if(ims(ip).ne.0) then
  328. sn = xms(ip)*xms(ip)+yms(ip)*yms(ip)+zms(ip)*zms(ip)
  329. sn = sqrt(abs(sn))
  330. if (sn.lt.xyzmax*1d-10) then
  331. interr(1)=ip
  332. call erreur(1151)
  333. return
  334. endif
  335. xms(ip)=xms(ip)/sn
  336. yms(ip)=yms(ip)/sn
  337. zms(ip)=zms(ip)/sn
  338. ** write(6,*) 'ip ',ip,xms(ip),yms(ip),zms(ip)
  339. endif
  340. 821 continue
  341. if(ipt1.itypel.ne.22) call erreur(16)
  342. ** write(6,*) 'ipt8.itypel ',ipt8.itypel, ipt7
  343. if(ierr.ne.0) return
  344. *
  345. * Nombre d'iterations pour la detection de la direction du contact
  346. nbiter=16
  347. *
  348. * Relation du type 3 : noeud-triangle
  349. *-------------------------------------
  350. *
  351. * creation du meleme associe a la relation
  352. *
  353. nbsous=0
  354. nbref =0
  355. nbnn =5
  356. nbelem=incnel
  357. segini meleme
  358. itypel=22
  359. irigel(1,nrigel)=meleme
  360. *
  361. * creation du descriptif commun a toutes les raideurs
  362. *
  363. nligrp = 13
  364. nligrd = nligrp
  365. segini,descr
  366. lisinc(1)='LX '
  367. lisdua(1)='FLX '
  368. noelep(1)=1
  369. noeled(1)=1
  370. do 10 i=2, nligrp, 3
  371. lisinc(i) =modepl(1)
  372. lisinc(i+1)=modepl(2)
  373. lisinc(i+2)=modepl(3)
  374. lisdua(i) =moforc(1)
  375. lisdua(i+1)=moforc(2)
  376. lisdua(i+2)=moforc(3)
  377. noelep(i) =(i+4)/3
  378. noelep(i+1)=noelep(i)
  379. noelep(i+2)=noelep(i)
  380. noeled(i) =noelep(i)
  381. noeled(i+1)=noelep(i)
  382. noeled(i+2)=noelep(i)
  383. 10 continue
  384. segdes,descr
  385. irigel(3,nrigel) = descr
  386. *
  387. * creation du segment xmatri
  388. *
  389. nelrig = incnel
  390. segini,xmatri
  391. irigel(4,nrigel) = xmatri
  392. *
  393. * ce qu'on cree est unilateral
  394. *
  395. irigel(6,nrigel)=1
  396. *
  397. * ce qu'on cree est symetrique
  398. *
  399. irigel(7,nrigel)=0
  400. *
  401. * Nombre d'elements dans la rigidite du type 3
  402. nelri3 = 0
  403. *
  404. * Preparation du zonage de ipt1
  405. *
  406. nbzx=(xmax-xmin)/tamax
  407. nbzy=(ymax-ymin)/tamax
  408. nbzz=(zmax-zmin)/tamax
  409. *
  410. * preconditionnement de ipt1: mfopa4
  411. *
  412. segini mfopa4
  413. xmult=3.1415926*(xmax-xmin)
  414. ymult=2.7182818*(ymax-ymin)
  415. zmult=1.*(zmax-zmin)
  416. tmult=sqrt(xmult**2+ymult**2+zmult**2)
  417. xmult=xmult/tmult
  418. ymult=ymult/tmult
  419. zmult=zmult/tmult
  420. tmin=xgrand
  421. tmax=-xgrand
  422. do j=1,nbel1
  423. ip=ipt1.num(2,j)
  424. ipv = (ip-1)*idimp1
  425. xp = xcoor(ipv+1)
  426. yp = xcoor(ipv+2)
  427. zp = xcoor(ipv+3)
  428. tco(j)=xp*xmult+yp*ymult+zp*zmult
  429. tmin=min(tco(j),tmin)
  430. tmax=max(tco(j),tmax)
  431. ipnum(j)=ip
  432. ico(j)=j
  433. enddo
  434. nbzt=(tmax-tmin)/tamax
  435. nbzt=max(nbzt,1)
  436. nbzt=min(nbel1,nbzt)
  437. ** write(6,*) ' nbzt ',nbzt
  438.  
  439. *
  440. * trier selon x
  441. *
  442. call triflo(tco,xw,ico,iw,nbel1)
  443. *
  444. * indexer
  445. *
  446. indt=nbzt+1
  447. segini mfopa5
  448. do i=nbel1,1,-1
  449. id=nbzt*(tco(i)-tmin)/(tmax-tmin)+1
  450. ind(id)=i
  451. enddo
  452. do i=1,nbzt
  453. if (ind(i+1).eq.0) ind(i+1)=ind(i)
  454. if(ind(i+1).lt.ind(i)) call erreur(5)
  455. enddo
  456.  
  457.  
  458. * Boucle sur le maillage support du contact(frottement)
  459. *
  460. ** write(6,*) ' boucle 19 nbel6 ',nbel6
  461. DO 19 iel6=1,nbel6
  462. *
  463. xjr = 0d0
  464. ip1=ipt6.num(1,iel6)
  465. ip2=ipt6.num(2,iel6)
  466. ip3=ipt6.num(3,iel6)
  467. * Recuperation des coordonees des noeuds du triangle
  468. ipv = (ip1-1)*idimp1
  469. xp1 = xcoor(ipv+1)
  470. yp1 = xcoor(ipv+2)
  471. zp1 = xcoor(ipv+3)
  472. ipv = (ip2-1)*idimp1
  473. xp2 = xcoor(ipv+1)
  474. yp2 = xcoor(ipv+2)
  475. zp2 = xcoor(ipv+3)
  476. ipv = (ip3-1)*idimp1
  477. xp3 = xcoor(ipv+1)
  478. yp3 = xcoor(ipv+2)
  479. zp3 = xcoor(ipv+3)
  480. * Centre de gravite du triangle
  481. xg = (xp1+xp2+xp3) /3.d0
  482. yg = (yp1+yp2+yp3) /3.d0
  483. zg = (zp1+zp2+zp3) /3.d0
  484. * critere de distance
  485. d1 = (xg-xp1)**2 + (yg-yp1)**2 + (zg-zp1)**2
  486. d2 = (xg-xp2)**2 + (yg-yp2)**2 + (zg-zp2)**2
  487. d3 = (xg-xp3)**2 + (yg-yp3)**2 + (zg-zp3)**2
  488. * Triangle un peu plus grand pour les tests
  489. ** scale=1.00 + xszpre
  490. scale=1.00 + 1D-4
  491. dist2 = max(d1,d2,d3)
  492. dist = sqrt(dist2)*scale
  493. sqdist4 = dist * 4
  494. xp1e=xg+(xp1-xg)*scale
  495. yp1e=yg+(yp1-yg)*scale
  496. zp1e=zg+(zp1-zg)*scale
  497. xp2e=xg+(xp2-xg)*scale
  498. yp2e=yg+(yp2-yg)*scale
  499. zp2e=zg+(zp2-zg)*scale
  500. xp3e=xg+(xp3-xg)*scale
  501. yp3e=yg+(yp3-yg)*scale
  502. zp3e=zg+(zp3-zg)*scale
  503. 25 continue
  504. * rechercher le noeud a tester dans le deuxieme maillage qui est sous forme mult avec en
  505. * deuxieme position le point physique
  506. ** write(6,*) ' boucle 20 ipt1 ',ipt1.num(/2)
  507. xgm = xg -sqdist4
  508. xgp = xg +sqdist4
  509. ygm = yg -sqdist4
  510. ygp = yg +sqdist4
  511. zgm = zg -sqdist4
  512. zgp = zg +sqdist4
  513. *
  514. * calcul zone du centre de gravite
  515. *
  516. tc=xg*xmult+yg*ymult+zg*zmult
  517. *
  518. xmn = (xms(ip1)+xms(ip2)+xms(ip3))*X1s3
  519. ymn = (yms(ip1)+yms(ip2)+yms(ip3))*X1s3
  520. zmn = (zms(ip1)+zms(ip2)+zms(ip3))*X1s3
  521. xzonag = sqdist4*sqr3
  522. tjeup=0.d0
  523. tjeum=0.d0
  524.  
  525. if (MELVA1.ne.0) then
  526. * xmult ymult et zmult doivent etre positifs
  527. tjeum=xmult*(xjmin*xmn)+ymult*(xjmin*ymn)+zmult*(xjmin*zmn)
  528. tjeup=xmult*(xjmax*xmn)+ymult*(xjmax*ymn)+zmult*(xjmax*zmn)
  529. endif
  530. *
  531. izg=nbzt*((tc-xzonag-tjeum)-tmin)/(tmax-tmin)+1
  532. izg=max(izg,1)
  533. izg=min(izg,indt)
  534. * debut de zone
  535. indb=ind(izg)
  536. do 20 iz=indb,nbel1
  537. if(tco(iz).lt.(tc-tjeum-xzonag)) goto 20
  538. if(tco(iz).gt.(tc-tjeup+xzonag)) then
  539. ** write(6,*) ' sortie pour ',iz, ' en ',iz-indb+1
  540. goto 18
  541. endif
  542. iel1 = ico(iz)
  543. jp = ipnum(iel1)
  544. * Verification que pas relation du point sur lui meme
  545. if (jp.eq.ip1) goto 20
  546. if (jp.eq.ip2) goto 20
  547. if (jp.eq.ip3) goto 20
  548. * verification rapide en norme L1 d'abord
  549. ipv = (jp-1)*idimp1
  550. xp = xcoor(ipv+1)
  551. yp = xcoor(ipv+2)
  552. zp = xcoor(ipv+3)
  553. *
  554. xpp=xp
  555. ypp=yp
  556. zpp=zp
  557. if (MELVA1.ne.0) then
  558. nel1 = min (iel1,nelj)
  559. xjr = melva1.velche(nptelj,nel1)
  560. xpp=xpp-xjr*xmn
  561. ypp=ypp-xjr*ymn
  562. zpp=zpp-xjr*zmn
  563. endif
  564. if(xpp.lt.xgm.or.xpp.gt.xgp) goto 20
  565. if(ypp.lt.ygm.or.ypp.gt.ygp) goto 20
  566. if(zpp.lt.zgm.or.zpp.gt.zgp) goto 20
  567. *
  568. * Verification si autre point dans la zone de selection
  569. * verif distance au centre de gravite
  570. dp = ((xg-xpp)**2 + (yg-ypp)**2 + (zg-zpp)**2)
  571. ** write(6,*) 'dp dist2',dp,dist2,xjr
  572. *** if (dp.gt.xzonag**2) then
  573. *** goto 20
  574. *** endif
  575. C*DBG write(ioimp,*) 'contact test distance ok',dp,d1,d2,d3
  576.  
  577. * verif position par rapport aux cotes
  578.  
  579. * cote 1 2
  580. x12 = xp2 - xp1
  581. y12 = yp2 - yp1
  582. z12 = zp2 - zp1
  583. sv = sqrt(x12**2+y12**2+z12**2)
  584. xv=x12/sv
  585. yv=y12/sv
  586. zv=z12/sv
  587. * normale locale (1 et 2)
  588. xnl=xms(ip1)+xms(ip2)
  589. ynl=yms(ip1)+yms(ip2)
  590. znl=zms(ip1)+zms(ip2)
  591.  
  592. * vecteur reference
  593. xn=y12*znl-z12*ynl
  594. yn=z12*xnl-x12*znl
  595. zn=x12*ynl-y12*xnl
  596. dn = sqrt(xn*xn+yn*yn+zn*zn)
  597. scal = (xpp-xp1e)*xv + (ypp-yp1e)*yv + (zpp-zp1e)*zv
  598. xm = xp1e + scal*xv
  599. ym = yp1e + scal*yv
  600. zm = zp1e + scal*zv
  601. dpm = sqrt(abs((xpp-xm)**2+(ypp-ym)**2+(zpp-zm)**2))
  602. scal = (xpp-xm)*xn + (ypp-ym)*yn + (zpp-zm)*zn
  603. ** if (dpm.lt.dist*xszpre) write(6,*) ' pt sur 1 2',dpm
  604. if (dpm.gt.dist*xszpre.and.scal.gt.0.707d0*dn*dpm) then
  605. * write(6,*) ' 1 dpm scal ',dpm,scal
  606. goto 20
  607. endif
  608. dpm=max(xpetit,dpm)
  609. * write(ioimp,*) 'contact test position 1 ok',
  610. * & scal/(dn*dpm),scal,dn,dpm
  611. *
  612. * cote 2 3
  613. x23 = xp3 - xp2
  614. y23 = yp3 - yp2
  615. z23 = zp3 - zp2
  616. sv = sqrt(x23**2+y23**2+z23**2)
  617. xv=x23/sv
  618. yv=y23/sv
  619. zv=z23/sv
  620. * normale locale (2 et 3)
  621. xnl=xms(ip2)+xms(ip3)
  622. ynl=yms(ip2)+yms(ip3)
  623. znl=zms(ip2)+zms(ip3)
  624.  
  625. * vecteur reference
  626. xn=y23*znl-z23*ynl
  627. yn=z23*xnl-x23*znl
  628. zn=x23*ynl-y23*xnl
  629. dn = sqrt(xn*xn+yn*yn+zn*zn)
  630. scal = (xpp-xp2e)*xv + (ypp-yp2e)*yv + (zpp-zp2e)*zv
  631. xm = xp2e + scal*xv
  632. ym = yp2e + scal*yv
  633. zm = zp2e + scal*zv
  634. dpm = sqrt(abs((xpp-xm)**2+(ypp-ym)**2+(zpp-zm)**2))
  635. scal = (xpp-xm)*xn + (ypp-ym)*yn + (zpp-zm)*zn
  636. ** if (dpm.lt.dist*xszpre) write(6,*) ' pt sur 2 3',dpm
  637. if (dpm.gt.dist*xszpre.and.scal.gt.0.707d0*dn*dpm) then
  638. * write(6,*) ' 2 dpm scal ',dpm,scal
  639. goto 20
  640. endif
  641. dpm=max(xpetit,dpm)
  642. * write(ioimp,*) 'contact test position 2 ok',
  643. * & scal/(dn*dpm),scal,dn,dpm
  644. *
  645. * cote 3 1
  646. x31 = xp1 - xp3
  647. y31 = yp1 - yp3
  648. z31 = zp1 - zp3
  649. sv = sqrt(x31**2+y31**2+z31**2)
  650. xv=x31/sv
  651. yv=y31/sv
  652. zv=z31/sv
  653. * normale locale (3 et 1)
  654. xnl=xms(ip3)+xms(ip1)
  655. ynl=yms(ip3)+yms(ip1)
  656. znl=zms(ip3)+zms(ip1)
  657. * vecteur reference
  658. xn=y31*znl-z31*ynl
  659. yn=z31*xnl-x31*znl
  660. zn=x31*ynl-y31*xnl
  661. dn = sqrt(xn*xn+yn*yn+zn*zn)
  662. scal = (xpp-xp3e)*xv + (ypp-yp3e)*yv + (zpp-zp3e)*zv
  663. xm = xp3e + scal*xv
  664. ym = yp3e + scal*yv
  665. zm = zp3e + scal*zv
  666. dpm = sqrt(abs((xpp-xm)**2+(ypp-ym)**2+(zpp-zm)**2))
  667. scal = (xpp-xm)*xn + (ypp-ym)*yn + (zpp-zm)*zn
  668. ** if (dpm.lt.dist*xszpre) write(6,*) ' pt sur 3 1',dpm
  669. if (dpm.gt.dist*xszpre.and.scal.gt.0.707d0*dn*dpm) then
  670. * write(6,*) ' 3 dpm scal ',dpm,scal
  671. goto 20
  672. endif
  673. dpm=max(xpetit,dpm)
  674. * write(ioimp,*) 'contact test position 2 ok',
  675. * & scal/(dn*dpm),scal,dn,dpm
  676. *
  677. * on a un point ou imposer la relation
  678. C*DBG write(ioimp,*) 'contact potentiel '
  679. * Quelle est la relation ???
  680. *
  681. * direction de la relation = normale au plan (123)
  682. *
  683. * normale reelle
  684. xnr = y12*z23 - z12*y23
  685. ynr = z12*x23 - x12*z23
  686. znr = x12*y23 - y12*x23
  687. dnr = sqrt(xnr*xnr+ynr*ynr+znr*znr)
  688. if (dnr.lt.dist*xszpre.AND.iimpi.ne.0) write(ioimp,*) ' pb dnr'
  689. xnr = xnr / dnr
  690. ynr = ynr / dnr
  691. znr = znr / dnr
  692. * normale ponderee
  693. xn=xms(ip1)+xms(ip2)+xms(ip3)
  694. yn=yms(ip1)+yms(ip2)+yms(ip3)
  695. zn=zms(ip1)+zms(ip2)+zms(ip3)
  696. dn = sqrt(xn*xn+yn*yn+zn*zn)
  697. if (.not.(dn.lt.1d-10).and. .not.(dn.gt.1d-10).AND.iimpi.ne.0)
  698. & write(ioimp,*) 'Prob 4.1 - impo32'
  699. if (abs(dn).le.xpetit.AND.iimpi.ne.0)
  700. & write(ioimp,*) 'Prob 4.2 - impo32'
  701. xn = xn / dn
  702. yn = yn / dn
  703. zn = zn / dn
  704. *
  705. * Distance (jeu) du point jp au plan de contact
  706. * Puis calcul de la projection sur le plan de contact
  707. *
  708. ** write(6,*) 'ip1 xms ',ip1,xms(ip1),yms(ip1),zms(ip1)
  709. ** write(6,*) 'ip2 xms ',ip2,xms(ip2),yms(ip2),zms(ip2)
  710. ** write(6,*) 'ip3 xms ',ip3,xms(ip3),yms(ip3),zms(ip3)
  711. ** write(6,*) 'xn ',xn,yn,zn
  712. iter = 0
  713. xjeu = (xp-xg)*xnr + (yp-yg)*ynr + (zp-zg)*znr
  714. 21 continue
  715. angn = xn * xnr + yn*ynr + zn*znr
  716. if (angn.le.xpetit.AND.iimpi.ne.0)
  717. & write(ioimp,*) 'angn negatif ',angn
  718. if(angn.le.xpetit) goto 20
  719. xjeuv = xjeu / angn
  720. *
  721. * Recherche de ses coordonnées barycentriques
  722. * qui sont les surfaces des sous triangles
  723. *
  724. xq = xp - xjeuv*xn
  725. yq = yp - xjeuv*yn
  726. zq = zp - xjeuv*zn
  727. xb1 = (yq-yp2)*(zq-zp3)-(zq-zp2)*(yq-yp3)
  728. yb1 = (zq-zp2)*(xq-xp3)-(xq-xp2)*(zq-zp3)
  729. zb1 = (xq-xp2)*(yq-yp3)-(yq-yp2)*(xq-xp3)
  730. xb2 = (yq-yp3)*(zq-zp1)-(zq-zp3)*(yq-yp1)
  731. yb2 = (zq-zp3)*(xq-xp1)-(xq-xp3)*(zq-zp1)
  732. zb2 = (xq-xp3)*(yq-yp1)-(yq-yp3)*(xq-xp1)
  733. xb3 = (yq-yp1)*(zq-zp2)-(zq-zp1)*(yq-yp2)
  734. yb3 = (zq-zp1)*(xq-xp2)-(xq-xp1)*(zq-zp2)
  735. zb3 = (xq-xp1)*(yq-yp2)-(yq-yp1)*(xq-xp2)
  736. b1 = xb1*xnr + yb1*ynr + zb1*znr
  737. b2 = xb2*xnr + yb2*ynr + zb2*znr
  738. b3 = xb3*xnr + yb3*ynr + zb3*znr
  739. bt = b1 + b2 + b3
  740. * normalement pas utile
  741. * element retourne a cause des grands deplacements
  742. if (bt.lt.xpetit) then
  743. write (ioimp,*) ' bt negatif dans impo32 '
  744. call soucis(719)
  745. ** bt=xpetit*2.d0
  746. goto 20
  747. endif
  748. if (bt.lt.0.d0.AND.iimpi.ne.0) then
  749. write (ioimp,*) ' bt negatif dans impo32 '
  750. print *,'xp1 yp1 zp1',xp1,yp1,zp1
  751. print *,'xp2 yp2 zp2',xp2,yp2,zp2
  752. print *,'xp3 yp3 zp3',xp3,yp3,zp3
  753. print *,'xp yp zp',xp,yp,zp
  754. print *,'xn yn zn',xn,yn,zn
  755. print *,'b1 b2 b3 bt',b1,b2,b3,bt
  756. * goto 20
  757. endif
  758. bsurf = bt / 2
  759. if (.not.(bt.lt.1d-10) .and. .not.(bt.gt.1d-10).AND.iimpi.ne.0)
  760. & write(ioimp,*) 'Prob 5.1 - impo32'
  761. if (abs(bt).le.xpetit) write(ioimp,*) 'Prob 5.2 - impo32'
  762. b1 = b1 / bt
  763. b2 = b2 / bt
  764. b3 = b3 / bt
  765. * recalcul de la direction et du jeu en fonction des normales aux sommets
  766. * on arete l'interpolation de la normale au bord de l'element
  767. bb1=max(b1,0.d0)
  768. bb2=max(b2,0.d0)
  769. bb3=max(b3,0.d0)
  770. bm = bb1 + bb2 + bb3
  771. bb1 = bb1 / bm
  772. bb2 = bb2 / bm
  773. bb3 = bb3 / bm
  774. xnp = xn
  775. ynp = yn
  776. znp = zn
  777. xn = bb1*xms(ip1)+ bb2*xms(ip2)+ bb3*xms(ip3)
  778. yn = bb1*yms(ip1)+ bb2*yms(ip2)+ bb3*yms(ip3)
  779. zn = bb1*zms(ip1)+ bb2*zms(ip2)+ bb3*zms(ip3)
  780. sn = sqrt (xn*xn + yn*yn + zn*zn)
  781. xn=xn/sn
  782. yn=yn/sn
  783. zn=zn/sn
  784. diff=abs(xn-xnp)+abs(yn-ynp)+abs(zn-znp)
  785. * write (6,*) ' iter b* *n ',iter,b1,b2,b3,xn,yn,zn
  786. * recalcul en fonction de la nouvelle normale
  787. iter=iter+1
  788. if (iter.gt.64) then
  789. ** write(6,*) ' impo32 diff ',diff
  790. goto 20
  791. endif
  792. if (diff.gt.1d-10) goto 21
  793. ** write(6,*) ' impo32 iter ',iter
  794. ** write (6,*) ' iter b* *n ',iter,b1,b2,b3,xn,yn,zn
  795.  
  796.  
  797. * si on a deja traverse, les trois coordonnees barycentriques doivent etre positives
  798. ** if (xjeuv-xjr.lt.-xszpre*dist) then
  799. ** if (b1.lt.-xszpre) goto 20
  800. ** if (b2.lt.-xszpre) goto 20
  801. ** if (b3.lt.-xszpre) goto 20
  802. ** endif
  803. * Si on est en dehors, on projette sur l'arete (ou pas)
  804. ** if (b1.lt.0.d0.or.b2.lt.0.d0.or.b3.lt.0.d0) then
  805. ** xq=xp1*bb1+xp2*bb2+xp3*bb3
  806. ** yq=yp1*bb1+yp2*bb2+yp3*bb3
  807. ** zq=zp1*bb1+zp2*bb2+zp3*bb3
  808. ** xnn=xp-xq
  809. ** ynn=yp-yq
  810. ** znn=zp-zq
  811. ** snn=sqrt(abs(xnn*xnn+ynn*ynn+znn*znn))
  812. ** if (snn.lt.xszpre*dist) write (6,*) ' snn petit ',snn
  813. * sinon on prend la direction reelle
  814. ** if (snn.gt.xszpre*dist) then
  815. ** xn=xnn/sn
  816. ** yn=ynn/sn
  817. ** zn=znn/sn
  818. ** endif
  819. ** endif
  820. xjeu1 = (xp-xp1)*xn + (yp-yp1)*yn + (zp-zp1)*zn
  821. xjeu2 = (xp-xp2)*xn + (yp-yp2)*yn + (zp-zp2)*zn
  822. xjeu3 = (xp-xp3)*xn + (yp-yp3)*yn + (zp-zp3)*zn
  823. *****pv xjeuv = xjeu1 * bb1 + xjeu2 * bb2 + xjeu3 * bb3
  824. ** write (6,*) 'b1 b2 b3',b1,b2,b3
  825. ** write (6,*) 'xjeu xjeuv ',xjeu,xjeuv,xjeu1,xjeu2,xjeu3
  826. xjeu = xjeuv - xjr
  827. ** write (6,*) ' normale ',xn,yn,zn,' jeu ',xjeu1,xjeu2,xjeu3
  828. * verif bon cote (a la tolerance pres)
  829. ** write (6,*) ' xjeu ',xjeu,dist,iel6
  830. ** if (xjeu.lt.-1*dist) goto 20
  831. ** if (xjeu.gt.3*dist) goto 20
  832. * verif compatibilite avec la normale au poin impactant
  833. if (xms(jp)*xn+yms(jp)*yn+zms(jp)*zn.gt. -0.0d0) then
  834. * write (6,*) ' impo32 normales incompatibes 1 ',
  835. * > jp,xjeu,dpm,dist
  836. goto 20
  837. endif
  838.  
  839.  
  840.  
  841. C*DBG write(ioimp,*) ' b1 b2 b3 ',b1,b2,b3
  842. 1954 continue
  843. * points a l'exterieur?
  844. * on met une ponderation et un rayon d'acceptation
  845. pond = (1D4+1) - 1D4 * bm
  846. if (pond.le.0.d0) goto 20
  847. pond=max(pond,0.d0)
  848. pond=min(pond,1.d0)
  849.  
  850. ** if (xjeu.lt.0.d0)
  851. ** > write (6,*) 'pt traverse',jp,b1,b2,b3,xjeuv-xjr,dist
  852.  
  853. *
  854. * Ajout d'une relation noeud-triangle
  855. *
  856. nelri3 = nelri3 + 1
  857. nelch = nelch + 1
  858. *
  859. * on ajuste les differents segments si necesaire
  860. *
  861. if (nelri3.gt.nelrig) then
  862. nelrig = nelrig + incnel
  863. segadj,xmatri
  864. nbelem = nbelem + incnel
  865. nbnn = 5
  866. segadj,meleme
  867. nbnn = 1
  868. segadj,ipt7
  869. n = n + incnel
  870. segadj,mpoval
  871. endif
  872. *
  873. * Mise a jour du meleme
  874. ** write(6,*) 'ipt8.num(/2)',ipt8.num(/2)
  875. num(1,nelri3) = ipt1.num(1,iel1)
  876. num(2,nelri3) = ip1
  877. num(3,nelri3) = ip2
  878. num(4,nelri3) = ip3
  879. num(5,nelri3) = jp
  880. ** write(6,*) ' nouveau meleme',num(1,nelri3),num(2,nelri3),
  881. ** > num(3,nelri3),num(4,nelri3),num(5,nelri3) *
  882. * Mise a jour de xmatri
  883. * lambda
  884. re( 1,1,nelri3) = 0d0
  885. * ip1
  886. re( 2,1,nelri3) = xn * bb1 * bsurf * pond
  887. re( 3,1,nelri3) = yn * bb1 * bsurf * pond
  888. re( 4,1,nelri3) = zn * bb1 * bsurf * pond
  889. * ip2
  890. re( 5,1,nelri3) = xn * bb2 * bsurf * pond
  891. re( 6,1,nelri3) = yn * bb2 * bsurf * pond
  892. re( 7,1,nelri3) = zn * bb2 * bsurf * pond
  893. * ip3
  894. re( 8,1,nelri3) = xn * bb3 * bsurf * pond
  895. re( 9,1,nelri3) = yn * bb3 * bsurf * pond
  896. re(10,1,nelri3) = zn * bb3 * bsurf * pond
  897. * jp
  898. re(11,1,nelri3) = -xn * bsurf * pond
  899. re(12,1,nelri3) = -yn * bsurf * pond
  900. re(13,1,nelri3) = -zn * bsurf * pond
  901. * on transpose
  902. do 30 ic = 2, nligrp
  903. re(1,ic,nelri3) = re(ic,1,nelri3)
  904. 30 continue
  905. * le reste est nul
  906. *
  907. * remplissage du champoint de depi (jeu)
  908. *
  909. ipt7.num(1,nelch) = ipt1.num(1,iel1)
  910. ** write(6,*) ' ipt1.num(1,iel1) ',ipt1.num(1,iel1)
  911. vpocha(nelch,1) = xjeu * bsurf * pond
  912. vpocha(nelch,2) = bsurf * pond
  913. IF (MELVA2.NE.0) THEN
  914. NEL2 = min (iel1,NELA)
  915. VPOCHA(nelch,3) = max(MELVA2.VELCHE(NPTELA,NEL2),0.D0)*
  916. > bsurf * pond
  917. ENDIF
  918. ** write(ioimp,*) ' jeu ',xjeu,ip1,ip2,ip3,jp,b1,b2,b3,xn,yn,zn
  919. *
  920. 20 CONTINUE
  921. 18 CONTINUE
  922. 19 CONTINUE
  923. *
  924. * Ajustement au plus juste puis desactivation des segments lies
  925. * a la rigidite du type 3
  926. if (nelri3.ne.nelrig) then
  927. nelrig = nelri3
  928. segadj,xmatri
  929. nbelem = nelri3
  930. nbnn = 5
  931. segadj,meleme
  932. endif
  933. segdes,xmatri
  934. *
  935. ** write(ioimp,*) ' nb relation type 3 ',nelri3
  936. ** write(6,fmt='(10i8)') (num(5,nelr),nelr=1,nelri3)
  937.  
  938.  
  939.  
  940.  
  941.  
  942. C*DBG if (nelri3.eq.0) irigel(6,nrigel)=0
  943. *
  944. * Fin du traitement de la formulation standard/forte
  945. * ----------------------------------------------------
  946. 300 CONTINUE
  947. * Destruction des segments locaux devenus inutiles
  948. segsup mfopa3,mfopa4,mfopa5
  949.  
  950. GOTO 1000
  951.  
  952. *=======================================================================
  953. *= Formulation "faible" 3D : relation triangle-triangle
  954. *=======================================================================
  955. * Element de contact 3D a 7 noeuds (1+6)
  956. 500 CONTINUE
  957. *
  958. * Petit segment de travail
  959. segini,mfaible
  960. *
  961. * Relation du type 0 : triangle-triangle (faible)
  962. *---------------------------------------
  963. *
  964. * Creation du meleme associe a la relation
  965. *
  966. nbnn = 7
  967. nbelem = incnel
  968. nbsous = 0
  969. nbref = 0
  970. segini,meleme
  971. itypel = 22
  972. irigel(1,nrigel) = meleme
  973. *
  974. * Creation du descriptif commun a toutes les raideurs
  975. *
  976. nligrp = 19
  977. nligrd = nligrp
  978. segini,descr
  979. lisinc(1) = 'LX '
  980. lisdua(1) = 'FLX '
  981. noelep(1) = 1
  982. noeled(1) = 1
  983. do 510 i = 2, nligrp, 3
  984. lisinc(i ) = modepl(1)
  985. lisinc(i+1) = modepl(2)
  986. lisinc(i+2) = modepl(3)
  987. lisdua(i ) = moforc(1)
  988. lisdua(i+1) = moforc(2)
  989. lisdua(i+2) = moforc(3)
  990. noelep(i ) = (i+5)/3
  991. noelep(i+1) = noelep(i)
  992. noelep(i+2) = noelep(i)
  993. noeled(i ) = noelep(i)
  994. noeled(i+1) = noelep(i)
  995. noeled(i+2) = noelep(i)
  996. 510 continue
  997. segdes,descr
  998. irigel(3,nrigel) = descr
  999. *
  1000. * creation du segment xmatri
  1001. *
  1002. nelrig = incnel
  1003. segini,xmatri
  1004. irigel(4,nrigel) = xmatri
  1005. *
  1006. * ce qu'on cree est unilateral
  1007. *
  1008. irigel(6,nrigel) = 1
  1009. *
  1010. * ce qu'on cree est symetrique
  1011. *
  1012. irigel(7,nrigel) = 0
  1013. *
  1014. * Nombre d'elements crees dans meleme=irigel(1,nrigel), ipt7 et mpoval
  1015. nelri0 = 0
  1016. *
  1017. * Boucle sur les elements du maillage de contact/frottement "faible"
  1018. *
  1019. DO 519 iel8=1,nbel8
  1020. *
  1021. xjr = 0d0
  1022. ip1 = ipt8.num(1,iel8)
  1023. ip2 = ipt8.num(2,iel8)
  1024. ip3 = ipt8.num(3,iel8)
  1025. * Definition du triangle T1(ip1,ip2,ip3)
  1026. * - Coordonnees des noeuds de T1
  1027. ipv = (ip1-1)*idimp1
  1028. xp1 = xcoor(ipv+1)
  1029. yp1 = xcoor(ipv+2)
  1030. zp1 = xcoor(ipv+3)
  1031. ipv = (ip2-1)*idimp1
  1032. xp2 = xcoor(ipv+1)
  1033. yp2 = xcoor(ipv+2)
  1034. zp2 = xcoor(ipv+3)
  1035. ipv = (ip3-1)*idimp1
  1036. xp3 = xcoor(ipv+1)
  1037. yp3 = xcoor(ipv+2)
  1038. zp3 = xcoor(ipv+3)
  1039. * - Barycentre de T1
  1040. xgT1 = (xp1 + xp2 + xp3) * X1s3
  1041. ygT1 = (yp1 + yp2 + yp3) * X1s3
  1042. zgT1 = (zp1 + zp2 + zp3) * X1s3
  1043. * - Normale au triangle T1
  1044. xnT1 = (yp1-yp2)*(zp2-zp3) - (zp1-zp2)*(yp2-yp3)
  1045. ynT1 = (zp1-zp2)*(xp2-xp3) - (xp1-xp2)*(zp2-zp3)
  1046. znT1 = (xp1-xp2)*(yp2-yp3) - (yp1-yp2)*(xp2-xp3)
  1047. dnT1 = SQRT(xnT1*xnT1+ynT1*ynT1+znT1*znT1)
  1048. IF (.not.(dnT1.lt.1d-10) .and. .not.(dnT1.gt.1d-10).AND.
  1049. & iimpi.ne.0) write(ioimp,*) 'FAIBle - 1.1 - impo32'
  1050. IF (abs(dnT1).le.xpetit) write(ioimp,*) 'FAIBle - 1.2 - impo32'
  1051. xnT1 = xnT1 / dnT1
  1052. ynT1 = ynT1 / dnT1
  1053. znT1 = znT1 / dnT1
  1054. C*DBG write(ioimp,*) 'Normale au plan T1',xnT1,ynT1,znT1,dnT1
  1055. * - Rayon de la sphere "englobante" de l'element (centre=barycentre)
  1056. d1 = (xgT1-xp1)**2 + (ygT1-yp1)**2 + (zgT1-zp1)**2
  1057. d2 = (xgT1-xp2)**2 + (ygT1-yp2)**2 + (zgT1-zp2)**2
  1058. d3 = (xgT1-xp3)**2 + (ygT1-yp3)**2 + (zgT1-zp3)**2
  1059. RayT1 = SQRT(max(d1,d2,d3))
  1060. DO 520 iel6 = 1, nbel6
  1061. if (MELVA1.ne.0) then
  1062. nel1 = min (iel6,nelj)
  1063. xjr = melva1.velche(nptelj,nel1)
  1064. endif
  1065. jp1 = ipt6.num(1,iel6)
  1066. * - Les noeuds 2 et 3 sont intervertis (fait aupravant dans impo31)
  1067. * Cela permet aux triangles T1 et T2 d etre orientes dans le meme sens.
  1068. jp3 = ipt6.num(2,iel6)
  1069. jp2 = ipt6.num(3,iel6)
  1070. C*DBG write(ioimp,*) iel,ip1,ip2,ip3,jp1,jp2,jp3,ipt1.num(1,iel)
  1071. *
  1072. * Verification (provisoire) qu'il n'y a pas de noeud double
  1073. if (ip1.eq.jp1) goto 520
  1074. if (ip1.eq.jp2) goto 520
  1075. if (ip1.eq.jp3) goto 520
  1076. if (ip2.eq.jp1) goto 520
  1077. if (ip2.eq.jp2) goto 520
  1078. if (ip2.eq.jp3) goto 520
  1079. if (ip3.eq.jp1) goto 520
  1080. if (ip3.eq.jp2) goto 520
  1081. if (ip3.eq.jp3) goto 520
  1082. *
  1083. *
  1084. * Definition du triangle T2(jp1,jp2,jp3)
  1085. * - Coordonnees des noeuds de T2
  1086. ipv = (jp1-1)*idimp1
  1087. xq1 = xcoor(ipv+1)
  1088. yq1 = xcoor(ipv+2)
  1089. zq1 = xcoor(ipv+3)
  1090. ipv = (jp2-1)*idimp1
  1091. xq2 = xcoor(ipv+1)
  1092. yq2 = xcoor(ipv+2)
  1093. zq2 = xcoor(ipv+3)
  1094. ipv = (jp3-1)*idimp1
  1095. xq3 = xcoor(ipv+1)
  1096. yq3 = xcoor(ipv+2)
  1097. zq3 = xcoor(ipv+3)
  1098. * - Barycentre de T2
  1099. xgT2 = (xq1 + xq2 + xq3) * X1s3
  1100. ygT2 = (yq1 + yq2 + yq3) * X1s3
  1101. zgT2 = (zq1 + zq2 + zq3) * X1s3
  1102. * - Normale au triangle T2
  1103. xnT2 = (yq1-yq2)*(zq2-zq3) - (zq1-zq2)*(yq2-yq3)
  1104. ynT2 = (zq1-zq2)*(xq2-xq3) - (xq1-xq2)*(zq2-zq3)
  1105. znT2 = (xq1-xq2)*(yq2-yq3) - (yq1-yq2)*(xq2-xq3)
  1106. dnT2 = SQRT(xnT2*xnT2+ynT2*ynT2+znT2*znT2)
  1107. IF (.not.(dnT2.lt.1d-10) .and. .not.(dnT2.gt.1d-10).AND.
  1108. & iimpi.ne.0) write(ioimp,*) 'FAIBle - 2.1 - impo32'
  1109. IF (abs(dnT2).le.xpetit.AND.iimpi.ne.0)
  1110. & write(ioimp,*) 'FAIBle - 2.2 - impo32'
  1111. xnT2 = xnT2 / dnT2
  1112. ynT2 = ynT2 / dnT2
  1113. znT2 = znT2 / dnT2
  1114. C*DBG write(ioimp,*) 'Normale au plan T2',xnT2,ynT2,znT2,dnT2
  1115. * - Rayon de la sphere "englobante" de l'element (centre=barycentre)
  1116. d1 = (xgT2-xq1)**2 + (ygT2-yq1)**2 + (zgT2-zq1)**2
  1117. d2 = (xgT2-xq2)**2 + (ygT2-yq2)**2 + (zgT2-zq2)**2
  1118. d3 = (xgT2-xq3)**2 + (ygT2-yq3)**2 + (zgT2-zq3)**2
  1119. RayT2 = SQRT(max(d1,d2,d3))
  1120.  
  1121. * Orientation respective correcte des 2 normales
  1122. * Les triangles T1 et T2 etant decrits dans le meme sens ("prisme"),
  1123. * le produit scalaire de leur normale doit etre positif ou nul !
  1124. scal = xnT1 * xnT2 + ynT1 * ynT2 + znT1 * znT2
  1125. C*DBG write(ioimp,*) 'Prod.scal des normales',scal
  1126. if (scal.lt.0.) goto 520
  1127. *
  1128. * Distance entre les centres de gravite
  1129. * Les spheres "englobantes" doivent s'intersecter pour contact potentiel
  1130. dist = SQRT((xgT2-xgT1)**2 + (ygT2-ygT1)**2 + (zgT2-zgT1)**2)
  1131. * IF (dist*4.GT.RayT1+RayT2) goto 520
  1132. *
  1133. * Definition du plan de contact (surface intermediaire)
  1134. * - Normale (unitaire) du plan de contact
  1135. xnC = xnT1 + xnT2
  1136. ynC = ynT1 + ynT2
  1137. znC = znT1 + znT2
  1138. dnC = SQRT(xnC*xnC + ynC*ynC + znC*znC)
  1139. IF (.not.(dnC.lt.1d-10).and. .not.(dnC.GT.1D-10).AND.iimpi.ne.0)
  1140. & write(ioimp,*) 'FAIBle - 3.1 - impo32'
  1141. IF (abs(dnC).le.xpetit.AND.iimpi.ne.0)
  1142. & write(ioimp,*) 'FAIBle - 3.2 - impo32'
  1143. xnC = xnC / dnC
  1144. ynC = ynC / dnC
  1145. znC = znC / dnC
  1146. C*DBG write(ioimp,*) 'Normale au plan Contact',xnC,ynC,znC,dnC
  1147. *
  1148. * Criteres d'acceptation de l'element de contact
  1149. RayTT = RayT1 + RayT2
  1150. * - Les barycentres des triangles T1 et T2 sont-ils suffisamment proches :
  1151. * distance suivant la direction de contact (prise en compte du jeu)
  1152. VXB12 = xgT2 - xgT1
  1153. VYB12 = ygT2 - ygT1
  1154. VZB12 = zgT2 - zgT1
  1155. distn = (VXB12*xnC)+(VYB12*ynC)+(VZB12*znC)
  1156. test1 = distn
  1157. if (MELVA1.NE.0) then
  1158. test1 = test1 - xjr
  1159. endif
  1160. if (test1.GT.RayTT) GOTO 520
  1161. *
  1162. * distance dans un plan dont la normale est la direction de contact
  1163. distt = SQRT(dist**2 - distn**2)
  1164. if (distt.GT.RayTT) GOTO 520
  1165.  
  1166. * - Point definissant le plan de contact
  1167. * = milieu des barycentres des triangles T1 et T2
  1168. xgC = (xgT1 + xgT2) * 0.5
  1169. ygC = (ygT1 + ygT2) * 0.5
  1170. zgC = (zgT1 + zgT2) * 0.5
  1171. * - "Distance" de reference au plan de contact
  1172. dgC = xgC*xnC + ygC*ynC + zgC*znC
  1173. *
  1174. * Distance "signee" des triangles T1 et T2 au plan de contact
  1175. dp1C = (xp1*xnC + yp1*ynC + zp1*znC) - dgC
  1176. dp2C = (xp2*xnC + yp2*ynC + zp2*znC) - dgC
  1177. dp3C = (xp3*xnC + yp3*ynC + zp3*znC) - dgC
  1178. dq1C = (xq1*xnC + yq1*ynC + zq1*znC) - dgC
  1179. dq2C = (xq2*xnC + yq2*ynC + zq2*znC) - dgC
  1180. dq3C = (xq3*xnC + yq3*ynC + zq3*znC) - dgC
  1181. * Projection des triangles T1 et T2 sur le plan de contact
  1182. * T1C = triangle T1 projete sur plan de Contact
  1183. cPT1C(1,1) = xp1 - dp1C * xnC
  1184. cPT1C(1,2) = yp1 - dp1C * ynC
  1185. cPT1C(1,3) = zp1 - dp1C * znC
  1186. cPT1C(2,1) = xp2 - dp2C * xnC
  1187. cPT1C(2,2) = yp2 - dp2C * ynC
  1188. cPT1C(2,3) = zp2 - dp2C * znC
  1189. cPT1C(3,1) = xp3 - dp3C * xnC
  1190. cPT1C(3,2) = yp3 - dp3C * ynC
  1191. cPT1C(3,3) = zp3 - dp3C * znC
  1192. * T2C = triangle T2 projete sur plan de Contact
  1193. cPT2C(1,1) = xq1 - dq1C * xnC
  1194. cPT2C(1,2) = yq1 - dq1C * ynC
  1195. cPT2C(1,3) = zq1 - dq1C * znC
  1196. cPT2C(2,1) = xq2 - dq2C * xnC
  1197. cPT2C(2,2) = yq2 - dq2C * ynC
  1198. cPT2C(2,3) = zq2 - dq2C * znC
  1199. cPT2C(3,1) = xq3 - dq3C * xnC
  1200. cPT2C(3,2) = yq3 - dq3C * ynC
  1201. cPT2C(3,3) = zq3 - dq3C * znC
  1202. *
  1203. * On determine quelle est la composante maximale de la normale pour
  1204. * projeter les triangles T1C et T2C sur un plan parallele aux axes
  1205. * ("le plus orthogonal" a cette normale), ce qui maximise leur aire.
  1206. r_x = abs(xnC)
  1207. r_y = abs(ynC)
  1208. r_z = abs(znC)
  1209. if (r_x.gt.r_y) then
  1210. inC = 1
  1211. if (r_x.lt.r_z) inC = 3
  1212. else
  1213. inC = 2
  1214. if (r_y.lt.r_z) inC = 3
  1215. endif
  1216. * Projection des triangles T1C et T2C sur ce plan // aux axes (A)
  1217. * T1A = triangle T1C projete sur ce plan (A)
  1218. * T2A = triangle T2C projete sur ce plan (A)
  1219. * On prend soin d'orienter les triangles T1A et T2A dans le sens
  1220. * direct (en tenant compte du signe de la composante normale !)
  1221. GOTO (531,532,533), inC
  1222. call erreur(5)
  1223. return
  1224. * Normale NC selon "x" : A =(y,z)
  1225. 531 if (xnC.lt.0.) inC = -inC
  1226. inX = 2
  1227. inY = 3
  1228. goto 534
  1229. * Normale NC selon "y" : A =(x,z)
  1230. 532 if (ynC.lt.0.) inC = -inC
  1231. inX = 1
  1232. inY = 3
  1233. goto 534
  1234. * Normale NC selon "z" : A =(x,y)
  1235. 533 if (znC.lt.0.) inC = -inC
  1236. inX = 1
  1237. inY = 2
  1238. goto 534
  1239. 534 continue
  1240. cPT1A(1,1) = cPT1C(1,inX)
  1241. cPT1A(1,2) = cPT1C(1,inY)
  1242. cPT2A(1,1) = cPT2C(1,inX)
  1243. cPT2A(1,2) = cPT2C(1,inY)
  1244. if (inC.gt.0) then
  1245. cPT1A(2,1) = cPT1C(2,inX)
  1246. cPT1A(2,2) = cPT1C(2,inY)
  1247. cPT2A(2,1) = cPT2C(2,inX)
  1248. cPT2A(2,2) = cPT2C(2,inY)
  1249. cPT1A(3,1) = cPT1C(3,inX)
  1250. cPT1A(3,2) = cPT1C(3,inY)
  1251. cPT2A(3,1) = cPT2C(3,inX)
  1252. cPT2A(3,2) = cPT2C(3,inY)
  1253. else
  1254. cPT1A(2,1) = cPT1C(3,inX)
  1255. cPT1A(2,2) = cPT1C(3,inY)
  1256. cPT2A(2,1) = cPT2C(3,inX)
  1257. cPT2A(2,2) = cPT2C(3,inY)
  1258. cPT1A(3,1) = cPT1C(2,inX)
  1259. cPT1A(3,2) = cPT1C(2,inY)
  1260. cPT2A(3,1) = cPT2C(2,inX)
  1261. cPT2A(3,2) = cPT2C(2,inY)
  1262. endif
  1263. cPT1A(4,1) = cPT1A(1,1)
  1264. cPT1A(4,2) = cPT1A(1,2)
  1265. * Calcul des cotes des triangles T1A et T2A (12,23,31)
  1266. * Utile pour connaitre ensuite la normale aux cotes des triangles
  1267. vT1A(1,1) = cPT1A(2,1) - cPT1A(1,1)
  1268. vT1A(1,2) = cPT1A(2,2) - cPT1A(1,2)
  1269. vT1A(2,1) = cPT1A(3,1) - cPT1A(2,1)
  1270. vT1A(2,2) = cPT1A(3,2) - cPT1A(2,2)
  1271. vT1A(3,1) = cPT1A(1,1) - cPT1A(3,1)
  1272. vT1A(3,2) = cPT1A(1,2) - cPT1A(3,2)
  1273. C*nu vT2A(1,1) = cPT2A(2,1) - cPT2A(1,1)
  1274. vT2A(1,2) = cPT2A(2,2) - cPT2A(1,2)
  1275. C*nu vT2A(2,1) = cPT2A(3,1) - cPT2A(2,1)
  1276. vT2A(2,2) = cPT2A(3,2) - cPT2A(2,2)
  1277. C*nu vT2A(3,1) = cPT2A(1,1) - cPT2A(3,1)
  1278. vT2A(3,2) = cPT2A(1,2) - cPT2A(3,2)
  1279. * Calcul de la surface de chacun des triangles T1A et T2A
  1280. * (en fait, on calcule le double, mais par la suite on ne considere que
  1281. * des rapports de surfaces de triangle)
  1282. SuT1A = (cPT1A(2,1)+cPT1A(1,1)) * vT1A(1,2)
  1283. & + (cPT1A(3,1)+cPT1A(2,1)) * vT1A(2,2)
  1284. & + (cPT1A(1,1)+cPT1A(3,1)) * vT1A(3,2)
  1285. SuT2A = (cPT2A(2,1)+cPT2A(1,1)) * vT2A(1,2)
  1286. & + (cPT2A(3,1)+cPT2A(2,1)) * vT2A(2,2)
  1287. & + (cPT2A(1,1)+cPT2A(3,1)) * vT2A(3,2)
  1288. C*DBG write(ioimp,*) 'Surfaces T1A - T2A :', 0.5*SuT1A,0.5*SuT2A
  1289. C*DBG if (SuT1A.gt.100.*SuT2A .or. SuT2A.gt.100.*SuT1A)
  1290. C*DBG & write(ioimp,*) 'Rapport des surfaces tres important !'
  1291.  
  1292. * On initialise l'intersection des triangles avec T2A
  1293. nPIn0 = 3
  1294. do 540 i = 1, nPIn0
  1295. cPIn0(i,1) = cPT2A(i,1)
  1296. cPIn0(i,2) = cPT2A(i,2)
  1297. 540 continue
  1298. * Determination de l'intersection des triangles T1A et T2A
  1299. * en regardant progressivement l'intersection avec les cotes de T1A
  1300. * Note : On utilise le fait que les polygones traites sont convexes !
  1301. DO 550 i = 1, 3
  1302. vN1x = -vT1A(i,2)
  1303. vN1y = vT1A(i,1)
  1304. scal = vN1x * cPT1A(i,1) + vN1y * cPT1A(i,2)
  1305. *
  1306. ipos = 0
  1307. ineg = 0
  1308. jpos = 0
  1309. jneg = 0
  1310. do 551 j = 1, nPIn0
  1311. test(j) = (vN1x * cPIn0(j,1) + vN1y * cPIn0(j,2)) - scal
  1312. if (test(j).gt.1.d-10) then
  1313. * if (test(j).gt.0.) then
  1314. ipos = ipos + 1
  1315. if (jneg.ne.0 .and. jpos.eq.0) jpos = j
  1316. else if (test(j).lt.-1.d-10) then
  1317. * else if (test(j).lt.0.) then
  1318. ineg = ineg + 1
  1319. if (jneg.eq.0) jneg = j
  1320. else
  1321. test(j) = 0.
  1322. endif
  1323. 551 continue
  1324. *
  1325. * 1) Cas ou ipos = 0 :
  1326. * 1.1) il n'y pas d'intersection (ineg=nPIn0)
  1327. * 1.2) l'intersection se limite a 1 point (ineg=nPIn0-1)
  1328. * 1.3) l'intersection a 1 segment sur une frontiere (ineg=nPIn0-2)
  1329. * La surface correspondante est nulle et il n'y a donc pas de contact !
  1330. if (ipos.eq.0) then
  1331. C*DBG write(ioimp,*) 'Intersection a ',nPIn0-ineg,' points'
  1332. goto 520
  1333. endif
  1334. * 2) Cas ou ipos > 0 : Il y a une intersection a calculer
  1335. * 2.1) ineg = 0 : Tous les points sont "du bon cote" et l'intersection
  1336. * correspond au polygone de depart !
  1337. if (ineg.eq.0) then
  1338. C*DBG write(ioimp,*) 'Intersection du bon cote - rien a faire'
  1339. goto 550
  1340. endif
  1341. * 2.2) ineg > 0 : Il y a deux intersections a determiner car il y a
  1342. * au moins un point du "mauvais cote"
  1343. jpos = max(1,jpos)
  1344. jpr = jpos - 1
  1345. if (jpos.eq.1) jpr = nPIn0
  1346. nPIn = 1
  1347. if (test(jpr).lt.0.) then
  1348. r_z = test(jpos) / (test(jpos) - test(jpr))
  1349. cPIn(nPIn,1) = cPIn0(jpos,1)
  1350. & + r_z*(cPIn0(jpr,1) - cPIn0(jpos,1))
  1351. cPIn(nPIn,2) = cPIn0(jpos,2)
  1352. & + r_z*(cPIn0(jpr,2) - cPIn0(jpos,2))
  1353. else
  1354. cPIn(nPIn,1) = cPIn0(jpr,1)
  1355. cPIn(nPIn,2) = cPIn0(jpr,2)
  1356. endif
  1357. do 552 j = 1, ipos
  1358. nPIn = nPIn + 1
  1359. cPIn(nPIn,1) = cPIn0(jpos,1)
  1360. cPIn(nPIn,2) = cPIn0(jpos,2)
  1361. jpr = jpos
  1362. jpos = jpos + 1
  1363. if (jpos.gt.nPIn0) jpos = 1
  1364. 552 continue
  1365. nPIn = nPIn + 1
  1366. if (test(jpos).lt.0.) then
  1367. r_z = test(jpr) / (test(jpr) - test(jpos))
  1368. cPIn(nPIn,1) = cPIn0(jpr,1)
  1369. & + r_z*(cPIn0(jpos,1) - cPIn0(jpr,1))
  1370. cPIn(nPIn,2) = cPIn0(jpr,2)
  1371. & + r_z*(cPIn0(jpos,2) - cPIn0(jpr,2))
  1372. else
  1373. cPIn(nPIn,1) = cPIn0(jpos,1)
  1374. cPIn(nPIn,2) = cPIn0(jpos,2)
  1375. endif
  1376. * Mise a jour cPIn0 pour la suite du traitement des intersections...
  1377. nPIn0 = nPIn
  1378. do 554 j = 1, nPIn0
  1379. cPIn0(j,1) = cPIn(j,1)
  1380. cPIn0(j,2) = cPIn(j,2)
  1381. 554 continue
  1382. C*DBG-F write(ioimp,*) 'Intersection ',i,' a ',nPIn0,' points'
  1383. C*DBG-F do j = 1, nPIn0
  1384. C*DBG-F write(ioimp,*) ' ',j,nbpts0+6+j,cPIn0(j,1),cPIn0(j,2)
  1385. C*DBG-F enddo
  1386. *
  1387. 550 CONTINUE
  1388. *
  1389. * Calcul de la surface de l'intersection et de son centre de gravite
  1390. r_z = cPIn0(nPIn0,1)*cPIn0(1,2) - cPIn0(1,1)*cPIn0(nPIn0,2)
  1391. SuPIn = r_z
  1392. xGIn = (cPIn0(nPIn0,1)+cPIn0(1,1)) * r_z
  1393. yGIn = (cPIn0(nPIn0,2)+cPIn0(1,2)) * r_z
  1394. do 560 i = 1, nPIn0-1
  1395. j = i + 1
  1396. r_z = cPIn0(i,1)*cPIn0(j,2) - cPIn0(j,1)*cPIn0(i,2)
  1397. SuPIn = SuPIn + r_z
  1398. xGIn = xGIn + (cPIn0(i,1)+cPIn0(j,1)) * r_z
  1399. yGIn = yGIn + (cPIn0(i,2)+cPIn0(j,2)) * r_z
  1400. 560 continue
  1401. if (SuPIn .lt. 1.E-7*max(SuT1A,SuT2A) ) then
  1402. C*DBG write(ioimp,*) 'Intersection a une surface negligeable !'
  1403. goto 520
  1404. endif
  1405. r_z = X1s3 / SupIn
  1406. SuPIn = 0.5 * SupIn
  1407. xGIn = xGIn * r_z
  1408. yGIn = yGIn * r_z
  1409. C*DBG write(ioimp,*) 'Surface Intersection :',SuPIn
  1410. *
  1411. * Calcul des coordonnees barycentriques du centre de gravite
  1412. * pour le triangle T1A
  1413. xpip1 = xGIn - cPT1A(1,1)
  1414. ypip1 = yGIn - cPT1A(1,2)
  1415. xpip2 = xGIn - cPT1A(2,1)
  1416. ypip2 = yGIn - cPT1A(2,2)
  1417. xpip3 = xGIn - cPT1A(3,1)
  1418. ypip3 = yGIn - cPT1A(3,2)
  1419. b1T1 = xpip2 * ypip3 - ypip2 * xpip3
  1420. b2T1 = xpip3 * ypip1 - ypip3 * xpip1
  1421. b3T1 = xpip1 * ypip2 - ypip1 * xpip2
  1422. bt = b1T1 + b2T1 + b3T1
  1423. if (abs(bt-SuT1A) .gt. 1.E-3)
  1424. & write(ioimp,*) 'Prob bt-SuT1A',bt,SuT1A
  1425. b1T1 = b1T1 / SuT1A
  1426. b2T1 = b2T1 / SuT1A
  1427. b3T1 = b3T1 / SuT1A
  1428. *
  1429. * pour le triangle T2A
  1430. xpip1 = xGIn - cPT2A(1,1)
  1431. ypip1 = yGIn - cPT2A(1,2)
  1432. xpip2 = xGIn - cPT2A(2,1)
  1433. ypip2 = yGIn - cPT2A(2,2)
  1434. xpip3 = xGIn - cPT2A(3,1)
  1435. ypip3 = yGIn - cPT2A(3,2)
  1436. b1T2 = xpip2 * ypip3 - ypip2 * xpip3
  1437. b2T2 = xpip3 * ypip1 - ypip3 * xpip1
  1438. b3T2 = xpip1 * ypip2 - ypip1 * xpip2
  1439. bt = b1T2 + b2T2 + b3T2
  1440. if (abs(bt-SuT2A) .gt. 1.E-3)
  1441. & write(ioimp,*) 'Prob bt-SuT2A',bt,SuT2A
  1442. b1T2 = b1T2 / SuT2A
  1443. b2T2 = b2T2 / SuT2A
  1444. b3T2 = b3T2 / SuT2A
  1445. *
  1446. * Calcul du jeu
  1447. xjeu = (b1T2*dq1C + b2T2*dq2C + b3T2*dq3C)
  1448. & - (b1T1*dp1C + b2T1*dp2C + b3T1*dp3C)
  1449. C*DBG write(ioimp,*) 'Jeu =',xjeu
  1450. *
  1451. * Ajout d'une relation triangle-triangle
  1452. *
  1453. nelri0 = nelri0 + 1
  1454. nelch = nelch + 1
  1455. *
  1456. * on ajuste les differents segments si necesaire
  1457. *
  1458. if (nelri0.gt.nelrig) then
  1459. nelrig = nelrig + incnel
  1460. segadj,xmatri
  1461. nbelem = nbelem + incnel
  1462. nbnn = 7
  1463. segadj,meleme
  1464. nbnn = 1
  1465. segadj,ipt7
  1466. n = n + incnel
  1467. segadj,mpoval
  1468. endif
  1469. *
  1470. * Choix du mult de Lagrange qui porte la condition
  1471. * -> l'element le plus grand
  1472. imult=ipt1.num(1,iel8)
  1473. ielt=iel8
  1474. if (RayT1.lt.RayT2) then
  1475. imult=ipt1.num(1,nbel8+iel6)
  1476. ielt=nbel8+iel6
  1477. endif
  1478. *
  1479. num(1,nelri0) = imult
  1480. num(2,nelri0) = ip1
  1481. num(3,nelri0) = ip2
  1482. num(4,nelri0) = ip3
  1483. num(5,nelri0) = jp1
  1484. num(6,nelri0) = jp2
  1485. num(7,nelri0) = jp3
  1486. icolor(nelri0) = 1
  1487. *
  1488. * Mise a jour de xmatri
  1489. *
  1490. * lambda
  1491. re( 1,1,nelri0) = 0.d0
  1492. * ip1
  1493. re( 2,1,nelri0) = xnC * b1T1 * SuPIn
  1494. re( 3,1,nelri0) = ynC * b1T1 * SuPIn
  1495. re( 4,1,nelri0) = znC * b1T1 * SuPIn
  1496. * ip2
  1497. re( 5,1,nelri0) = xnC * b2T1 * SuPIn
  1498. re( 6,1,nelri0) = ynC * b2T1 * SuPin
  1499. re( 7,1,nelri0) = znC * b2T1 * SuPIn
  1500. * ip3
  1501. re( 8,1,nelri0) = xnC * b3T1 * SuPIn
  1502. re( 9,1,nelri0) = ynC * b3T1 * SuPIn
  1503. re(10,1,nelri0) = znC * b3T1 * SuPIn
  1504. * jp1
  1505. re(11,1,nelri0) = -xnC * b1T2 * SuPIn
  1506. re(12,1,nelri0) = -ynC * b1T2 * SuPIn
  1507. re(13,1,nelri0) = -znC * b1T2 * SuPIn
  1508. * jp2
  1509. re(14,1,nelri0) = -xnC * b2T2 * SuPIn
  1510. re(15,1,nelri0) = -ynC * b2T2 * SuPIn
  1511. re(16,1,nelri0) = -znC * b2T2 * SuPIn
  1512. * jp3
  1513. re(17,1,nelri0) = -xnC * b3T2 * SuPIn
  1514. re(18,1,nelri0) = -ynC * b3T2 * SuPIn
  1515. re(19,1,nelri0) = -znC * b3T2 * SuPIn
  1516. * on transpose
  1517. do 580 ic = 2, nligrp
  1518. re(1,ic,nelri0) = re(ic,1,nelri0)
  1519. 580 continue
  1520. * le reste est nul
  1521. *
  1522. * remplissage du champoint de depi (jeu)
  1523. *
  1524. ipt7.num(1,nelch) = imult
  1525. vpocha(nelch,1) = (xjeu - xjr) * SuPIn
  1526. vpocha(nelch,2) = SuPIn
  1527. IF (MELVA2.NE.0) THEN
  1528. NEL2 = min (ielt,NELA)
  1529. VPOCHA(nelch,3) = max(MELVA2.VELCHE(NPTELA,NEL2),0.D0)*SuPIn
  1530. ENDIF
  1531. C*DBG-F call prfaible(ipt1,iel,nPIn0,mfaible)
  1532. *
  1533. 520 CONTINUE
  1534. 519 CONTINUE
  1535. *
  1536. * Ajustement au plus juste puis desactivation des segments lies
  1537. * a la rigidite du type 0
  1538. if (nelri0.ne.nelrig) then
  1539. nelrig = nelri0
  1540. segadj,xmatri
  1541. nbelem = nelri0
  1542. nbnn = 7
  1543. segadj,meleme
  1544. endif
  1545. segdes,xmatri
  1546. *
  1547. ** write(ioimp,*) ' nb relation type 0 ',nelri0
  1548. * if (nelri0.eq.0) irigel(6,nrigel)=0
  1549. *
  1550. * Destruction des segments locaux devenus inutiles
  1551. segsup,mfaible
  1552. *
  1553. C* GOTO 1000
  1554.  
  1555. *=======================================================================
  1556. *= Fin du sous-programme :
  1557. *=======================================================================
  1558. 1000 CONTINUE
  1559. *
  1560. * Ajustement au plus juste du chpoint de depi (jeu) : mpoval et ipt7
  1561. * puis desactivation du chpoint
  1562. if (vpocha(/1).ne.nelch) then
  1563. n = nelch
  1564. nc=vpocha(/2)
  1565. segadj,mpoval
  1566. nbnn = 1
  1567. nbelem = nelch
  1568. nbsous = 0
  1569. nbref = 0
  1570. segadj,ipt7
  1571. ** write(6,*) ' ipt7 dans impo32 '
  1572. endif
  1573. * Desctivation de la matrice de raideur de contact
  1574. segdes,mrigid
  1575. *
  1576. * Reunion des relations portant sur le meme multiplicateur de lagrange
  1577. *
  1578. call impofu(MRIGID,MCHPOI)
  1579. * write(6,*) ' apres impofu dans impo32 '
  1580. * call ecchpo(mchpoi,1)
  1581. * call prrigi(mrigid,1)
  1582.  
  1583.  
  1584. *
  1585. * Nettoyage eventuel des termes petits dans les relations
  1586. *
  1587. * A voir plus tard. Frig3c suppose que la relation est complete.
  1588. *
  1589. ** call relasi(mrigid)
  1590. *
  1591. 900 CONTINUE
  1592. end
  1593.  
  1594.  
  1595.  
  1596.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales