Télécharger rlenso.eso

Retour à la liste

Numérotation des lignes :

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

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