Télécharger impo32.eso

Retour à la liste

Numérotation des lignes :

impo32
  1. C IMPO32 SOURCE PV090527 26/04/30 21:15:40 12529
  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. RIGREL=0
  391. segini,xmatri
  392. irigel(4,nrigel) = xmatri
  393. *
  394. * ce qu'on cree est unilateral
  395. *
  396. irigel(6,nrigel)=1
  397. *
  398. * ce qu'on cree est symetrique
  399. *
  400. irigel(7,nrigel)=0
  401. *
  402. * Nombre d'elements dans la rigidite du type 3
  403. nelri3 = 0
  404. *
  405. * Preparation du zonage de ipt1
  406. *
  407. nbzx=(xmax-xmin)/tamax
  408. nbzy=(ymax-ymin)/tamax
  409. nbzz=(zmax-zmin)/tamax
  410. *
  411. * preconditionnement de ipt1: mfopa4
  412. *
  413. segini mfopa4
  414. xmult=3.1415926*(xmax-xmin)
  415. ymult=2.7182818*(ymax-ymin)
  416. zmult=1.*(zmax-zmin)
  417. tmult=sqrt(xmult**2+ymult**2+zmult**2)
  418. xmult=xmult/tmult
  419. ymult=ymult/tmult
  420. zmult=zmult/tmult
  421. tmin=xgrand
  422. tmax=-xgrand
  423. do j=1,nbel1
  424. ip=ipt1.num(2,j)
  425. ipv = (ip-1)*idimp1
  426. xp = xcoor(ipv+1)
  427. yp = xcoor(ipv+2)
  428. zp = xcoor(ipv+3)
  429. tco(j)=xp*xmult+yp*ymult+zp*zmult
  430. tmin=min(tco(j),tmin)
  431. tmax=max(tco(j),tmax)
  432. ipnum(j)=ip
  433. ico(j)=j
  434. enddo
  435. nbzt=(tmax-tmin)/tamax
  436. nbzt=max(nbzt,1)
  437. nbzt=min(nbel1,nbzt)
  438. ** write(6,*) ' nbzt ',nbzt
  439.  
  440. *
  441. * trier selon x
  442. *
  443. call triflo(tco,xw,ico,iw,nbel1)
  444. *
  445. * indexer
  446. *
  447. indt=nbzt+1
  448. segini mfopa5
  449. do i=nbel1,1,-1
  450. id=nbzt*(tco(i)-tmin)/(tmax-tmin)+1
  451. ind(id)=i
  452. enddo
  453. do i=1,nbzt
  454. if (ind(i+1).eq.0) ind(i+1)=ind(i)
  455. if(ind(i+1).lt.ind(i)) call erreur(5)
  456. enddo
  457.  
  458.  
  459. * Boucle sur le maillage support du contact(frottement)
  460. *
  461. ** write(6,*) ' boucle 19 nbel6 ',nbel6
  462. DO 19 iel6=1,nbel6
  463. *
  464. xjr = 0d0
  465. ip1=ipt6.num(1,iel6)
  466. ip2=ipt6.num(2,iel6)
  467. ip3=ipt6.num(3,iel6)
  468. * Recuperation des coordonees des noeuds du triangle
  469. ipv = (ip1-1)*idimp1
  470. xp1 = xcoor(ipv+1)
  471. yp1 = xcoor(ipv+2)
  472. zp1 = xcoor(ipv+3)
  473. ipv = (ip2-1)*idimp1
  474. xp2 = xcoor(ipv+1)
  475. yp2 = xcoor(ipv+2)
  476. zp2 = xcoor(ipv+3)
  477. ipv = (ip3-1)*idimp1
  478. xp3 = xcoor(ipv+1)
  479. yp3 = xcoor(ipv+2)
  480. zp3 = xcoor(ipv+3)
  481. * Centre de gravite du triangle
  482. xg = (xp1+xp2+xp3) /3.d0
  483. yg = (yp1+yp2+yp3) /3.d0
  484. zg = (zp1+zp2+zp3) /3.d0
  485. * critere de distance
  486. d1 = (xg-xp1)**2 + (yg-yp1)**2 + (zg-zp1)**2
  487. d2 = (xg-xp2)**2 + (yg-yp2)**2 + (zg-zp2)**2
  488. d3 = (xg-xp3)**2 + (yg-yp3)**2 + (zg-zp3)**2
  489. * Triangle un peu plus grand pour les tests
  490. ** scale=1.00 + xszpre
  491. scale=1.00 + 1D-4
  492. dist2 = max(d1,d2,d3)
  493. dist = sqrt(dist2)*scale
  494. sqdist4 = dist * 4
  495. xp1e=xg+(xp1-xg)*scale
  496. yp1e=yg+(yp1-yg)*scale
  497. zp1e=zg+(zp1-zg)*scale
  498. xp2e=xg+(xp2-xg)*scale
  499. yp2e=yg+(yp2-yg)*scale
  500. zp2e=zg+(zp2-zg)*scale
  501. xp3e=xg+(xp3-xg)*scale
  502. yp3e=yg+(yp3-yg)*scale
  503. zp3e=zg+(zp3-zg)*scale
  504. 25 continue
  505. * rechercher le noeud a tester dans le deuxieme maillage qui est sous forme mult avec en
  506. * deuxieme position le point physique
  507. ** write(6,*) ' boucle 20 ipt1 ',ipt1.num(/2)
  508. xgm = xg -sqdist4
  509. xgp = xg +sqdist4
  510. ygm = yg -sqdist4
  511. ygp = yg +sqdist4
  512. zgm = zg -sqdist4
  513. zgp = zg +sqdist4
  514. *
  515. * calcul zone du centre de gravite
  516. *
  517. tc=xg*xmult+yg*ymult+zg*zmult
  518. *
  519. xmn = (xms(ip1)+xms(ip2)+xms(ip3))*X1s3
  520. ymn = (yms(ip1)+yms(ip2)+yms(ip3))*X1s3
  521. zmn = (zms(ip1)+zms(ip2)+zms(ip3))*X1s3
  522. xzonag = sqdist4*sqr3
  523. tjeup=0.d0
  524. tjeum=0.d0
  525.  
  526. if (MELVA1.ne.0) then
  527. * xmult ymult et zmult doivent etre positifs
  528. tjeum=xmult*(xjmin*xmn)+ymult*(xjmin*ymn)+zmult*(xjmin*zmn)
  529. tjeup=xmult*(xjmax*xmn)+ymult*(xjmax*ymn)+zmult*(xjmax*zmn)
  530. endif
  531. *
  532. izg=nbzt*((tc-xzonag-tjeum)-tmin)/(tmax-tmin)+1
  533. izg=max(izg,1)
  534. izg=min(izg,indt)
  535. * debut de zone
  536. indb=ind(izg)
  537. do 20 iz=indb,nbel1
  538. if(tco(iz).lt.(tc-tjeum-xzonag)) goto 20
  539. if(tco(iz).gt.(tc-tjeup+xzonag)) then
  540. ** write(6,*) ' sortie pour ',iz, ' en ',iz-indb+1
  541. goto 18
  542. endif
  543. iel1 = ico(iz)
  544. jp = ipnum(iel1)
  545. * Verification que pas relation du point sur lui meme
  546. if (jp.eq.ip1) goto 20
  547. if (jp.eq.ip2) goto 20
  548. if (jp.eq.ip3) goto 20
  549. * verification rapide en norme L1 d'abord
  550. ipv = (jp-1)*idimp1
  551. xp = xcoor(ipv+1)
  552. yp = xcoor(ipv+2)
  553. zp = xcoor(ipv+3)
  554. *
  555. xpp=xp
  556. ypp=yp
  557. zpp=zp
  558. if (MELVA1.ne.0) then
  559. nel1 = min (iel1,nelj)
  560. xjr = melva1.velche(nptelj,nel1)
  561. xpp=xpp-xjr*xmn
  562. ypp=ypp-xjr*ymn
  563. zpp=zpp-xjr*zmn
  564. endif
  565. if(xpp.lt.xgm.or.xpp.gt.xgp) goto 20
  566. if(ypp.lt.ygm.or.ypp.gt.ygp) goto 20
  567. if(zpp.lt.zgm.or.zpp.gt.zgp) goto 20
  568. *
  569. * Verification si autre point dans la zone de selection
  570. * verif distance au centre de gravite
  571. dp = ((xg-xpp)**2 + (yg-ypp)**2 + (zg-zpp)**2)
  572. ** write(6,*) 'dp dist2',dp,dist2,xjr
  573. *** if (dp.gt.xzonag**2) then
  574. *** goto 20
  575. *** endif
  576. C*DBG write(ioimp,*) 'contact test distance ok',dp,d1,d2,d3
  577.  
  578. * verif position par rapport aux cotes
  579.  
  580. * cote 1 2
  581. x12 = xp2 - xp1
  582. y12 = yp2 - yp1
  583. z12 = zp2 - zp1
  584. sv = sqrt(x12**2+y12**2+z12**2)
  585. xv=x12/sv
  586. yv=y12/sv
  587. zv=z12/sv
  588. * normale locale (1 et 2)
  589. xnl=xms(ip1)+xms(ip2)
  590. ynl=yms(ip1)+yms(ip2)
  591. znl=zms(ip1)+zms(ip2)
  592.  
  593. * vecteur reference
  594. xn=y12*znl-z12*ynl
  595. yn=z12*xnl-x12*znl
  596. zn=x12*ynl-y12*xnl
  597. dn = sqrt(xn*xn+yn*yn+zn*zn)
  598. scal = (xpp-xp1e)*xv + (ypp-yp1e)*yv + (zpp-zp1e)*zv
  599. xm = xp1e + scal*xv
  600. ym = yp1e + scal*yv
  601. zm = zp1e + scal*zv
  602. dpm = sqrt(abs((xpp-xm)**2+(ypp-ym)**2+(zpp-zm)**2))
  603. scal = (xpp-xm)*xn + (ypp-ym)*yn + (zpp-zm)*zn
  604. ** if (dpm.lt.dist*xszpre) write(6,*) ' pt sur 1 2',dpm
  605. if (dpm.gt.dist*xszpre.and.scal.gt.0.707d0*dn*dpm) then
  606. * write(6,*) ' 1 dpm scal ',dpm,scal
  607. goto 20
  608. endif
  609. dpm=max(xpetit,dpm)
  610. * write(ioimp,*) 'contact test position 1 ok',
  611. * & scal/(dn*dpm),scal,dn,dpm
  612. *
  613. * cote 2 3
  614. x23 = xp3 - xp2
  615. y23 = yp3 - yp2
  616. z23 = zp3 - zp2
  617. sv = sqrt(x23**2+y23**2+z23**2)
  618. xv=x23/sv
  619. yv=y23/sv
  620. zv=z23/sv
  621. * normale locale (2 et 3)
  622. xnl=xms(ip2)+xms(ip3)
  623. ynl=yms(ip2)+yms(ip3)
  624. znl=zms(ip2)+zms(ip3)
  625.  
  626. * vecteur reference
  627. xn=y23*znl-z23*ynl
  628. yn=z23*xnl-x23*znl
  629. zn=x23*ynl-y23*xnl
  630. dn = sqrt(xn*xn+yn*yn+zn*zn)
  631. scal = (xpp-xp2e)*xv + (ypp-yp2e)*yv + (zpp-zp2e)*zv
  632. xm = xp2e + scal*xv
  633. ym = yp2e + scal*yv
  634. zm = zp2e + scal*zv
  635. dpm = sqrt(abs((xpp-xm)**2+(ypp-ym)**2+(zpp-zm)**2))
  636. scal = (xpp-xm)*xn + (ypp-ym)*yn + (zpp-zm)*zn
  637. ** if (dpm.lt.dist*xszpre) write(6,*) ' pt sur 2 3',dpm
  638. if (dpm.gt.dist*xszpre.and.scal.gt.0.707d0*dn*dpm) then
  639. * write(6,*) ' 2 dpm scal ',dpm,scal
  640. goto 20
  641. endif
  642. dpm=max(xpetit,dpm)
  643. * write(ioimp,*) 'contact test position 2 ok',
  644. * & scal/(dn*dpm),scal,dn,dpm
  645. *
  646. * cote 3 1
  647. x31 = xp1 - xp3
  648. y31 = yp1 - yp3
  649. z31 = zp1 - zp3
  650. sv = sqrt(x31**2+y31**2+z31**2)
  651. xv=x31/sv
  652. yv=y31/sv
  653. zv=z31/sv
  654. * normale locale (3 et 1)
  655. xnl=xms(ip3)+xms(ip1)
  656. ynl=yms(ip3)+yms(ip1)
  657. znl=zms(ip3)+zms(ip1)
  658. * vecteur reference
  659. xn=y31*znl-z31*ynl
  660. yn=z31*xnl-x31*znl
  661. zn=x31*ynl-y31*xnl
  662. dn = sqrt(xn*xn+yn*yn+zn*zn)
  663. scal = (xpp-xp3e)*xv + (ypp-yp3e)*yv + (zpp-zp3e)*zv
  664. xm = xp3e + scal*xv
  665. ym = yp3e + scal*yv
  666. zm = zp3e + scal*zv
  667. dpm = sqrt(abs((xpp-xm)**2+(ypp-ym)**2+(zpp-zm)**2))
  668. scal = (xpp-xm)*xn + (ypp-ym)*yn + (zpp-zm)*zn
  669. ** if (dpm.lt.dist*xszpre) write(6,*) ' pt sur 3 1',dpm
  670. if (dpm.gt.dist*xszpre.and.scal.gt.0.707d0*dn*dpm) then
  671. * write(6,*) ' 3 dpm scal ',dpm,scal
  672. goto 20
  673. endif
  674. dpm=max(xpetit,dpm)
  675. * write(ioimp,*) 'contact test position 2 ok',
  676. * & scal/(dn*dpm),scal,dn,dpm
  677. *
  678. * on a un point ou imposer la relation
  679. C*DBG write(ioimp,*) 'contact potentiel '
  680. * Quelle est la relation ???
  681. *
  682. * direction de la relation = normale au plan (123)
  683. *
  684. * normale reelle
  685. xnr = y12*z23 - z12*y23
  686. ynr = z12*x23 - x12*z23
  687. znr = x12*y23 - y12*x23
  688. dnr = sqrt(xnr*xnr+ynr*ynr+znr*znr)
  689. if (dnr.lt.dist*xszpre.AND.iimpi.ne.0) write(ioimp,*) ' pb dnr'
  690. xnr = xnr / dnr
  691. ynr = ynr / dnr
  692. znr = znr / dnr
  693. * normale ponderee
  694. xn=xms(ip1)+xms(ip2)+xms(ip3)
  695. yn=yms(ip1)+yms(ip2)+yms(ip3)
  696. zn=zms(ip1)+zms(ip2)+zms(ip3)
  697. dn = sqrt(xn*xn+yn*yn+zn*zn)
  698. if (.not.(dn.lt.1d-10).and. .not.(dn.gt.1d-10).AND.iimpi.ne.0)
  699. & write(ioimp,*) 'Prob 4.1 - impo32'
  700. if (abs(dn).le.xpetit.AND.iimpi.ne.0)
  701. & write(ioimp,*) 'Prob 4.2 - impo32'
  702. xn = xn / dn
  703. yn = yn / dn
  704. zn = zn / dn
  705. *
  706. * Distance (jeu) du point jp au plan de contact
  707. * Puis calcul de la projection sur le plan de contact
  708. *
  709. ** write(6,*) 'ip1 xms ',ip1,xms(ip1),yms(ip1),zms(ip1)
  710. ** write(6,*) 'ip2 xms ',ip2,xms(ip2),yms(ip2),zms(ip2)
  711. ** write(6,*) 'ip3 xms ',ip3,xms(ip3),yms(ip3),zms(ip3)
  712. ** write(6,*) 'xn ',xn,yn,zn
  713. iter = 0
  714. xjeu = (xp-xg)*xnr + (yp-yg)*ynr + (zp-zg)*znr
  715. 21 continue
  716. angn = xn * xnr + yn*ynr + zn*znr
  717. if (angn.le.xpetit.AND.iimpi.ne.0)
  718. & write(ioimp,*) 'angn negatif ',angn
  719. if(angn.le.xpetit) goto 20
  720. xjeuv = xjeu / angn
  721. *
  722. * Recherche de ses coordonnées barycentriques
  723. * qui sont les surfaces des sous triangles
  724. *
  725. xq = xp - xjeuv*xn
  726. yq = yp - xjeuv*yn
  727. zq = zp - xjeuv*zn
  728. xb1 = (yq-yp2)*(zq-zp3)-(zq-zp2)*(yq-yp3)
  729. yb1 = (zq-zp2)*(xq-xp3)-(xq-xp2)*(zq-zp3)
  730. zb1 = (xq-xp2)*(yq-yp3)-(yq-yp2)*(xq-xp3)
  731. xb2 = (yq-yp3)*(zq-zp1)-(zq-zp3)*(yq-yp1)
  732. yb2 = (zq-zp3)*(xq-xp1)-(xq-xp3)*(zq-zp1)
  733. zb2 = (xq-xp3)*(yq-yp1)-(yq-yp3)*(xq-xp1)
  734. xb3 = (yq-yp1)*(zq-zp2)-(zq-zp1)*(yq-yp2)
  735. yb3 = (zq-zp1)*(xq-xp2)-(xq-xp1)*(zq-zp2)
  736. zb3 = (xq-xp1)*(yq-yp2)-(yq-yp1)*(xq-xp2)
  737. b1 = xb1*xnr + yb1*ynr + zb1*znr
  738. b2 = xb2*xnr + yb2*ynr + zb2*znr
  739. b3 = xb3*xnr + yb3*ynr + zb3*znr
  740. bt = b1 + b2 + b3
  741. * normalement pas utile
  742. * element retourne a cause des grands deplacements
  743. if (bt.lt.xpetit) then
  744. write (ioimp,*) ' bt negatif dans impo32 '
  745. call soucis(719)
  746. ** bt=xpetit*2.d0
  747. goto 20
  748. endif
  749. if (bt.lt.0.d0.AND.iimpi.ne.0) then
  750. write (ioimp,*) ' bt negatif dans impo32 '
  751. print *,'xp1 yp1 zp1',xp1,yp1,zp1
  752. print *,'xp2 yp2 zp2',xp2,yp2,zp2
  753. print *,'xp3 yp3 zp3',xp3,yp3,zp3
  754. print *,'xp yp zp',xp,yp,zp
  755. print *,'xn yn zn',xn,yn,zn
  756. print *,'b1 b2 b3 bt',b1,b2,b3,bt
  757. * goto 20
  758. endif
  759. bsurf = bt / 2
  760. if (.not.(bt.lt.1d-10) .and. .not.(bt.gt.1d-10).AND.iimpi.ne.0)
  761. & write(ioimp,*) 'Prob 5.1 - impo32'
  762. if (abs(bt).le.xpetit) write(ioimp,*) 'Prob 5.2 - impo32'
  763. b1 = b1 / bt
  764. b2 = b2 / bt
  765. b3 = b3 / bt
  766. * recalcul de la direction et du jeu en fonction des normales aux sommets
  767. * on arete l'interpolation de la normale au bord de l'element
  768. bb1=max(b1,0.d0)
  769. bb2=max(b2,0.d0)
  770. bb3=max(b3,0.d0)
  771. bm = bb1 + bb2 + bb3
  772. bb1 = bb1 / bm
  773. bb2 = bb2 / bm
  774. bb3 = bb3 / bm
  775. xnp = xn
  776. ynp = yn
  777. znp = zn
  778. xn = bb1*xms(ip1)+ bb2*xms(ip2)+ bb3*xms(ip3)
  779. yn = bb1*yms(ip1)+ bb2*yms(ip2)+ bb3*yms(ip3)
  780. zn = bb1*zms(ip1)+ bb2*zms(ip2)+ bb3*zms(ip3)
  781. sn = sqrt (xn*xn + yn*yn + zn*zn)
  782. xn=xn/sn
  783. yn=yn/sn
  784. zn=zn/sn
  785. diff=abs(xn-xnp)+abs(yn-ynp)+abs(zn-znp)
  786. * write (6,*) ' iter b* *n ',iter,b1,b2,b3,xn,yn,zn
  787. * recalcul en fonction de la nouvelle normale
  788. iter=iter+1
  789. if (iter.gt.64) then
  790. ** write(6,*) ' impo32 diff ',diff
  791. goto 20
  792. endif
  793. if (diff.gt.1d-10) goto 21
  794. ** write(6,*) ' impo32 iter ',iter
  795. ** write (6,*) ' iter b* *n ',iter,b1,b2,b3,xn,yn,zn
  796.  
  797.  
  798. * si on a deja traverse, les trois coordonnees barycentriques doivent etre positives
  799. ** if (xjeuv-xjr.lt.-xszpre*dist) then
  800. ** if (b1.lt.-xszpre) goto 20
  801. ** if (b2.lt.-xszpre) goto 20
  802. ** if (b3.lt.-xszpre) goto 20
  803. ** endif
  804. * Si on est en dehors, on projette sur l'arete (ou pas)
  805. ** if (b1.lt.0.d0.or.b2.lt.0.d0.or.b3.lt.0.d0) then
  806. ** xq=xp1*bb1+xp2*bb2+xp3*bb3
  807. ** yq=yp1*bb1+yp2*bb2+yp3*bb3
  808. ** zq=zp1*bb1+zp2*bb2+zp3*bb3
  809. ** xnn=xp-xq
  810. ** ynn=yp-yq
  811. ** znn=zp-zq
  812. ** snn=sqrt(abs(xnn*xnn+ynn*ynn+znn*znn))
  813. ** if (snn.lt.xszpre*dist) write (6,*) ' snn petit ',snn
  814. * sinon on prend la direction reelle
  815. ** if (snn.gt.xszpre*dist) then
  816. ** xn=xnn/sn
  817. ** yn=ynn/sn
  818. ** zn=znn/sn
  819. ** endif
  820. ** endif
  821. xjeu1 = (xp-xp1)*xn + (yp-yp1)*yn + (zp-zp1)*zn
  822. xjeu2 = (xp-xp2)*xn + (yp-yp2)*yn + (zp-zp2)*zn
  823. xjeu3 = (xp-xp3)*xn + (yp-yp3)*yn + (zp-zp3)*zn
  824. *****pv xjeuv = xjeu1 * bb1 + xjeu2 * bb2 + xjeu3 * bb3
  825. ** write (6,*) 'b1 b2 b3',b1,b2,b3
  826. ** write (6,*) 'xjeu xjeuv ',xjeu,xjeuv,xjeu1,xjeu2,xjeu3
  827. xjeu = xjeuv - xjr
  828. ** write (6,*) ' normale ',xn,yn,zn,' jeu ',xjeu1,xjeu2,xjeu3
  829. * verif bon cote (a la tolerance pres)
  830. ** write (6,*) ' xjeu ',xjeu,dist,iel6
  831. ** if (xjeu.lt.-1*dist) goto 20
  832. ** if (xjeu.gt.3*dist) goto 20
  833. * verif compatibilite avec la normale au poin impactant
  834. if (xms(jp)*xn+yms(jp)*yn+zms(jp)*zn.gt. -0.0d0) then
  835. * write (6,*) ' impo32 normales incompatibes 1 ',
  836. * > jp,xjeu,dpm,dist
  837. goto 20
  838. endif
  839.  
  840.  
  841.  
  842. C*DBG write(ioimp,*) ' b1 b2 b3 ',b1,b2,b3
  843. 1954 continue
  844. * points a l'exterieur?
  845. * on met une ponderation et un rayon d'acceptation
  846. pond = (1D4+1) - 1D4 * bm
  847. if (pond.le.0.d0) goto 20
  848. pond=max(pond,0.d0)
  849. pond=min(pond,1.d0)
  850.  
  851. ** if (xjeu.lt.0.d0)
  852. ** > write (6,*) 'pt traverse',jp,b1,b2,b3,xjeuv-xjr,dist
  853.  
  854. *
  855. * Ajout d'une relation noeud-triangle
  856. *
  857. nelri3 = nelri3 + 1
  858. nelch = nelch + 1
  859. *
  860. * on ajuste les differents segments si necesaire
  861. *
  862. if (nelri3.gt.nelrig) then
  863. nelrig = nelrig + incnel
  864. RIGREL=0
  865. segadj,xmatri
  866. nbelem = nbelem + incnel
  867. nbnn = 5
  868. segadj,meleme
  869. nbnn = 1
  870. segadj,ipt7
  871. n = n + incnel
  872. segadj,mpoval
  873. endif
  874. *
  875. * Mise a jour du meleme
  876. ** write(6,*) 'ipt8.num(/2)',ipt8.num(/2)
  877. num(1,nelri3) = ipt1.num(1,iel1)
  878. num(2,nelri3) = ip1
  879. num(3,nelri3) = ip2
  880. num(4,nelri3) = ip3
  881. num(5,nelri3) = jp
  882. ** write(6,*) ' nouveau meleme',num(1,nelri3),num(2,nelri3),
  883. ** > num(3,nelri3),num(4,nelri3),num(5,nelri3) *
  884. * Mise a jour de xmatri
  885. * lambda
  886. re( 1,1,nelri3) = 0d0
  887. * ip1
  888. re( 2,1,nelri3) = xn * bb1 * bsurf * pond
  889. re( 3,1,nelri3) = yn * bb1 * bsurf * pond
  890. re( 4,1,nelri3) = zn * bb1 * bsurf * pond
  891. * ip2
  892. re( 5,1,nelri3) = xn * bb2 * bsurf * pond
  893. re( 6,1,nelri3) = yn * bb2 * bsurf * pond
  894. re( 7,1,nelri3) = zn * bb2 * bsurf * pond
  895. * ip3
  896. re( 8,1,nelri3) = xn * bb3 * bsurf * pond
  897. re( 9,1,nelri3) = yn * bb3 * bsurf * pond
  898. re(10,1,nelri3) = zn * bb3 * bsurf * pond
  899. * jp
  900. re(11,1,nelri3) = -xn * bsurf * pond
  901. re(12,1,nelri3) = -yn * bsurf * pond
  902. re(13,1,nelri3) = -zn * bsurf * pond
  903. * on transpose
  904. do 30 ic = 2, nligrp
  905. re(1,ic,nelri3) = re(ic,1,nelri3)
  906. 30 continue
  907. * le reste est nul
  908. *
  909. * remplissage du champoint de depi (jeu)
  910. *
  911. ipt7.num(1,nelch) = ipt1.num(1,iel1)
  912. ** write(6,*) ' ipt1.num(1,iel1) ',ipt1.num(1,iel1)
  913. vpocha(nelch,1) = xjeu * bsurf * pond
  914. vpocha(nelch,2) = bsurf * pond
  915. IF (MELVA2.NE.0) THEN
  916. NEL2 = min (iel1,NELA)
  917. VPOCHA(nelch,3) = max(MELVA2.VELCHE(NPTELA,NEL2),0.D0)*
  918. > bsurf * pond
  919. ENDIF
  920. ** write(ioimp,*) ' jeu ',xjeu,ip1,ip2,ip3,jp,b1,b2,b3,xn,yn,zn
  921. *
  922. 20 CONTINUE
  923. 18 CONTINUE
  924. 19 CONTINUE
  925. *
  926. * Ajustement au plus juste puis desactivation des segments lies
  927. * a la rigidite du type 3
  928. if (nelri3.ne.nelrig) then
  929. nelrig = nelri3
  930. RIGREL=0
  931. segadj,xmatri
  932. nbelem = nelri3
  933. nbnn = 5
  934. segadj,meleme
  935. endif
  936. segdes,xmatri
  937. *
  938. ** write(ioimp,*) ' nb relation type 3 ',nelri3
  939. ** write(6,fmt='(10i8)') (num(5,nelr),nelr=1,nelri3)
  940.  
  941.  
  942.  
  943.  
  944.  
  945. C*DBG if (nelri3.eq.0) irigel(6,nrigel)=0
  946. *
  947. * Fin du traitement de la formulation standard/forte
  948. * ----------------------------------------------------
  949. 300 CONTINUE
  950. * Destruction des segments locaux devenus inutiles
  951. segsup mfopa3,mfopa4,mfopa5
  952.  
  953. GOTO 1000
  954.  
  955. *=======================================================================
  956. *= Formulation "faible" 3D : relation triangle-triangle
  957. *=======================================================================
  958. * Element de contact 3D a 7 noeuds (1+6)
  959. 500 CONTINUE
  960. *
  961. * Petit segment de travail
  962. segini,mfaible
  963. *
  964. * Relation du type 0 : triangle-triangle (faible)
  965. *---------------------------------------
  966. *
  967. * Creation du meleme associe a la relation
  968. *
  969. nbnn = 7
  970. nbelem = incnel
  971. nbsous = 0
  972. nbref = 0
  973. segini,meleme
  974. itypel = 22
  975. irigel(1,nrigel) = meleme
  976. *
  977. * Creation du descriptif commun a toutes les raideurs
  978. *
  979. nligrp = 19
  980. nligrd = nligrp
  981. segini,descr
  982. lisinc(1) = 'LX '
  983. lisdua(1) = 'FLX '
  984. noelep(1) = 1
  985. noeled(1) = 1
  986. do 510 i = 2, nligrp, 3
  987. lisinc(i ) = modepl(1)
  988. lisinc(i+1) = modepl(2)
  989. lisinc(i+2) = modepl(3)
  990. lisdua(i ) = moforc(1)
  991. lisdua(i+1) = moforc(2)
  992. lisdua(i+2) = moforc(3)
  993. noelep(i ) = (i+5)/3
  994. noelep(i+1) = noelep(i)
  995. noelep(i+2) = noelep(i)
  996. noeled(i ) = noelep(i)
  997. noeled(i+1) = noelep(i)
  998. noeled(i+2) = noelep(i)
  999. 510 continue
  1000. segdes,descr
  1001. irigel(3,nrigel) = descr
  1002. *
  1003. * creation du segment xmatri
  1004. *
  1005. nelrig = incnel
  1006. RIGREL=0
  1007. segini,xmatri
  1008. irigel(4,nrigel) = xmatri
  1009. *
  1010. * ce qu'on cree est unilateral
  1011. *
  1012. irigel(6,nrigel) = 1
  1013. *
  1014. * ce qu'on cree est symetrique
  1015. *
  1016. irigel(7,nrigel) = 0
  1017. *
  1018. * Nombre d'elements crees dans meleme=irigel(1,nrigel), ipt7 et mpoval
  1019. nelri0 = 0
  1020. *
  1021. * Boucle sur les elements du maillage de contact/frottement "faible"
  1022. *
  1023. DO 519 iel8=1,nbel8
  1024. *
  1025. xjr = 0d0
  1026. ip1 = ipt8.num(1,iel8)
  1027. ip2 = ipt8.num(2,iel8)
  1028. ip3 = ipt8.num(3,iel8)
  1029. * Definition du triangle T1(ip1,ip2,ip3)
  1030. * - Coordonnees des noeuds de T1
  1031. ipv = (ip1-1)*idimp1
  1032. xp1 = xcoor(ipv+1)
  1033. yp1 = xcoor(ipv+2)
  1034. zp1 = xcoor(ipv+3)
  1035. ipv = (ip2-1)*idimp1
  1036. xp2 = xcoor(ipv+1)
  1037. yp2 = xcoor(ipv+2)
  1038. zp2 = xcoor(ipv+3)
  1039. ipv = (ip3-1)*idimp1
  1040. xp3 = xcoor(ipv+1)
  1041. yp3 = xcoor(ipv+2)
  1042. zp3 = xcoor(ipv+3)
  1043. * - Barycentre de T1
  1044. xgT1 = (xp1 + xp2 + xp3) * X1s3
  1045. ygT1 = (yp1 + yp2 + yp3) * X1s3
  1046. zgT1 = (zp1 + zp2 + zp3) * X1s3
  1047. * - Normale au triangle T1
  1048. xnT1 = (yp1-yp2)*(zp2-zp3) - (zp1-zp2)*(yp2-yp3)
  1049. ynT1 = (zp1-zp2)*(xp2-xp3) - (xp1-xp2)*(zp2-zp3)
  1050. znT1 = (xp1-xp2)*(yp2-yp3) - (yp1-yp2)*(xp2-xp3)
  1051. dnT1 = SQRT(xnT1*xnT1+ynT1*ynT1+znT1*znT1)
  1052. IF (.not.(dnT1.lt.1d-10) .and. .not.(dnT1.gt.1d-10).AND.
  1053. & iimpi.ne.0) write(ioimp,*) 'FAIBle - 1.1 - impo32'
  1054. IF (abs(dnT1).le.xpetit) write(ioimp,*) 'FAIBle - 1.2 - impo32'
  1055. xnT1 = xnT1 / dnT1
  1056. ynT1 = ynT1 / dnT1
  1057. znT1 = znT1 / dnT1
  1058. C*DBG write(ioimp,*) 'Normale au plan T1',xnT1,ynT1,znT1,dnT1
  1059. * - Rayon de la sphere "englobante" de l'element (centre=barycentre)
  1060. d1 = (xgT1-xp1)**2 + (ygT1-yp1)**2 + (zgT1-zp1)**2
  1061. d2 = (xgT1-xp2)**2 + (ygT1-yp2)**2 + (zgT1-zp2)**2
  1062. d3 = (xgT1-xp3)**2 + (ygT1-yp3)**2 + (zgT1-zp3)**2
  1063. RayT1 = SQRT(max(d1,d2,d3))
  1064. DO 520 iel6 = 1, nbel6
  1065. if (MELVA1.ne.0) then
  1066. nel1 = min (iel6,nelj)
  1067. xjr = melva1.velche(nptelj,nel1)
  1068. endif
  1069. jp1 = ipt6.num(1,iel6)
  1070. * - Les noeuds 2 et 3 sont intervertis (fait aupravant dans impo31)
  1071. * Cela permet aux triangles T1 et T2 d etre orientes dans le meme sens.
  1072. jp3 = ipt6.num(2,iel6)
  1073. jp2 = ipt6.num(3,iel6)
  1074. C*DBG write(ioimp,*) iel,ip1,ip2,ip3,jp1,jp2,jp3,ipt1.num(1,iel)
  1075. *
  1076. * Verification (provisoire) qu'il n'y a pas de noeud double
  1077. if (ip1.eq.jp1) goto 520
  1078. if (ip1.eq.jp2) goto 520
  1079. if (ip1.eq.jp3) goto 520
  1080. if (ip2.eq.jp1) goto 520
  1081. if (ip2.eq.jp2) goto 520
  1082. if (ip2.eq.jp3) goto 520
  1083. if (ip3.eq.jp1) goto 520
  1084. if (ip3.eq.jp2) goto 520
  1085. if (ip3.eq.jp3) goto 520
  1086. *
  1087. *
  1088. * Definition du triangle T2(jp1,jp2,jp3)
  1089. * - Coordonnees des noeuds de T2
  1090. ipv = (jp1-1)*idimp1
  1091. xq1 = xcoor(ipv+1)
  1092. yq1 = xcoor(ipv+2)
  1093. zq1 = xcoor(ipv+3)
  1094. ipv = (jp2-1)*idimp1
  1095. xq2 = xcoor(ipv+1)
  1096. yq2 = xcoor(ipv+2)
  1097. zq2 = xcoor(ipv+3)
  1098. ipv = (jp3-1)*idimp1
  1099. xq3 = xcoor(ipv+1)
  1100. yq3 = xcoor(ipv+2)
  1101. zq3 = xcoor(ipv+3)
  1102. * - Barycentre de T2
  1103. xgT2 = (xq1 + xq2 + xq3) * X1s3
  1104. ygT2 = (yq1 + yq2 + yq3) * X1s3
  1105. zgT2 = (zq1 + zq2 + zq3) * X1s3
  1106. * - Normale au triangle T2
  1107. xnT2 = (yq1-yq2)*(zq2-zq3) - (zq1-zq2)*(yq2-yq3)
  1108. ynT2 = (zq1-zq2)*(xq2-xq3) - (xq1-xq2)*(zq2-zq3)
  1109. znT2 = (xq1-xq2)*(yq2-yq3) - (yq1-yq2)*(xq2-xq3)
  1110. dnT2 = SQRT(xnT2*xnT2+ynT2*ynT2+znT2*znT2)
  1111. IF (.not.(dnT2.lt.1d-10) .and. .not.(dnT2.gt.1d-10).AND.
  1112. & iimpi.ne.0) write(ioimp,*) 'FAIBle - 2.1 - impo32'
  1113. IF (abs(dnT2).le.xpetit.AND.iimpi.ne.0)
  1114. & write(ioimp,*) 'FAIBle - 2.2 - impo32'
  1115. xnT2 = xnT2 / dnT2
  1116. ynT2 = ynT2 / dnT2
  1117. znT2 = znT2 / dnT2
  1118. C*DBG write(ioimp,*) 'Normale au plan T2',xnT2,ynT2,znT2,dnT2
  1119. * - Rayon de la sphere "englobante" de l'element (centre=barycentre)
  1120. d1 = (xgT2-xq1)**2 + (ygT2-yq1)**2 + (zgT2-zq1)**2
  1121. d2 = (xgT2-xq2)**2 + (ygT2-yq2)**2 + (zgT2-zq2)**2
  1122. d3 = (xgT2-xq3)**2 + (ygT2-yq3)**2 + (zgT2-zq3)**2
  1123. RayT2 = SQRT(max(d1,d2,d3))
  1124.  
  1125. * Orientation respective correcte des 2 normales
  1126. * Les triangles T1 et T2 etant decrits dans le meme sens ("prisme"),
  1127. * le produit scalaire de leur normale doit etre positif ou nul !
  1128. scal = xnT1 * xnT2 + ynT1 * ynT2 + znT1 * znT2
  1129. C*DBG write(ioimp,*) 'Prod.scal des normales',scal
  1130. if (scal.lt.0.) goto 520
  1131. *
  1132. * Distance entre les centres de gravite
  1133. * Les spheres "englobantes" doivent s'intersecter pour contact potentiel
  1134. dist = SQRT((xgT2-xgT1)**2 + (ygT2-ygT1)**2 + (zgT2-zgT1)**2)
  1135. * IF (dist*4.GT.RayT1+RayT2) goto 520
  1136. *
  1137. * Definition du plan de contact (surface intermediaire)
  1138. * - Normale (unitaire) du plan de contact
  1139. xnC = xnT1 + xnT2
  1140. ynC = ynT1 + ynT2
  1141. znC = znT1 + znT2
  1142. dnC = SQRT(xnC*xnC + ynC*ynC + znC*znC)
  1143. IF (.not.(dnC.lt.1d-10).and. .not.(dnC.GT.1D-10).AND.iimpi.ne.0)
  1144. & write(ioimp,*) 'FAIBle - 3.1 - impo32'
  1145. IF (abs(dnC).le.xpetit.AND.iimpi.ne.0)
  1146. & write(ioimp,*) 'FAIBle - 3.2 - impo32'
  1147. xnC = xnC / dnC
  1148. ynC = ynC / dnC
  1149. znC = znC / dnC
  1150. C*DBG write(ioimp,*) 'Normale au plan Contact',xnC,ynC,znC,dnC
  1151. *
  1152. * Criteres d'acceptation de l'element de contact
  1153. RayTT = RayT1 + RayT2
  1154. * - Les barycentres des triangles T1 et T2 sont-ils suffisamment proches :
  1155. * distance suivant la direction de contact (prise en compte du jeu)
  1156. VXB12 = xgT2 - xgT1
  1157. VYB12 = ygT2 - ygT1
  1158. VZB12 = zgT2 - zgT1
  1159. distn = (VXB12*xnC)+(VYB12*ynC)+(VZB12*znC)
  1160. test1 = distn
  1161. if (MELVA1.NE.0) then
  1162. test1 = test1 - xjr
  1163. endif
  1164. if (test1.GT.RayTT) GOTO 520
  1165. *
  1166. * distance dans un plan dont la normale est la direction de contact
  1167. distt = SQRT(dist**2 - distn**2)
  1168. if (distt.GT.RayTT) GOTO 520
  1169.  
  1170. * - Point definissant le plan de contact
  1171. * = milieu des barycentres des triangles T1 et T2
  1172. xgC = (xgT1 + xgT2) * 0.5
  1173. ygC = (ygT1 + ygT2) * 0.5
  1174. zgC = (zgT1 + zgT2) * 0.5
  1175. * - "Distance" de reference au plan de contact
  1176. dgC = xgC*xnC + ygC*ynC + zgC*znC
  1177. *
  1178. * Distance "signee" des triangles T1 et T2 au plan de contact
  1179. dp1C = (xp1*xnC + yp1*ynC + zp1*znC) - dgC
  1180. dp2C = (xp2*xnC + yp2*ynC + zp2*znC) - dgC
  1181. dp3C = (xp3*xnC + yp3*ynC + zp3*znC) - dgC
  1182. dq1C = (xq1*xnC + yq1*ynC + zq1*znC) - dgC
  1183. dq2C = (xq2*xnC + yq2*ynC + zq2*znC) - dgC
  1184. dq3C = (xq3*xnC + yq3*ynC + zq3*znC) - dgC
  1185. * Projection des triangles T1 et T2 sur le plan de contact
  1186. * T1C = triangle T1 projete sur plan de Contact
  1187. cPT1C(1,1) = xp1 - dp1C * xnC
  1188. cPT1C(1,2) = yp1 - dp1C * ynC
  1189. cPT1C(1,3) = zp1 - dp1C * znC
  1190. cPT1C(2,1) = xp2 - dp2C * xnC
  1191. cPT1C(2,2) = yp2 - dp2C * ynC
  1192. cPT1C(2,3) = zp2 - dp2C * znC
  1193. cPT1C(3,1) = xp3 - dp3C * xnC
  1194. cPT1C(3,2) = yp3 - dp3C * ynC
  1195. cPT1C(3,3) = zp3 - dp3C * znC
  1196. * T2C = triangle T2 projete sur plan de Contact
  1197. cPT2C(1,1) = xq1 - dq1C * xnC
  1198. cPT2C(1,2) = yq1 - dq1C * ynC
  1199. cPT2C(1,3) = zq1 - dq1C * znC
  1200. cPT2C(2,1) = xq2 - dq2C * xnC
  1201. cPT2C(2,2) = yq2 - dq2C * ynC
  1202. cPT2C(2,3) = zq2 - dq2C * znC
  1203. cPT2C(3,1) = xq3 - dq3C * xnC
  1204. cPT2C(3,2) = yq3 - dq3C * ynC
  1205. cPT2C(3,3) = zq3 - dq3C * znC
  1206. *
  1207. * On determine quelle est la composante maximale de la normale pour
  1208. * projeter les triangles T1C et T2C sur un plan parallele aux axes
  1209. * ("le plus orthogonal" a cette normale), ce qui maximise leur aire.
  1210. r_x = abs(xnC)
  1211. r_y = abs(ynC)
  1212. r_z = abs(znC)
  1213. if (r_x.gt.r_y) then
  1214. inC = 1
  1215. if (r_x.lt.r_z) inC = 3
  1216. else
  1217. inC = 2
  1218. if (r_y.lt.r_z) inC = 3
  1219. endif
  1220. * Projection des triangles T1C et T2C sur ce plan // aux axes (A)
  1221. * T1A = triangle T1C projete sur ce plan (A)
  1222. * T2A = triangle T2C projete sur ce plan (A)
  1223. * On prend soin d'orienter les triangles T1A et T2A dans le sens
  1224. * direct (en tenant compte du signe de la composante normale !)
  1225. GOTO (531,532,533), inC
  1226. call erreur(5)
  1227. return
  1228. * Normale NC selon "x" : A =(y,z)
  1229. 531 if (xnC.lt.0.) inC = -inC
  1230. inX = 2
  1231. inY = 3
  1232. goto 534
  1233. * Normale NC selon "y" : A =(x,z)
  1234. 532 if (ynC.lt.0.) inC = -inC
  1235. inX = 1
  1236. inY = 3
  1237. goto 534
  1238. * Normale NC selon "z" : A =(x,y)
  1239. 533 if (znC.lt.0.) inC = -inC
  1240. inX = 1
  1241. inY = 2
  1242. goto 534
  1243. 534 continue
  1244. cPT1A(1,1) = cPT1C(1,inX)
  1245. cPT1A(1,2) = cPT1C(1,inY)
  1246. cPT2A(1,1) = cPT2C(1,inX)
  1247. cPT2A(1,2) = cPT2C(1,inY)
  1248. if (inC.gt.0) then
  1249. cPT1A(2,1) = cPT1C(2,inX)
  1250. cPT1A(2,2) = cPT1C(2,inY)
  1251. cPT2A(2,1) = cPT2C(2,inX)
  1252. cPT2A(2,2) = cPT2C(2,inY)
  1253. cPT1A(3,1) = cPT1C(3,inX)
  1254. cPT1A(3,2) = cPT1C(3,inY)
  1255. cPT2A(3,1) = cPT2C(3,inX)
  1256. cPT2A(3,2) = cPT2C(3,inY)
  1257. else
  1258. cPT1A(2,1) = cPT1C(3,inX)
  1259. cPT1A(2,2) = cPT1C(3,inY)
  1260. cPT2A(2,1) = cPT2C(3,inX)
  1261. cPT2A(2,2) = cPT2C(3,inY)
  1262. cPT1A(3,1) = cPT1C(2,inX)
  1263. cPT1A(3,2) = cPT1C(2,inY)
  1264. cPT2A(3,1) = cPT2C(2,inX)
  1265. cPT2A(3,2) = cPT2C(2,inY)
  1266. endif
  1267. cPT1A(4,1) = cPT1A(1,1)
  1268. cPT1A(4,2) = cPT1A(1,2)
  1269. * Calcul des cotes des triangles T1A et T2A (12,23,31)
  1270. * Utile pour connaitre ensuite la normale aux cotes des triangles
  1271. vT1A(1,1) = cPT1A(2,1) - cPT1A(1,1)
  1272. vT1A(1,2) = cPT1A(2,2) - cPT1A(1,2)
  1273. vT1A(2,1) = cPT1A(3,1) - cPT1A(2,1)
  1274. vT1A(2,2) = cPT1A(3,2) - cPT1A(2,2)
  1275. vT1A(3,1) = cPT1A(1,1) - cPT1A(3,1)
  1276. vT1A(3,2) = cPT1A(1,2) - cPT1A(3,2)
  1277. C*nu vT2A(1,1) = cPT2A(2,1) - cPT2A(1,1)
  1278. vT2A(1,2) = cPT2A(2,2) - cPT2A(1,2)
  1279. C*nu vT2A(2,1) = cPT2A(3,1) - cPT2A(2,1)
  1280. vT2A(2,2) = cPT2A(3,2) - cPT2A(2,2)
  1281. C*nu vT2A(3,1) = cPT2A(1,1) - cPT2A(3,1)
  1282. vT2A(3,2) = cPT2A(1,2) - cPT2A(3,2)
  1283. * Calcul de la surface de chacun des triangles T1A et T2A
  1284. * (en fait, on calcule le double, mais par la suite on ne considere que
  1285. * des rapports de surfaces de triangle)
  1286. SuT1A = (cPT1A(2,1)+cPT1A(1,1)) * vT1A(1,2)
  1287. & + (cPT1A(3,1)+cPT1A(2,1)) * vT1A(2,2)
  1288. & + (cPT1A(1,1)+cPT1A(3,1)) * vT1A(3,2)
  1289. SuT2A = (cPT2A(2,1)+cPT2A(1,1)) * vT2A(1,2)
  1290. & + (cPT2A(3,1)+cPT2A(2,1)) * vT2A(2,2)
  1291. & + (cPT2A(1,1)+cPT2A(3,1)) * vT2A(3,2)
  1292. C*DBG write(ioimp,*) 'Surfaces T1A - T2A :', 0.5*SuT1A,0.5*SuT2A
  1293. C*DBG if (SuT1A.gt.100.*SuT2A .or. SuT2A.gt.100.*SuT1A)
  1294. C*DBG & write(ioimp,*) 'Rapport des surfaces tres important !'
  1295.  
  1296. * On initialise l'intersection des triangles avec T2A
  1297. nPIn0 = 3
  1298. do 540 i = 1, nPIn0
  1299. cPIn0(i,1) = cPT2A(i,1)
  1300. cPIn0(i,2) = cPT2A(i,2)
  1301. 540 continue
  1302. * Determination de l'intersection des triangles T1A et T2A
  1303. * en regardant progressivement l'intersection avec les cotes de T1A
  1304. * Note : On utilise le fait que les polygones traites sont convexes !
  1305. DO 550 i = 1, 3
  1306. vN1x = -vT1A(i,2)
  1307. vN1y = vT1A(i,1)
  1308. scal = vN1x * cPT1A(i,1) + vN1y * cPT1A(i,2)
  1309. *
  1310. ipos = 0
  1311. ineg = 0
  1312. jpos = 0
  1313. jneg = 0
  1314. do 551 j = 1, nPIn0
  1315. test(j) = (vN1x * cPIn0(j,1) + vN1y * cPIn0(j,2)) - scal
  1316. if (test(j).gt.1.d-10) then
  1317. * if (test(j).gt.0.) then
  1318. ipos = ipos + 1
  1319. if (jneg.ne.0 .and. jpos.eq.0) jpos = j
  1320. else if (test(j).lt.-1.d-10) then
  1321. * else if (test(j).lt.0.) then
  1322. ineg = ineg + 1
  1323. if (jneg.eq.0) jneg = j
  1324. else
  1325. test(j) = 0.
  1326. endif
  1327. 551 continue
  1328. *
  1329. * 1) Cas ou ipos = 0 :
  1330. * 1.1) il n'y pas d'intersection (ineg=nPIn0)
  1331. * 1.2) l'intersection se limite a 1 point (ineg=nPIn0-1)
  1332. * 1.3) l'intersection a 1 segment sur une frontiere (ineg=nPIn0-2)
  1333. * La surface correspondante est nulle et il n'y a donc pas de contact !
  1334. if (ipos.eq.0) then
  1335. C*DBG write(ioimp,*) 'Intersection a ',nPIn0-ineg,' points'
  1336. goto 520
  1337. endif
  1338. * 2) Cas ou ipos > 0 : Il y a une intersection a calculer
  1339. * 2.1) ineg = 0 : Tous les points sont "du bon cote" et l'intersection
  1340. * correspond au polygone de depart !
  1341. if (ineg.eq.0) then
  1342. C*DBG write(ioimp,*) 'Intersection du bon cote - rien a faire'
  1343. goto 550
  1344. endif
  1345. * 2.2) ineg > 0 : Il y a deux intersections a determiner car il y a
  1346. * au moins un point du "mauvais cote"
  1347. jpos = max(1,jpos)
  1348. jpr = jpos - 1
  1349. if (jpos.eq.1) jpr = nPIn0
  1350. nPIn = 1
  1351. if (test(jpr).lt.0.) then
  1352. r_z = test(jpos) / (test(jpos) - test(jpr))
  1353. cPIn(nPIn,1) = cPIn0(jpos,1)
  1354. & + r_z*(cPIn0(jpr,1) - cPIn0(jpos,1))
  1355. cPIn(nPIn,2) = cPIn0(jpos,2)
  1356. & + r_z*(cPIn0(jpr,2) - cPIn0(jpos,2))
  1357. else
  1358. cPIn(nPIn,1) = cPIn0(jpr,1)
  1359. cPIn(nPIn,2) = cPIn0(jpr,2)
  1360. endif
  1361. do 552 j = 1, ipos
  1362. nPIn = nPIn + 1
  1363. cPIn(nPIn,1) = cPIn0(jpos,1)
  1364. cPIn(nPIn,2) = cPIn0(jpos,2)
  1365. jpr = jpos
  1366. jpos = jpos + 1
  1367. if (jpos.gt.nPIn0) jpos = 1
  1368. 552 continue
  1369. nPIn = nPIn + 1
  1370. if (test(jpos).lt.0.) then
  1371. r_z = test(jpr) / (test(jpr) - test(jpos))
  1372. cPIn(nPIn,1) = cPIn0(jpr,1)
  1373. & + r_z*(cPIn0(jpos,1) - cPIn0(jpr,1))
  1374. cPIn(nPIn,2) = cPIn0(jpr,2)
  1375. & + r_z*(cPIn0(jpos,2) - cPIn0(jpr,2))
  1376. else
  1377. cPIn(nPIn,1) = cPIn0(jpos,1)
  1378. cPIn(nPIn,2) = cPIn0(jpos,2)
  1379. endif
  1380. * Mise a jour cPIn0 pour la suite du traitement des intersections...
  1381. nPIn0 = nPIn
  1382. do 554 j = 1, nPIn0
  1383. cPIn0(j,1) = cPIn(j,1)
  1384. cPIn0(j,2) = cPIn(j,2)
  1385. 554 continue
  1386. C*DBG-F write(ioimp,*) 'Intersection ',i,' a ',nPIn0,' points'
  1387. C*DBG-F do j = 1, nPIn0
  1388. C*DBG-F write(ioimp,*) ' ',j,nbpts0+6+j,cPIn0(j,1),cPIn0(j,2)
  1389. C*DBG-F enddo
  1390. *
  1391. 550 CONTINUE
  1392. *
  1393. * Calcul de la surface de l'intersection et de son centre de gravite
  1394. r_z = cPIn0(nPIn0,1)*cPIn0(1,2) - cPIn0(1,1)*cPIn0(nPIn0,2)
  1395. SuPIn = r_z
  1396. xGIn = (cPIn0(nPIn0,1)+cPIn0(1,1)) * r_z
  1397. yGIn = (cPIn0(nPIn0,2)+cPIn0(1,2)) * r_z
  1398. do 560 i = 1, nPIn0-1
  1399. j = i + 1
  1400. r_z = cPIn0(i,1)*cPIn0(j,2) - cPIn0(j,1)*cPIn0(i,2)
  1401. SuPIn = SuPIn + r_z
  1402. xGIn = xGIn + (cPIn0(i,1)+cPIn0(j,1)) * r_z
  1403. yGIn = yGIn + (cPIn0(i,2)+cPIn0(j,2)) * r_z
  1404. 560 continue
  1405. if (SuPIn .lt. 1.E-7*max(SuT1A,SuT2A) ) then
  1406. C*DBG write(ioimp,*) 'Intersection a une surface negligeable !'
  1407. goto 520
  1408. endif
  1409. r_z = X1s3 / SupIn
  1410. SuPIn = 0.5 * SupIn
  1411. xGIn = xGIn * r_z
  1412. yGIn = yGIn * r_z
  1413. C*DBG write(ioimp,*) 'Surface Intersection :',SuPIn
  1414. *
  1415. * Calcul des coordonnees barycentriques du centre de gravite
  1416. * pour le triangle T1A
  1417. xpip1 = xGIn - cPT1A(1,1)
  1418. ypip1 = yGIn - cPT1A(1,2)
  1419. xpip2 = xGIn - cPT1A(2,1)
  1420. ypip2 = yGIn - cPT1A(2,2)
  1421. xpip3 = xGIn - cPT1A(3,1)
  1422. ypip3 = yGIn - cPT1A(3,2)
  1423. b1T1 = xpip2 * ypip3 - ypip2 * xpip3
  1424. b2T1 = xpip3 * ypip1 - ypip3 * xpip1
  1425. b3T1 = xpip1 * ypip2 - ypip1 * xpip2
  1426. bt = b1T1 + b2T1 + b3T1
  1427. if (abs(bt-SuT1A) .gt. 1.E-3)
  1428. & write(ioimp,*) 'Prob bt-SuT1A',bt,SuT1A
  1429. b1T1 = b1T1 / SuT1A
  1430. b2T1 = b2T1 / SuT1A
  1431. b3T1 = b3T1 / SuT1A
  1432. *
  1433. * pour le triangle T2A
  1434. xpip1 = xGIn - cPT2A(1,1)
  1435. ypip1 = yGIn - cPT2A(1,2)
  1436. xpip2 = xGIn - cPT2A(2,1)
  1437. ypip2 = yGIn - cPT2A(2,2)
  1438. xpip3 = xGIn - cPT2A(3,1)
  1439. ypip3 = yGIn - cPT2A(3,2)
  1440. b1T2 = xpip2 * ypip3 - ypip2 * xpip3
  1441. b2T2 = xpip3 * ypip1 - ypip3 * xpip1
  1442. b3T2 = xpip1 * ypip2 - ypip1 * xpip2
  1443. bt = b1T2 + b2T2 + b3T2
  1444. if (abs(bt-SuT2A) .gt. 1.E-3)
  1445. & write(ioimp,*) 'Prob bt-SuT2A',bt,SuT2A
  1446. b1T2 = b1T2 / SuT2A
  1447. b2T2 = b2T2 / SuT2A
  1448. b3T2 = b3T2 / SuT2A
  1449. *
  1450. * Calcul du jeu
  1451. xjeu = (b1T2*dq1C + b2T2*dq2C + b3T2*dq3C)
  1452. & - (b1T1*dp1C + b2T1*dp2C + b3T1*dp3C)
  1453. C*DBG write(ioimp,*) 'Jeu =',xjeu
  1454. *
  1455. * Ajout d'une relation triangle-triangle
  1456. *
  1457. nelri0 = nelri0 + 1
  1458. nelch = nelch + 1
  1459. *
  1460. * on ajuste les differents segments si necesaire
  1461. *
  1462. if (nelri0.gt.nelrig) then
  1463. nelrig = nelrig + incnel
  1464. RIGREL=0
  1465. segadj,xmatri
  1466. nbelem = nbelem + incnel
  1467. nbnn = 7
  1468. segadj,meleme
  1469. nbnn = 1
  1470. segadj,ipt7
  1471. n = n + incnel
  1472. segadj,mpoval
  1473. endif
  1474. *
  1475. * Choix du mult de Lagrange qui porte la condition
  1476. * -> l'element le plus grand
  1477. imult=ipt1.num(1,iel8)
  1478. ielt=iel8
  1479. if (RayT1.lt.RayT2) then
  1480. imult=ipt1.num(1,nbel8+iel6)
  1481. ielt=nbel8+iel6
  1482. endif
  1483. *
  1484. num(1,nelri0) = imult
  1485. num(2,nelri0) = ip1
  1486. num(3,nelri0) = ip2
  1487. num(4,nelri0) = ip3
  1488. num(5,nelri0) = jp1
  1489. num(6,nelri0) = jp2
  1490. num(7,nelri0) = jp3
  1491. icolor(nelri0) = 1
  1492. *
  1493. * Mise a jour de xmatri
  1494. *
  1495. * lambda
  1496. re( 1,1,nelri0) = 0.d0
  1497. * ip1
  1498. re( 2,1,nelri0) = xnC * b1T1 * SuPIn
  1499. re( 3,1,nelri0) = ynC * b1T1 * SuPIn
  1500. re( 4,1,nelri0) = znC * b1T1 * SuPIn
  1501. * ip2
  1502. re( 5,1,nelri0) = xnC * b2T1 * SuPIn
  1503. re( 6,1,nelri0) = ynC * b2T1 * SuPin
  1504. re( 7,1,nelri0) = znC * b2T1 * SuPIn
  1505. * ip3
  1506. re( 8,1,nelri0) = xnC * b3T1 * SuPIn
  1507. re( 9,1,nelri0) = ynC * b3T1 * SuPIn
  1508. re(10,1,nelri0) = znC * b3T1 * SuPIn
  1509. * jp1
  1510. re(11,1,nelri0) = -xnC * b1T2 * SuPIn
  1511. re(12,1,nelri0) = -ynC * b1T2 * SuPIn
  1512. re(13,1,nelri0) = -znC * b1T2 * SuPIn
  1513. * jp2
  1514. re(14,1,nelri0) = -xnC * b2T2 * SuPIn
  1515. re(15,1,nelri0) = -ynC * b2T2 * SuPIn
  1516. re(16,1,nelri0) = -znC * b2T2 * SuPIn
  1517. * jp3
  1518. re(17,1,nelri0) = -xnC * b3T2 * SuPIn
  1519. re(18,1,nelri0) = -ynC * b3T2 * SuPIn
  1520. re(19,1,nelri0) = -znC * b3T2 * SuPIn
  1521. * on transpose
  1522. do 580 ic = 2, nligrp
  1523. re(1,ic,nelri0) = re(ic,1,nelri0)
  1524. 580 continue
  1525. * le reste est nul
  1526. *
  1527. * remplissage du champoint de depi (jeu)
  1528. *
  1529. ipt7.num(1,nelch) = imult
  1530. vpocha(nelch,1) = (xjeu - xjr) * SuPIn
  1531. vpocha(nelch,2) = SuPIn
  1532. IF (MELVA2.NE.0) THEN
  1533. NEL2 = min (ielt,NELA)
  1534. VPOCHA(nelch,3) = max(MELVA2.VELCHE(NPTELA,NEL2),0.D0)*SuPIn
  1535. ENDIF
  1536. C*DBG-F call prfaible(ipt1,iel,nPIn0,mfaible)
  1537. *
  1538. 520 CONTINUE
  1539. 519 CONTINUE
  1540. *
  1541. * Ajustement au plus juste puis desactivation des segments lies
  1542. * a la rigidite du type 0
  1543. if (nelri0.ne.nelrig) then
  1544. nelrig = nelri0
  1545. RIGREL=0
  1546. segadj,xmatri
  1547. nbelem = nelri0
  1548. nbnn = 7
  1549. segadj,meleme
  1550. endif
  1551. segdes,xmatri
  1552. *
  1553. ** write(ioimp,*) ' nb relation type 0 ',nelri0
  1554. * if (nelri0.eq.0) irigel(6,nrigel)=0
  1555. *
  1556. * Destruction des segments locaux devenus inutiles
  1557. segsup,mfaible
  1558. *
  1559. C* GOTO 1000
  1560.  
  1561. *=======================================================================
  1562. *= Fin du sous-programme :
  1563. *=======================================================================
  1564. 1000 CONTINUE
  1565. *
  1566. * Ajustement au plus juste du chpoint de depi (jeu) : mpoval et ipt7
  1567. * puis desactivation du chpoint
  1568. if (vpocha(/1).ne.nelch) then
  1569. n = nelch
  1570. nc=vpocha(/2)
  1571. segadj,mpoval
  1572. nbnn = 1
  1573. nbelem = nelch
  1574. nbsous = 0
  1575. nbref = 0
  1576. segadj,ipt7
  1577. ** write(6,*) ' ipt7 dans impo32 '
  1578. endif
  1579. * Desctivation de la matrice de raideur de contact
  1580. segdes,mrigid
  1581. *
  1582. * Reunion des relations portant sur le meme multiplicateur de lagrange
  1583. *
  1584. call impofu(MRIGID,MCHPOI)
  1585. * write(6,*) ' apres impofu dans impo32 '
  1586. * call ecchpo(mchpoi,1)
  1587. * call prrigi(mrigid,1)
  1588.  
  1589.  
  1590. *
  1591. * Nettoyage eventuel des termes petits dans les relations
  1592. *
  1593. * A voir plus tard. Frig3c suppose que la relation est complete.
  1594. *
  1595. ** call relasi(mrigid)
  1596. *
  1597. 900 CONTINUE
  1598. end
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  

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