Télécharger rlenso.eso

Retour à la liste

Numérotation des lignes :

rlenso
  1. C RLENSO SOURCE OF166741 24/12/13 21:17:25 12097
  2. SUBROUTINE RLENSO(MELFL,MELFP,MELSOM,MLEPOI)
  3. C************************************************************************
  4. C
  5. C PROJET : CASTEM 2000
  6. C
  7. C NOM : RLENSO
  8. C
  9. C DESCRIPTION : Appelle par GRADI2
  10. C
  11. C LANGAGE : FORTRAN 77 + ESOPE 2000 (avec extensions CISI)
  12. C
  13. C AUTEUR : A. BECCANTINI
  14. C
  15. C************************************************************************
  16. C
  17. C
  18. C Inputs:
  19. C MELFL : facel of domaine table
  20. C MELFP : facep of domaine table
  21. C MELSOM : sommet of the domaine table
  22. C
  23. C Outputs:
  24. C MLEPOI : list of integers.
  25. C MLEPOI.LECT(I) is the pointer of the list of integers
  26. C MLENTI which contains the neighbors of the i-th sommet
  27. C point.
  28. C
  29. IMPLICIT INTEGER(I-N)
  30. INTEGER NSOMM, NBSOUS, NBELEM, NBNO
  31. & , IELEM, NGF, NGF1, INOEU, NGS1, NLS1, ISOUS
  32. & , IELEMF, NGC1, NGC2, NELT, NELTT, I1
  33. C
  34. -INC SMELEME
  35. INTEGER JG
  36. -INC SMLENTI
  37.  
  38. -INC PPARAM
  39. -INC CCOPTIO
  40. C
  41. POINTEUR MELSOM.MELEME, MELFL.MELEME, MELFP.MELEME, MELFP1.MELEME
  42. & ,MLESOM.MLENTI, MLEFP.MLENTI, MTOUC.MLENTI, MTOUC2.MLENTI
  43. & ,MLEPOI.MLENTI
  44. C
  45. C**** Le MELEME SOMMET
  46. C
  47. CALL KRIPAD(MELSOM,MLESOM)
  48. C
  49. C MLESOM: numerotation globale -> locale
  50. C
  51. C**** En KRIPAD
  52. C SEGACT MELSOM
  53. C SEGINI MLESOM
  54. C
  55. NSOMM = MELSOM.NUM(/2)
  56. JG=NSOMM
  57. SEGINI MTOUC
  58. SEGINI MTOUC2
  59. C MTOUC.LECT(NLS1) = estimation of the number of neighbors for NLS1
  60. C MTOUC2.LECT(NLS1) = how many times NLS1 is touched
  61. C
  62. SEGACT MELFP
  63. C
  64. C**** En 2D MELFP est un maillage elementaire
  65. C En 3D pas à priori
  66. C -> MLEFP contains the list of LISOUS
  67. C
  68. NBSOUS=MELFP.LISOUS(/1)
  69. C NBSOUS=0 fais un peux chier!
  70. JG=MAX(NBSOUS,1)
  71. SEGINI MLEFP
  72. IF(NBSOUS .EQ. 0)THEN
  73. MLEFP.LECT(1)=MELFP
  74. ELSE
  75. DO ISOUS=1,NBSOUS,1
  76. MLEFP.LECT(ISOUS)=MELFP.LISOUS(ISOUS)
  77. ENDDO
  78. ENDIF
  79. SEGDES MELFP
  80. C
  81. SEGACT MELFL
  82. NBSOUS=MELFL.LISOUS(/1)
  83. IF(NBSOUS .NE. 0)THEN
  84. WRITE(IOIMP,*) 'FACEL = ???'
  85. WRITE(IOIMP,*) 'Subroutine rlenso.eso'
  86. CALL ERREUR(5)
  87. GOTO 9999
  88. ENDIF
  89. C
  90. IELEMF=0
  91. NBSOUS=MLEFP.LECT(/1)
  92. DO ISOUS = 1, NBSOUS, 1
  93. MELFP1=MLEFP.LECT(ISOUS)
  94. SEGACT MELFP1
  95. NBELEM=MELFP1.NUM(/2)
  96. NBNO=MELFP1.NUM(/1) - 1
  97. C
  98. C The first ISOUS of 'FACEP' has NBELEM elements which contain
  99. C NBNO sommets and one point face. Each time a 'sommet' point is
  100. C touched, there are at most two neighbors of him.
  101. C
  102. DO IELEM = 1, NBELEM,1
  103. IELEMF=IELEMF+1
  104. NGF=MELFP1.NUM(NBNO+1,IELEM)
  105. NGF1=MELFL.NUM(2,IELEMF)
  106. IF(NGF .NE. NGF1)THEN
  107. WRITE(IOIMP,*) 'FACEL = ???'
  108. WRITE(IOIMP,*) 'Subroutine rlenso.eso'
  109. CALL ERREUR(5)
  110. GOTO 9999
  111. ENDIF
  112. C
  113. C Loop involving the sommet noeuds of the element of
  114. C FACEP
  115. C
  116. DO INOEU = 1, NBNO, 1
  117. NGS1 = MELFP1.NUM(INOEU,IELEM)
  118. NLS1 = MLESOM.LECT(NGS1)
  119. MTOUC2.LECT(NLS1)=MTOUC2.LECT(NLS1)+1
  120. ENDDO
  121. ENDDO
  122. ENDDO
  123. C
  124. C**** MTOUC2.LECT(NLS1) says us how many times NLS1 is touched
  125. C Apart from the first interface, normally each
  126. C interface adds just one new neighbor and not two.
  127. C I create NSOMM MLENTI which contain the list of neighbors.
  128. C MLEPOI contains the number of their pointers
  129. C
  130. JG=NSOMM
  131. SEGINI MLEPOI
  132. DO INOEU=1,NSOMM,1
  133. JG=MTOUC2.LECT(INOEU)+1
  134. SEGINI MLENTI
  135. C MTOUC.LECT(INOEU) says how many places are in each MLENTI
  136. MTOUC.LECT(INOEU)=JG
  137. MLEPOI.LECT(INOEU)=MLENTI
  138. MTOUC2.LECT(INOEU)=0
  139. ENDDO
  140. C
  141. IELEMF=0
  142. NBSOUS=MLEFP.LECT(/1)
  143. DO ISOUS = 1, NBSOUS, 1
  144. MELFP1=MLEFP.LECT(ISOUS)
  145. NBELEM=MELFP1.NUM(/2)
  146. NBNO=MELFP1.NUM(/1) - 1
  147. C
  148. C The first ISOUS of 'FACEP' has NBELEM elements which contain
  149. C NBNO sommets and one point face. Each time a 'sommet' point is
  150. C touched, there are at most two neighbors of him. As already
  151. C mentioned, normally each interface adds just one new neighbor
  152. C and not two.
  153. C
  154. DO IELEM = 1, NBELEM,1
  155. IELEMF=IELEMF+1
  156. NGF=MELFP1.NUM(NBNO+1,IELEM)
  157. NGF1=MELFL.NUM(2,IELEMF)
  158. NGC1=MELFL.NUM(1,IELEMF)
  159. NGC2=MELFL.NUM(3,IELEMF)
  160. IF(NGC1 .NE. NGC2)THEN
  161. C
  162. C************* Internal face
  163. C
  164. C Loop involving the sommet noeuds of the element of
  165. C FACEP
  166. C
  167. DO INOEU = 1, NBNO, 1
  168. NGS1 = MELFP1.NUM(INOEU,IELEM)
  169. NLS1 = MLESOM.LECT(NGS1)
  170. C
  171. C**************** POINT NGC1: does it already belong to the list?
  172. C
  173. C NELT says how many neighbors are already in
  174. C MLEPOI.LECT(NLS1)
  175. C NELTT is the dimension of MLEPOI.LECT(NLS1)
  176. C
  177. NELT=MTOUC2.LECT(NLS1)
  178. NELTT=MTOUC.LECT(NLS1)
  179. MLENTI = MLEPOI.LECT(NLS1)
  180. DO I1 = 1, NELT, 1
  181. IF(MLENTI.LECT(I1).EQ.NGC1) GOTO 1
  182. ENDDO
  183. C
  184. C**************** It does not
  185. C
  186. IF(NELT .LT. NELTT)THEN
  187. MTOUC2.LECT(NLS1)=NELT+1
  188. MLENTI.LECT(NELT+1)=NGC1
  189. NELT=NELT+1
  190. ELSE
  191. C******************* Dimension of MLENTI too little
  192. NELT=NELT+1
  193. NELTT= NELTT+1
  194. JG=NELTT
  195. SEGADJ MLENTI
  196. MTOUC2.LECT(NLS1)=JG
  197. MTOUC.LECT(NLS1)=JG
  198. MLENTI.LECT(JG)=NGC1
  199. ENDIF
  200. C
  201. C**************** It does not
  202. C
  203. 1 CONTINUE
  204. C
  205. C**************** The same for NGC2
  206. C
  207. DO I1 = 1, NELT, 1
  208. IF(MLENTI.LECT(I1).EQ.NGC2) GOTO 2
  209. ENDDO
  210. C
  211. C**************** The point does not already belong to this element
  212. C
  213. IF(NELT .LT. NELTT)THEN
  214. MTOUC2.LECT(NLS1)=NELT+1
  215. MLENTI.LECT(NELT+1)=NGC2
  216. ELSE
  217. C
  218. C******************* Dimension of MLENTI too little
  219. C
  220. JG=NELTT+1
  221. SEGADJ MLENTI
  222. MTOUC2.LECT(NLS1)=JG
  223. MTOUC.LECT(NLS1)=JG
  224. MLENTI.LECT(JG)=NGC2
  225. ENDIF
  226. C
  227. C**************** The point already belongs to this element
  228. C Nothing to do
  229. C
  230. 2 CONTINUE
  231. ENDDO
  232. ELSE
  233. C
  234. C************* Boundary face
  235. C
  236. C Loop involving the sommet noeuds of the element of
  237. C FACEP
  238. C
  239. DO INOEU = 1, NBNO, 1
  240. NGS1 = MELFP1.NUM(INOEU,IELEM)
  241. NLS1 = MLESOM.LECT(NGS1)
  242. NELT=MTOUC2.LECT(NLS1)
  243. NELTT=MTOUC.LECT(NLS1)
  244. MLENTI = MLEPOI.LECT(NLS1)
  245. C
  246. C**************** POINT NGF cannot belongs to the list
  247. C
  248. IF(NELT .LT. NELTT)THEN
  249. MTOUC2.LECT(NLS1)=NELT+1
  250. MLENTI.LECT(NELT+1)=NGF
  251. NELT=NELT+1
  252. ELSE
  253. C******************* Dimension of MLENTI too little
  254. NELT=NELT+1
  255. NELTT= NELTT+1
  256. JG=NELTT
  257. SEGADJ MLENTI
  258. MTOUC2.LECT(NLS1)=JG
  259. MTOUC.LECT(NLS1)=JG
  260. MLENTI.LECT(JG)=NGF
  261. ENDIF
  262. C
  263. C**************** What about NGC1?
  264. C
  265. DO I1 = 1, NELT, 1
  266. IF(MLENTI.LECT(I1).EQ.NGC1) GOTO 3
  267. ENDDO
  268. C
  269. C**************** The point does not already belong to this element
  270. C
  271. IF(NELT .LT. NELTT)THEN
  272. MTOUC2.LECT(NLS1)=NELT+1
  273. MLENTI.LECT(NELT+1)=NGC1
  274. ELSE
  275. C
  276. C******************* Dimension of MLENTI too little
  277. C
  278. JG=NELTT+1
  279. SEGADJ MLENTI
  280. MTOUC2.LECT(NLS1)=JG
  281. MTOUC.LECT(NLS1)=JG
  282. MLENTI.LECT(JG)=NGC1
  283. ENDIF
  284. C
  285. C**************** The point already belongs to this element
  286. C Nothing to do
  287. C
  288. 3 CONTINUE
  289. ENDDO
  290. ENDIF
  291. ENDDO
  292. SEGDES MELFP1
  293. ENDDO
  294. C
  295. C**** We eliminate the 0 into the MLENTI of
  296. C MLEPOI.LECT(NL sommet)
  297. C
  298. DO INOEU=1,NSOMM,1
  299. MLENTI=MLEPOI.LECT(INOEU)
  300. NELT=MTOUC2.LECT(INOEU)
  301. NELTT=MTOUC.LECT(INOEU)
  302. DO I1=(NELT+1),NELTT,1
  303. IF(MLENTI.LECT(I1) .NE. 0)THEN
  304. C
  305. C************* There is an error somewhere
  306. C
  307. WRITE(IOIMP,*) 'Subroutine rlenso.eso'
  308. CALL ERREUR(5)
  309. GOTO 9999
  310. ENDIF
  311. ENDDO
  312. JG=NELT
  313. SEGADJ MLENTI
  314. SEGDES MLENTI
  315. ENDDO
  316. C
  317. C**** Test
  318. C
  319. C DO INOEU=1,NSOMM,1
  320. C MLENTI=MLEPOI.LECT(INOEU)
  321. C NELT=MLENTI.LECT(/1)
  322. C write (*,*) 'ngs =', MELSOM.NUM(1,INOEU)
  323. C write (*,*) (mlenti.lect(i2),i2=1,nelt)
  324. C ENDDO
  325. C
  326. SEGSUP MTOUC
  327. SEGSUP MTOUC2
  328. C
  329. SEGSUP MLESOM
  330. SEGDES MELSOM
  331. C
  332. SEGSUP MLEFP
  333. C
  334. SEGDES MELFL
  335. SEGDES MLEPOI
  336. C
  337. 9999 RETURN
  338. END
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  

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