Télécharger regene.eso

Retour à la liste

Numérotation des lignes :

regene
  1. C REGENE SOURCE GOUNAND 21/04/13 21:15:12 10956
  2. SUBROUTINE REGENE ( IPTT )
  3. IMPLICIT INTEGER(I-N)
  4.  
  5. -INC PPARAM
  6. -INC CCOPTIO
  7. -INC SMELEME
  8. -INC CCGEOME
  9. SEGMENT INOU(0)
  10. PARAMETER ( NKNE1=292)
  11. PARAMETER ( NKNE2=121)
  12. PARAMETER ( NKNEL=NKNE1+NKNE2)
  13. DIMENSION KNEL1(NKNE1),KNEL2(NKNE2),KNEL(NKNEL)
  14. EQUIVALENCE ( KNEL(1),kNEL1(1)),(KNEL(293),KNEL2(1))
  15. DIMENSION KST(26),KPS1(2,26),KS1(2,45),KPI1(45) ,KPS2(2,26)
  16. DIMENSION KSTT(6) ,KS2(2,38),KPI2(38)
  17. logical ltelq,FLNOVE
  18. CHARACTER*4 MOVERI(1)
  19. C
  20. C KST DONNE LE SOUS TYPE , KPS1(1, ) DONNE LE NB DE SEGMENT A TESTER
  21. C KPS1(2, ) DONNE LA PLACE DANS LE TABLEAU KS1(KPS1(2,1) = 1)
  22. C KS1(2, ) DONNE LES SEGMENTS A TESTER,KPI1(NKS1) SI NEGATIF DIT OU SE
  23. C METTRE DANS KNEL POUR FABRIQUER LE NOUVEL ELEMENT SI POSITIF DIT OU S
  24. C POSITIONNER DANS KPS2 POUR TESTS COMPLEMENTAIRES
  25. C
  26. c CREATION : ???
  27. C #2204 chat, 1996/07/01 : regeneration des prismes en tetra et pyramides
  28. c # bp, 2013/02/05 : SEG2->POI1 + ajout commentaires + ajout verif
  29. c
  30. c rem : tout n'est pas possible, car on peut obtenir des polygones et
  31. c polyhedres inconnu dans castem (ex.1 : qua4 avec 1 point sur l'axe
  32. c + volu rota -> on obtient un polyhedre à 7 noeuds // ex.2: pri6 avec
  33. c seulement noeud 1 = noeud 2 -> polyhedre à 5 noeuds avec 2 faces tri3
  34. c et 2 faces qua4)
  35. c
  36. C rappel de numgeo : ITYPEL=
  37. c 1 POI1, 2 SEG2, 3 SEG3, 4 TRI3, 5 TRI4, 6 TRI6, 7 TRI7,
  38. c 8 QUA4, 9 QUA5, 10 QUA8, 11 QUA9, 12 RAC2, 13 RAC3,
  39. c 14 CUB8, 15 CU20, 16 PRI6, 17 PR15, 18 LIA3, 19 LIA4, 20 LIA6, 21 LIA8,
  40. c 22 MULT, 23 TET4, 24 TE10, 25 PYR5, 26 PY13, ...
  41.  
  42. C 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
  43. DATA KST/0,1,2,2,2,3,3,4,4,6 ,6 , 0, 0,16,17,-1,-4,
  44. # 0,0,0,0,0,0,0,0,0/
  45. DATA KSTT/2,23,25,2,24,26/
  46. C 1 2 3 4 5 6 7 8 9 10 11 12 13
  47. DATA KPS1/0,0,1,45,2,33,3,1,3,1,3,4,3,4,4,7,4,7,4,11,4,11,0,0,0,0,
  48. C 14 15 16 17 18 19 20 21 22 23 24 25 26
  49. # 9,15,9,24,5,35,5,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
  50. c 1 4 7 11
  51. DATA KS1/1,2,1,3,2,3, 1,3,1,5,3,5, 1,2,1,4,2,3,3,4, 1,3,1,7,3,5,
  52. c 15 24
  53. # 5,7, 1,2,1,4,1,5,2,3,2,6,3,4,3,7,5,6,5,8, 1,3,1,7,1,13,3,5,3,15,
  54. c 33 35 40
  55. # 5,7,5,17,13,15,13,19, 1,2,2,3, 1,2,4,5,1,4,2,5,3,6, 1,3,10,12,
  56. c 45
  57. # 1,10,3,12,5,14, 1,2/
  58. c 1 4 7 11
  59. DATA KPI1/-1, -3, -3, -5, -8, -8,-11, -14, -11, -14, -17, -23,
  60. c 15 24 33
  61. # -29, -35 ,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, -1,-3,
  62. c 35 40 45
  63. # 19,20,21,22,-319,23,24,25,26,-400, -413/
  64. c 1 ... ... 9
  65. DATA KPS2/2,1,2,3,2,5,1,7,1,8,1,9,1,10,1,11,1,12,
  66. c 10 ... ... 18
  67. # 2,13,2,15,2,17,1,19,1,20,1,21,1,22,1,23,1,24,
  68. c 19 ... 22
  69. # 1,25,1,26,3,27,2,30,
  70. c 23 ... 26
  71. # 1,32,1,33,3,34,2,37/
  72. c 1 2 3 4 5 6 7 8 9
  73. DATA KS2/4,3,5,6, 2,3,5,8, 4,8,2,6, 6,7,3,7,7,8,4,8,7,8,6,7,
  74. c 10 11 12 13 14 15 16 17 18
  75. # 7,5,13,15,3,5,13,19,7,19,3,15,15,17,5,17,17,19,7,19,17,19,15,17,
  76. c 19 20 21 22 23 24 25 26
  77. # 1,3,4,6,2,5,3,6,0,0,3,6,0,0,1,5,10,14,3,12,5,14,0,0,5,14,0,0/
  78. c 1 2 3 4 5 6 7 8 9
  79. DATA KPI2/-41 ,-47, -53,-59, -65,-71, -77,-83,-89,-95,-101,-107,
  80. c 10 11 12 13 14 15 16 17 18
  81. # -113,-128,-143,-158,-173,-188,-203,-218,-233,-248,-263,-278,
  82. c 19 20 21 22 23 24 25
  83. # -293,-297,-301,-305,-309,-297,-314,-324,-334,-344,-354,
  84. c 26
  85. # -374,-364,-387/
  86. DATA KNEL1/1,3, 1,2, 1,4,5, 1,2,3, 1,3,4, 1,2,3, 1,4,5,6,7,8,
  87. # 1,2,3,4,5,6, 1,2,3,6,7,8 ,1,2,3,4,7,8,
  88. # 1,6,5,3,7,8, 1,3,4,5,7,8, 1,8,5,2,7,6, 1,2,3,5,6,7,
  89. # 1,6,2,4,7,3, 1,4,8,2,3,7, 1,2,4,5,6,8, 1,5,2,4,8,3,
  90. # 1,2,3,5,6,7, 1,4,5,2,3,6, 1,5,2,4,7,3, 1,4,8,2,3,6,
  91. # 1,10,15,14,13,9,8,16,20,7,11,17,18,19,12,
  92. # 1,4,5,6,7,8,9,11,12,13,16,17,18,19,20,
  93. # 1,12,19,20,13,9,2,18,14,3,11,17,16,15,10,
  94. # 1,2,3,4,5,6,9,10,11,13,14,15,16,17,18,
  95. # 1,14,15,10,3,2,8,16,4,7,18,17,11,5,6,
  96. # 1,8,7,12,19,20,2,6,18,3,4,5,11,17,16,
  97. # 1,2,3,6,7,8,9,10,12,13,14,15,18,19,20,
  98. # 1,9,13,14,15,2,8,20,16,7,12,19,18,17,6,
  99. # 1,2,3,4,5,8,9,10,11,13,14,15,16,17,20,
  100. # 1,8,7,20,13,9,2,6,14,3,4,5,16,15,10,
  101. # 1,9,13,10,3,2,8,20,4,7,12,19,11,5,6,
  102. # 1,8,7,12,19,9,2,6,18,3,4,5,11,17,10/
  103. DATA KNEL2/4,6,5,1, 1,2,3,4, 1,2,3,6, 1,2,3,5,
  104. # 2,3,6,5,1, 1,3,6,4,2, 1,2,5,4,3,
  105. # 10,15,14,13,12,11,7,9,8,1, 1,2,3,4,5,6,7,8,9,10,
  106. # 1,2,3,4,5,6,15,13,9,14, 1,2,3,4,5,6,11,8,13,12,
  107. # 1,2,3,4,5,6,7,11,15,10,
  108. # 3,4,5,9,14,13,12,8,2,6,15,11,1, 1,6,5,9,14,15,10,7,2,4,13,11,3,
  109. # 1,2,3,8,12,11,10,7,6,4,13,15,5,
  110. # 1/
  111. DATA MOVERI/'VERI'/
  112. cbp : ajout possibilite de verifier
  113. IVERI=0
  114. CALL LIRMOT(MOVERI,1,IVERI,0)
  115. FLNOVE=(IVERI.eq.0)
  116. C DEBUT PROGRAMME
  117. IPT1=IPTT
  118. SEGACT IPT1
  119. MELEME=IPT1
  120. NBSO=LISOUS(/1)
  121. SEGINI INOU
  122. NBREF=0
  123. NBSOUS=0
  124. DO 1 II= 1,MAX(1,NBSO)
  125. IF (NBSO.NE.0) THEN
  126. MELEME=IPT1.LISOUS(II)
  127. SEGACT MELEME
  128. ENDIF
  129. IPT7=0
  130. IF(IIMPI.NE.0) WRITE(IOIMP,500) ITYPEL,KST(ITYPEL)
  131. 500 FORMAT(' ITYPEL KST(ITYPEL) ',2I5)
  132. IF(KST(ITYPEL).EQ.0) INOU(**)=MELEME
  133. IF(KST(ITYPEL).EQ.0) GO TO 1000
  134. IA= KPS1(1,ITYPEL)
  135. NBELEM=NUM(/2)
  136. NBNN=NUM(/1)
  137. SEGINI IPT2
  138. IF( KST(ITYPEL).GT.0) THEN
  139. NBNN=NBNNE(KST(ITYPEL))
  140. SEGINI IPT3
  141. IPT3.ITYPEL=KST(ITYPEL)
  142. ELSE
  143. IPO = -KST(ITYPEL)
  144. NPO = KSTT(IPO)
  145. NBNN = NBNNE( KSTT(IPO + 1))
  146. SEGINI IPT3
  147. IPT3.ITYPEL=KSTT(IPO + 1)
  148. NBNN = NBNNE ( KSTT(IPO+2))
  149. SEGINI IPT7
  150. IPT7.ITYPEL=KSTT(IPO + 2)
  151. IF( NPO . GT . 2) THEN
  152. CALL ERREUR(19)
  153. RETURN
  154. ENDIF
  155. ENDIF
  156. IF(IIMPI.NE.0) WRITE(IOIMP,501) IA,NBNN
  157. 501 FORMAT(' NB DE SEGMENT A TESTER,NB NOEUD DU SOUS TYPE',2I5)
  158. IPT2.ITYPEL=ITYPEL
  159. IEL2=0
  160. IEL3=0
  161. IEL7=0
  162. C==== BOUCLE SUR LES ELEMENTS ========
  163. DO 3 JJ=1,NBELEM
  164. IB=KPS1(2,ITYPEL) -1
  165. DO 4 J=1,IA
  166. IB=IB+1
  167. IF(IIMPI.GE.5) WRITE(IOIMP,*) 'ON TESTE ',KS1(1,IB),KS1(2,IB)
  168. IF( NUM(KS1(1,IB),JJ) .NE. NUM(KS1(2,IB),JJ) ) GO TO 4
  169. C ** ON A TROUVER UNE EGALITE DE NOEUD. FAUT-IL FAIRE D'AUTRES TESTS
  170. C
  171. IT1=KPI1(IB)
  172. IF(IT1.LT.0) GO TO 100
  173. C TESTS COMPLEMENTAIRES
  174. IC=KPS2(1,IT1)
  175. ID=KPS2(2,IT1)-1
  176. DO 5 K=1,IC
  177. ID=ID+1
  178. IF(IIMPI.GE.5) WRITE(IOIMP,*) 'on teste ',KS2(1,ID),KS2(2,ID)
  179. IF(KS2(1,ID).EQ.0) GO TO 51
  180. IF( NUM(KS2(1,ID),JJ) .NE. NUM(KS2(2,ID),JJ) ) GO TO 5
  181. 51 CONTINUE
  182. IT2=KPI2(ID)
  183. IF(IT2.LT.0) IT1=IT2
  184. IF(IT2.LT.0) GO TO 100
  185. 5 CONTINUE
  186. C UN POINT DOUBLE MAIS PAS LES TESTS COMPLEMENTAIRES
  187. INTERR(1)=JJ
  188. CALL ERREUR(-303)
  189. 4 CONTINUE
  190. IF(IIMPI.NE.0) WRITE(IOIMP,502) JJ
  191. 502 FORMAT(' ELEM NUMERO ' ,I5,' PAS CHANGE ')
  192. C PAS DE PTS DOUBLE ON RECOPIE
  193. IEL2=IEL2+1
  194. DO 6 L=1,NUM(/1)
  195. IPT2.NUM(L,IEL2)=NUM(L,JJ)
  196. c bp : ajout verif
  197. if(FLNOVE) goto 6
  198. if(L.le.1) goto 6
  199. do 62 L2=1,(L-1)
  200. if(IPT2.NUM(L2,IEL2).ne.IPT2.NUM(L,IEL2)) goto 62
  201. WRITE(IOIMP,*) 'Cas non prevu pour le maillage',IPT2
  202. INTERR(1)=IEL2
  203. CALL ERREUR(-303)
  204. 62 continue
  205. 6 CONTINUE
  206. IPT2.ICOLOR(IEL2)=ICOLOR(JJ)
  207. GO TO 3
  208. 100 CONTINUE
  209. IPT5=IPT3
  210. IEL3=IEL3+1
  211. IEL5=IEL3
  212. c cas particulier ou on a le choix entre 2 type d elements
  213. c ex : PRI6 -> TET4 ou PYR5
  214. IF( IPT7.NE.0) THEN
  215. IF(IT1.EQ.-309.OR.IT1.EQ.-314.OR.IT1.EQ.-319.OR.IT1.EQ.-374
  216. # .OR.IT1.EQ.-387.OR.IT1.EQ.-400) THEN
  217. IPT5=IPT7
  218. IEL3=IEL3-1
  219. IEL7=IEL7+1
  220. IEL5=IEL7
  221. ENDIF
  222. ENDIF
  223. IPT5.ICOLOR(IEL5)=ICOLOR(JJ)
  224. IT1=-IT1
  225. IF(IIMPI.NE.0) WRITE(IOIMP,503) JJ
  226. 503 FORMAT(' ELEM NUMERO ' ,I5,' CHANGER ')
  227. DO 101 L=1,IPT5.NUM(/1)
  228. IPT5.NUM(L,IEL5)=NUM(KNEL(IT1),JJ)
  229. IT1=IT1+1
  230. c bp : ajout verif
  231. if(FLNOVE) goto 101
  232. if(L.le.1) goto 101
  233. do 102 L2=1,(L-1)
  234. if(IPT5.NUM(L2,IEL5).ne.IPT5.NUM(L,IEL5)) goto 102
  235. WRITE(IOIMP,*) 'Cas non prevu pour le maillage',IPT5
  236. INTERR(1)=IEL5
  237. CALL ERREUR(-303)
  238. 102 continue
  239. 101 CONTINUE
  240. 3 CONTINUE
  241. C==== FIN DE BOUCLE SUR LES ELEMENTS ========
  242. C
  243. C ** ON REGARDE SI IPT2 ET IPT3 EXISTE VRAIMENT PUIS ON LES RECREE
  244. C ** A LA BONNE DIMENSION
  245. C
  246. IF(IEL2.EQ.0) GO TO 10
  247. IF(IEL2.EQ.NUM(/2)) THEN
  248. INOU(**)=MELEME
  249. SEGSUP IPT2,IPT3
  250. IF(IPT7.NE.0) SEGSUP IPT7
  251. GO TO 1000
  252. ELSE
  253. NBNN=IPT2.NUM(/1)
  254. NBELEM=IEL2
  255. SEGINI IPT4
  256. DO 11 K=1,IEL2
  257. IPT4.ICOLOR(K)=IPT2.ICOLOR(K)
  258. DO 11 L=1,NBNN
  259. IPT4.NUM(L,K)=IPT2.NUM(L,K)
  260. 11 CONTINUE
  261. IPT4.ITYPEL=IPT2.ITYPEL
  262. SEGSUP IPT2
  263. INOU(**)=IPT4
  264. SEGDES IPT4
  265. ENDIF
  266. 10 CONTINUE
  267. IF(IEL3.EQ.NUM(/2)) THEN
  268. INOU(**)=IPT3
  269. SEGDES IPT3
  270. SEGSUP IPT2
  271. IF(IPT7.NE.0) SEGSUP IPT7
  272. GO TO 1000
  273. ELSE
  274. NBNN=IPT3.NUM(/1)
  275. NBELEM=IEL3
  276. SEGINI IPT4
  277. DO 12 K=1,NBELEM
  278. IPT4.ICOLOR(K)=IPT3.ICOLOR(K)
  279. DO 12 L=1,NBNN
  280. IPT4.NUM(L,K)=IPT3.NUM(L,K)
  281. 12 CONTINUE
  282. IPT4.ITYPEL=IPT3.ITYPEL
  283. SEGSUP IPT3
  284. SEGDES IPT4
  285. IF(IEL3.NE.0) INOU(**)=IPT4
  286. ENDIF
  287. IF(IEL7.EQ.NUM(/2)) THEN
  288. INOU(**)=IPT7
  289. SEGDES IPT7
  290. SEGSUP IPT3
  291. SEGSUP IPT2
  292. GO TO 1000
  293. ELSE
  294. C# MC 03/11/97 : on passe ici avec IPT7=0 dans kp2_test.dgibi
  295. IF(IPT7.NE.0) THEN
  296. NBNN=IPT7.NUM(/1)
  297. NBELEM=IEL7
  298. SEGINI IPT4
  299. DO 13 K=1,NBELEM
  300. IPT4.ICOLOR(K)=IPT7.ICOLOR(K)
  301. DO 13 L=1,NBNN
  302. IPT4.NUM(L,K)=IPT7.NUM(L,K)
  303. 13 CONTINUE
  304. IPT4.ITYPEL=IPT7.ITYPEL
  305. SEGSUP IPT7
  306. SEGDES IPT4
  307. IF(IEL7.NE.0)INOU(**)=IPT4
  308. ENDIF
  309. ENDIF
  310.  
  311. 1000 CONTINUE
  312. IF(NBSO.NE.0) SEGDES MELEME
  313. 1 CONTINUE
  314. II=INOU(/1)
  315. IF(II.EQ.0) THEN
  316. IRETOU=IPT1
  317. GO TO 15
  318. ENDIF
  319. IRETOU=INOU(1)
  320. IF(II.EQ.1) GO TO 15
  321. DO 16 J=2,II
  322. INN=INOU(J)
  323. ltelq=.false.
  324. CALL FUSE( IRETOU,INN,IPT5,ltelq)
  325. IRETOU=IPT5
  326. 16 CONTINUE
  327. 15 CONTINUE
  328. IPTT=IRETOU
  329. RETURN
  330. END
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  

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