Télécharger impo32.eso

Retour à la liste

Numérotation des lignes :

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

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