Télécharger numopt.eso

Retour à la liste

Numérotation des lignes :

numopt
  1. C NUMOPT SOURCE MB234859 26/10/28 21:15:03 12687
  2. C RACINE DE LA NUMEROTATION POUR LA SORTIE SUR FAC
  3. C
  4. SUBROUTINE NUMOPT(MELEME,ICPR,NODES)
  5. IMPLICIT INTEGER(I-N)
  6.  
  7. -INC PPARAM
  8. -INC CCOPTIO
  9. -INC CCPRECO
  10.  
  11. -INC SMELEME
  12. -INC SMCOORD
  13.  
  14. CHARACTER*4 MVAL
  15. DATA MVAL/'NOOP'/
  16. SEGMENT MEMJT1(NKON)
  17. SEGMENT MEMJT2(NKON)
  18. SEGMENT IPOME(NODES+1)
  19. SEGMENT JNT(NODES)
  20. SEGMENT JMEM(NODES)
  21. SEGMENT ICPR(nbpts)
  22. SEGMENT ICPREN(nbpts)
  23. SEGMENT IDCP(nbpts)
  24. SEGMENT JOINT(NODES)
  25. SEGMENT NEWJT(NODES)
  26.  
  27. icpren=0
  28. segact meleme
  29. * cas trivial ou le maillage est fait de points isoles
  30. CALL LIRMOT(MVAL,1,IRET,0)
  31. itypto=0
  32. ipt1=meleme
  33. do k=1,max(1,lisous(/1))
  34. if (lisous(/1).ne.0) ipt1=lisous(k)
  35. segact ipt1
  36. itypto = itypto+ipt1.itypel-1
  37. enddo
  38.  
  39. if (itypto.eq.0.or.iret.eq.1.or.nucrou.eq.-1) then
  40. segact icpr*MOD
  41. ia=0
  42. ipt1=meleme
  43. do k=1,max(1,lisous(/1))
  44. if (lisous(/1).ne.0) ipt1=lisous(k)
  45. segact ipt1
  46. do j= ipt1.num(/2),1,-1
  47. do i=1,ipt1.num(/1)
  48. if (icpr(ipt1.num(i,j)).eq.0) then
  49. ia=ia+1
  50. icpr(ipt1.num(i,j))=ia
  51. endif
  52. enddo
  53. enddo
  54. enddo
  55. nodes=ia
  56. return
  57. endif
  58.  
  59. nucro=0
  60. * si plus de 4000 noeuds dans le meleme numérotation NS
  61. segact icpr*mod
  62. do i=1,icpr(/1)
  63. icpr(i)=0
  64. enddo
  65. ia=0
  66. ib=0
  67. ipd=0
  68. ipt1=meleme
  69. ifrot=0
  70. do 60 isous=1,max(1,lisous(/1))
  71. if (lisous(/1).ne.0) ipt1=lisous(isous)
  72. segact ipt1
  73. if (ipt1.itypel.eq.-49) then
  74. * write (6,*) ' frottement '
  75. ifrot=1
  76. endif
  77. NBNN1=ipt1.num(/1)
  78. NBEL1=ipt1.num(/2)
  79. do i=1,NBEL1
  80. do j=1,NBNN1
  81. iel1=ipt1.num(j,i)
  82. if (icpr(iel1).eq.0) then
  83. ia=ia+1
  84. icpr(iel1)=ia
  85. endif
  86. enddo
  87. enddo
  88.  
  89. if (NBNN1.gt.ib .AND. NBEL1.GT.0.and.abs(ipt1.itypel).ne.49)
  90. $ then
  91. ib=NBNN1
  92. ipd=icpr(ipt1.num(1,1))
  93. endif
  94. 60 continue
  95. if (ia.lt.ib*2 .and.ia.gt.100) then
  96. ** write (6,*) ' superelement detecte ',ia,ib
  97. ia=1
  98. else
  99. ipd=0
  100. endif
  101. do i=1,icpr(/1)
  102. icpr(i)=0
  103. enddo
  104. * choix de la numerotation en fonction du nombre de noeuds
  105. ** write(6,*) ' numopt ia ',ia
  106. if (ia.gt.4000) nucro=2
  107. if (ia.le.4000) nucro=0
  108. * Reverse CM en iteratif
  109. IF(NUCROU.EQ.1) nucro=0
  110. IF(NUCROU.EQ.2) nucro=2
  111. IF(NUCROU.EQ.3) nucro=3
  112. * en cas de frottement forcément nested dissection pour placer correctement les mult de frot
  113. * if (ifrot.eq.1) nucro=2
  114. * ajuster le nombre de zero consecutif
  115. if (nucro.eq.0) izrosf=16
  116. if (nucro.eq.2) izrosf=48
  117. if(ipd.ne.0) izrosf=48
  118. CALL LIRMOT(MVAL,1,IRET,0)
  119. if (iret.eq.0) then
  120. * a t'on deja fait l'operation ???
  121. segini icpren,idcp
  122. incren=0
  123. do isous=2,lisous(/1)
  124. ipt3=lisous(isous)
  125. segact ipt3
  126. * SG 2011/10/07 on a échangé l'ordre des boucles pour le remettre dans
  127. * l'ordre "usuel"
  128. do j=1,ipt3.num(/2)
  129. do i=1,ipt3.num(/1)
  130. ip=ipt3.num(i,j)
  131. if (icpren(ip).eq.0) then
  132. incren=incren+1
  133. icpren(ip)=incren
  134. endif
  135. enddo
  136. enddo
  137. enddo
  138. do i=1,icpren(/1)
  139. if (icpren(i).ne.0) idcp(icpren(i))=i
  140. enddo
  141.  
  142. do 150 ip=1,npreco
  143. if (prenum(ip).ne.0) then
  144. ipt1=prenum(ip)
  145. segact ipt1
  146. * write (6,*) ' prenum ',ip,lisous(/1),ipt1.lisous(/1)
  147. if (lisous(/1)+1.eq.ipt1.lisous(/1)) then
  148. *SG Attention ! On a osé stocker le type de renumérotation qui avait été
  149. *SG calculée dans le itypel
  150. ipt2=ipt1.lisous(ipt1.lisous(/1))
  151. segact ipt2
  152. nucroa=ipt2.itypel
  153. segdes ipt2
  154. if (nucro.ne.nucroa) goto 11
  155. * verif maillage identique
  156. * write (6,*) ' maillage 1 ',lisous(/1)
  157. * write (6,*) ' maillage 2 ',ipt1.lisous(/1)
  158. do isous=2,lisous(/1)
  159. ipt3=lisous(isous)
  160. ipt4=ipt1.lisous(isous)
  161. segact ipt3,ipt4
  162. * write (6,*) ipt3.num(/1),ipt4.num(/1),ipt3.num(/2),ipt4.num(/2)
  163. * write (6,*) ' itypel ',ipt3.itypel,ipt4.itypel
  164. if (ipt3.itypel.ne.ipt4.itypel) goto 10
  165. if (ipt3.num(/1).ne.ipt4.num(/1)) goto 10
  166. if (ipt3.num(/2).ne.ipt4.num(/2)) goto 10
  167. * SG 2011/10/07 on a échangé l'ordre des boucles pour le remettre dans
  168. * l'ordre "usuel"
  169. do j=1,ipt3.num(/2)
  170. do i=1,ipt3.num(/1)
  171. * write (6,*) i,j,ipt3.num(i,j),
  172. * > icpren(ipt3.num(i,j)),ipt4.num(i,j)
  173. if (icpren(ipt3.num(i,j)).ne.ipt4.num(i,j))
  174. $ goto 10
  175. enddo
  176. enddo
  177. segdes ipt3,ipt4
  178. enddo
  179. if (iimpi.eq.2022) write (6,*)
  180. > ' preconditionnement de la numerotation ',ip,
  181. > (prenum(i),i=1,30)
  182. ipt2=ipt1.lisous(ipt1.lisous(/1))
  183. segact ipt2
  184. segact icpr*MOD
  185. nodes=ipt2.num(/2)
  186. * write (6,*) ' icpr(/1),nodes ',icpr(/1),nodes
  187. do i=1,nodes
  188. if (idcp(ipt2.num(1,i)).ne.0) icpr(idcp(ipt2.num(1
  189. $ ,i)))=i
  190. enddo
  191. ia=nodes
  192. segdes ipt1,ipt2
  193. * write (6,*) ' apres precond dans numopt '
  194. * write (6,*) (icpr(i),i=1,icpr(/1))
  195. return
  196.  
  197. 10 continue
  198. segdes ipt3,ipt4
  199. 11 continue
  200. endif
  201. endif
  202. 150 continue
  203. if (nucro.eq.2) then
  204. if (iimpi.ne.0) write(ioimp,*)
  205. $ 'Numerotation Nested Dissection'
  206. call numop2(MELEME,ICPR,NODES)
  207. goto 300
  208. elseif (nucro.eq.3) then
  209. if (iimpi.ne.0) write(ioimp,*) 'Numerotation Sloan'
  210. call numop3(MELEME,ICPR,NODES)
  211. goto 300
  212. endif
  213. endif
  214. if (iret.eq.1) call refus
  215. NODES=nbpts
  216. SEGACT ICPR*MOD
  217. SEGACT MELEME
  218. DO I=1,ICPR(/1)
  219. ICPR(I)=0
  220. ENDDO
  221. IPT1=MELEME
  222. IKOU=0
  223. DO 202 IO=1,MAX(1,LISOUS(/1))
  224. IF (LISOUS(/1).NE.0) THEN
  225. IPT1=LISOUS(IO)
  226. SEGACT IPT1
  227. ENDIF
  228. DO 203 J=1,IPT1.NUM(/2)
  229. * inversion car on reinverse a la fin
  230. DO 204 I=1,IPT1.NUM(/1)
  231. IJ=IPT1.NUM(I,J)
  232. IF (ICPR(IJ).NE.0) GOTO 204
  233. IKOU=IKOU+1
  234. ICPR(IJ)=IKOU
  235. 204 CONTINUE
  236. 203 CONTINUE
  237. 202 CONTINUE
  238. NODES=IKOU
  239. SEGINI JNT,JMEM,NEWJT,JOINT,IPOME
  240. IPT1=MELEME
  241. DO 3 IO=1,MAX(1,LISOUS(/1))
  242. IF (LISOUS(/1).NE.0) IPT1=LISOUS(IO)
  243. DO J=1,IPT1.NUM(/2)
  244. DO I=1,IPT1.NUM(/1)
  245. JMEM(ICPR(IPT1.NUM(I,J)))=JMEM(ICPR(IPT1.NUM(I,J)))+1
  246. enddo
  247. enddo
  248. 3 CONTINUE
  249. IPOME(1)=0
  250. DO 6 I=1,NODES
  251. IPOME(I+1)=IPOME (I) + JMEM(I)
  252. 6 CONTINUE
  253. NKON=IPOME(NODES+1)
  254. SEGINI MEMJT1,memjt2
  255. DO J=1,NODES
  256. JMEM(J)=0
  257. enddo
  258. IPT1=MELEME
  259. DO 102 IPASS=1,1
  260. DO 101 IO=1,MAX(1,LISOUS(/1))
  261. IF (LISOUS(/1).NE.0) IPT1=LISOUS(IO)
  262. ** if (ipt1.itypel.eq.-49) then
  263. ** if (ipass.eq.1) goto 101
  264. ** else
  265. ** if (ipass.eq.2) goto 101
  266. ** endif
  267. DO I=1,IPT1.NUM(/2)
  268. DO J=1,IPT1.NUM(/1)
  269. IND=ICPR(IPT1.NUM(J,I))
  270. JMEM(IND)=JMEM(IND)+1
  271. MEMJT1(IPOME(IND)+JMEM(IND))=I
  272. MEMJT2(IPOME(IND)+JMEM(IND))=IO
  273. enddo
  274. enddo
  275. 101 CONTINUE
  276. 102 CONTINUE
  277. IDIFF=1
  278. if (iimpi.ne.0) write(ioimp,*)
  279. $ 'Numerotation Reverse Cuthill McKee'
  280. CALL OPTNUM(MELEME,MEMJT1,memjt2,JMEM,JNT,NEWJT,JOINT,IDIFF,IPOME,
  281. # ICPR,NODES,NOOPTI,ipd,nucro)
  282. * ne pas inverse si superelement pour conserver sa numerotation
  283. if (ipd.eq.0) then
  284. DO 110 I=1,NODES
  285. JNT(I)=NODES-JNT(I)+1
  286. 110 CONTINUE
  287. endif
  288. C PERMUTER LES COORDONNEES ET CORRIGER IPAD
  289. DO 111 I=1,icpr(/1)
  290. IF (ICPR(I).EQ.0) GOTO 111
  291. ICPR(I)=JNT(ICPR(I))
  292. 111 CONTINUE
  293. IF(NOOPTI .EQ.0) GO TO 116
  294. IA=0
  295. DO 115 I=1,icpr(/1)
  296. IF(ICPR(I).EQ.0) GO TO 115
  297. IA=IA+1
  298. ICPR(I)=IA
  299. 115 CONTINUE
  300. 116 CONTINUE
  301. SEGSUP MEMJT1,MEMJT2,JMEM,NEWJT,JOINT,IPOME
  302. SEGSUP JNT
  303. * Mise en commentaire du return par SG car comme cela on preconditionne
  304. * aussi le Cuthill-McKee
  305. * RETURN
  306. 300 continue
  307. * sauver le resultat au cas ou on veuille recommencer
  308. segini,ipt1=meleme
  309. nbsous=ipt1.lisous(/1)+1
  310. nbref=ipt1.lisref(/1)
  311. nbnn=ipt1.num(/1)
  312. nbelem=ipt1.num(/2)
  313. segadj ipt1
  314. nbnn=1
  315. nbsous=0
  316. nbref=0
  317. nbelem=nodes
  318. segini ipt2
  319. *SG Attention ! On ose stocker le type de renumérotation qui a été
  320. *SG calculée dans le itypel
  321. ipt2.itypel=nucro
  322. ia=0
  323. do 120 i=1,icpr(/1)
  324. if (icpr(i).gt.nodes.or.icpr(i).eq.0) goto 120
  325. ia=ia+1
  326. ipt2.num(1,icpr(i))=icpren(i)
  327. 120 continue
  328. * call ecmail(ipt2)
  329. ipt1.lisous(ipt1.lisous(/1))=ipt2
  330. segdes ipt2
  331. do 125 is=1,ipt1.lisous(/1)-1
  332. ipt2=ipt1.lisous(is)
  333. segini,ipt3=ipt2
  334. segdes ipt2
  335. * SG 2011/10/07 on a échangé l'ordre des boucles pour le remettre dans
  336. * l'ordre "usuel"
  337. do il=1,ipt3.num(/2)
  338. do ip=1,ipt3.num(/1)
  339. ipt3.num(ip,il)=icpren(ipt3.num(ip,il))
  340. enddo
  341. enddo
  342. segdes ipt3
  343. ipt1.lisous(is)=ipt3
  344. 125 continue
  345. if (ipt1.lisous(/1).eq.1) goto 131
  346. segdes ipt1
  347. do 130 ip=npreco-1,1,-1
  348. prenum(ip+1)=prenum(ip)
  349. 130 continue
  350. prenum(1)=ipt1
  351. 131 continue
  352. if (icpren.ne.0) segsup icpren,idcp
  353. segact icpr*mod
  354. * write (6,*) ' fin de numopt '
  355. * write (6,*) (icpr(i),i=1,icpr(/1))
  356. *
  357. RETURN
  358. END
  359.  
  360.  
  361.  

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