Télécharger rlenct.eso

Retour à la liste

Numérotation des lignes :

rlenct
  1. C RLENCT SOURCE OF166741 24/12/13 21:17:24 12097
  2. SUBROUTINE RLENCT(MELFL,MELSOM,MLEPOI,MLECOE,MLEPOF,MLECOF)
  3. C************************************************************************
  4. C
  5. C PROJET : CASTEM 2000
  6. C
  7. C NOM : RLENCT
  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 This subroutine computes the coefficients to compute the gradient
  19. C at intefaces with respect to the values on its neighbors.
  20. C The neighbors are 'CENTRE' points or 'boundary condition' points.
  21. C
  22. C**** Inputs:
  23. C
  24. C MELFL = 'FACEL' meleme
  25. C
  26. C MELSOM = 'SOMMET' meleme
  27. C
  28. C MLEPOI = list of integers.
  29. C MLEPOI.LECT(i) points to the list neighbors of
  30. C MELSOM.NUM(1,I). Neighbors are 'CENTRE' points or
  31. C 'boundary condition' points
  32. C MLECOE = list of integers.
  33. C MLECOE.LECT(i) points to the list of real of coeffients
  34. C to compute the vertex values
  35. C
  36. C MLEPOF = list of integers.
  37. C MLEPOI.LECT(i) points to the list neighbors of
  38. C MELFL.NUM(2,i). Neighbors are 'CENTRE' points or
  39. C 'SOMMET' points.
  40. C MLECOF = list of integers.
  41. C MLECOE.LECT(i) points to the matrix of coeffients to
  42. C compute the gradient with respect the neighbors value
  43. C
  44. C**** Output:
  45. C
  46. C MLEPOF = list of integers.
  47. C MLEPOI.LECT(i) points to the list neighbors of
  48. C MELFL.NUM(2,i). Neighbors are 'CENTRE' points or
  49. C 'boundary condition' points. The first one is the
  50. C 'FACE' point itself.
  51. C MLECOE = list of integers.
  52. C MLECOE.LECT(i) points to the matrix of coeffients to
  53. C compute the gradient
  54. C
  55. IMPLICIT INTEGER(I-N)
  56.  
  57. -INC PPARAM
  58. -INC CCOPTIO
  59. -INC SMCOORD
  60. -INC SMLENTI
  61. -INC SMLREEL
  62. -INC SMELEME
  63. C
  64. INTEGER NTP, NFAC, IFAC, NVOIF, IVOIF, NGV, NLS, NLV
  65. & ,NVOIS,IVOIS,NGVS, LAST, LAST0, NSOMM, IPOS
  66. & ,I1,ICELL,NGF
  67. REAL*8 CELL
  68. INTEGER JG
  69. INTEGER N1,N2
  70. SEGMENT MATRIX
  71. REAL*8 MAT(N1,N2)
  72. ENDSEGMENT
  73. POINTEUR MELSOM.MELEME, MLEPOI.MLENTI,MLECOE.MLENTI, MELFL.MELEME
  74. & ,MLEPOF.MLENTI,MLECOF.MLENTI
  75. & ,MATCOE.MATRIX,MATCO1.MATRIX,MLRCOE.MLREEL,MLREST.MLENTI
  76. & ,MLESOM.MLENTI,MLPOSI.MLENTI
  77. C
  78. C
  79. SEGACT MELFL
  80. C
  81. NTP=nbpts
  82. C
  83. C**** Chaining list
  84. C LAST
  85. C MLREST(NTP)
  86. C
  87. JG=NTP
  88. SEGINI MLREST
  89. LAST=-1
  90. C
  91. C**** Position of a point in the list of neighbors
  92. C MLREST is used to clean it at the end
  93. C
  94. JG=NTP
  95. SEGINI MLPOSI
  96. C
  97. C**** We create the MLENTI for the sommets
  98. C
  99. CALL KRIPAD(MELSOM,MLESOM)
  100. IF(IERR .NE. 0)GOTO 9999
  101. C En KRIPAD
  102. C SEGACT MELSOM
  103. C SEGINI MLESOM
  104. C
  105. SEGACT MLEPOF*MOD
  106. NFAC=MLEPOF.LECT(/1)
  107. SEGACT MLECOF*MOD
  108. C
  109. SEGACT MLEPOI
  110. SEGACT MLECOE
  111. C
  112. NSOMM=MLEPOI.LECT(/1)
  113. DO I1=1,NSOMM,1
  114. MLENTI=MLEPOI.LECT(I1)
  115. SEGACT MLENTI
  116. MLREEL=MLECOE.LECT(I1)
  117. SEGACT MLREEL
  118. ENDDO
  119. C
  120. DO IFAC=1,NFAC,1
  121. NGF=MELFL.NUM(2,IFAC)
  122. MLENT1=MLEPOF.LECT(IFAC)
  123. SEGACT MLENT1
  124. NVOIF=MLENT1.LECT(/1)
  125. C
  126. C******* We fill MLREST, MLPOSI
  127. C
  128. LAST=-1
  129. IPOS=1
  130. MLREST.LECT(NGF)=LAST
  131. LAST=NGF
  132. DO IVOIF=1,NVOIF,1
  133. NGV=MLENT1.LECT(IVOIF)
  134. C
  135. C********** First of all, we have to check if this is a
  136. C 'SOMMET' point. In that case we have to replace
  137. C it by its neighbors.
  138. C
  139. NLS=MLESOM.LECT(NGV)
  140. C
  141. IF(NLS .GT. 0)THEN
  142. C 'SOMMET'
  143. MLENT2=MLEPOI.LECT(NLS)
  144. NVOIS=MLENT2.LECT(/1)
  145. DO IVOIS=1,NVOIS,1
  146. NGVS=MLENT2.LECT(IVOIS)
  147. NLV=MLREST.LECT(NGVS)
  148. IF(NLV .EQ. 0)THEN
  149. C
  150. C**************** New point
  151. C
  152. IPOS=IPOS+1
  153. MLREST.LECT(NGVS)=LAST
  154. LAST=NGVS
  155. ENDIF
  156. ENDDO
  157. ELSE
  158. C 'CENTRE'
  159. NLV=MLREST.LECT(NGV)
  160. IF(NLV .EQ. 0)THEN
  161. C
  162. C************* New point
  163. C
  164. IPOS=IPOS+1
  165. MLREST.LECT(NGV)=LAST
  166. LAST=NGV
  167. ENDIF
  168. ENDIF
  169. ENDDO
  170. C
  171. C********** We create the new list of neighbors
  172. C
  173. JG=IPOS
  174. SEGINI MLENTI
  175. MLEPOF.LECT(IFAC)=MLENTI
  176. LAST0=LAST
  177. DO IVOIF=1,IPOS,1
  178. I1=(IPOS-IVOIF)+1
  179. MLENTI.LECT(I1)=LAST
  180. MLPOSI.LECT(LAST)=I1
  181. LAST=MLREST.LECT(LAST)
  182. ENDDO
  183. IF(LAST .NE. -1)THEN
  184. WRITE(IOIMP,*) 'subroutine rlenct.eso'
  185. CALL ERREUR(5)
  186. ENDIF
  187. LAST=LAST0
  188. C
  189. C******* Summarizing
  190. C
  191. C MLENTI: list of the new 'FACE' neighbors
  192. C MLENT1: list of the old 'FACE' neighbors
  193. C MLENT2: is free. It has been used and it will be used
  194. C for the 'SOMMET' neighbors.
  195. C MLPOSI: position of the new neighbors into MLENTI
  196. C MLREST + LAST : chaining list, used to clean MLPOSI
  197. C
  198. C******* Let us call
  199. C MATCOE: matrix of the 'FACE' coeff (IDIM+1,*)
  200. C MATCO1: matrix of the old 'FACE' coeff. (IDIM+1,*)
  201. C MLRCOE: list of the 'SOMMET coeff
  202. C
  203. C
  204. MATCO1=MLECOF.LECT(IFAC)
  205. SEGACT MATCO1
  206. N1=IDIM+1
  207. N2=MLENTI.LECT(/1)
  208. SEGINI MATCOE
  209. MLECOF.LECT(IFAC)=MATCOE
  210. C
  211. C******* Loop on the old 'FACE' neighbors
  212. C
  213. NVOIF=MLENT1.LECT(/1)
  214. DO IVOIF=1,NVOIF,1
  215. NGV=MLENT1.LECT(IVOIF)
  216. NLS=MLESOM.LECT(NGV)
  217. C
  218. IF(NLS .GT. 0)THEN
  219. C 'SOMMET'
  220. MLENT2=MLEPOI.LECT(NLS)
  221. MLRCOE=MLECOE.LECT(NLS)
  222. NVOIS=MLENT2.LECT(/1)
  223. DO IVOIS=1,NVOIS,1
  224. NGVS=MLENT2.LECT(IVOIS)
  225. IPOS=MLPOSI.LECT(NGVS)
  226. IF(IPOS .EQ. 0)THEN
  227. WRITE(IOIMP,*) 'subroutine rlenct.eso'
  228. CALL ERREUR(5)
  229. ENDIF
  230. DO I1=1,IDIM+1,1
  231. MATCOE.MAT(I1,IPOS)=MATCOE.MAT(I1,IPOS)+
  232. & (MATCO1.MAT(I1,IVOIF)*MLRCOE.PROG(IVOIS))
  233. ENDDO
  234. ENDDO
  235. ELSE
  236. C 'CENTRE'
  237. IPOS=MLPOSI.LECT(NGV)
  238. DO I1=1,IDIM+1,1
  239. MATCOE.MAT(I1,IPOS)=MATCOE.MAT(I1,IPOS)+
  240. & MATCO1.MAT(I1,IVOIF)
  241. ENDDO
  242. ENDIF
  243. ENDDO
  244. C
  245. CC
  246. CC******* Test
  247. CC
  248. C ipos=mlenti.lect(/1)
  249. C write(*,*) 'ngf=',melfl.num(2,ifac)
  250. C write(*,*) 'ntvois=',ipos
  251. C write(*,*) 'nvois=',(mlenti.lect(ivoif),ivoif=1,ipos,1)
  252. C write(*,*) 'Position=',
  253. C & (mlposi.lect(mlenti.lect(ivoif)),ivoif=1,ipos,1)
  254. C write(*,*) 'coeff(1) =',(matcoe.mat(1,ivoif),ivoif=1,ipos,1)
  255. C write(*,*) 'coeff(2) =',(matcoe.mat(2,ivoif),ivoif=1,ipos,1)
  256. C write(*,*) 'coeff(3) =',(matcoe.mat(3,ivoif),ivoif=1,ipos,1)
  257. C if(idim.eq.3) write(*,*) 'coeff(4)=',
  258. C & (matcoe.mat(4,ivoif),ivoif=1,ipos,1)
  259. C cell=0.0D0
  260. C do ivoif=1,ipos,1
  261. C cell=cell+matcoe.mat(1,ivoif)
  262. C enddo
  263. C write(*,*) 'sum=',cell
  264. C if(abs(cell-1.0d0) .gt. 1.0d-10)then
  265. CC It must be true if I just consider Dirichlet B.C.
  266. C call erreur(5)
  267. C goto 9999
  268. C endif
  269. C
  270. C******* We clean MLPOSI and MLREST
  271. C
  272. NVOIS=MLENTI.LECT(/1)
  273. DO IVOIF=1,NVOIS,1
  274. MLPOSI.LECT(LAST)=0
  275. ICELL=LAST
  276. LAST=MLREST.LECT(ICELL)
  277. MLREST.LECT(ICELL)=0
  278. ENDDO
  279. IF(LAST .NE. -1)THEN
  280. WRITE(IOIMP,*) 'subroutine rlenct.eso'
  281. CALL ERREUR(5)
  282. ENDIF
  283. C
  284. SEGSUP MATCO1
  285. SEGSUP MLENT1
  286. SEGDES MATCOE
  287. SEGDES MLENTI
  288. C
  289. ENDDO
  290. CC
  291. CC******* Test
  292. CC
  293. C do ifac=1,nfac,1
  294. C mlenti=mlepof.lect(ifac)
  295. C matcoe=mlecof.lect(ifac)
  296. C segact mlenti
  297. C segact matcoe
  298. C ipos=mlenti.lect(/1)
  299. C write(*,*) 'ngf=',melfl.num(2,ifac)
  300. C write(*,*) 'ntvois=',ipos
  301. C write(*,*) 'nvois=',(mlenti.lect(ivoif),ivoif=1,ipos,1)
  302. C write(*,*) 'coeff(1) =',(matcoe.mat(1,ivoif),ivoif=1,ipos,1)
  303. C write(*,*) 'coeff(2) =',(matcoe.mat(2,ivoif),ivoif=1,ipos,1)
  304. C write(*,*) 'coeff(3) =',(matcoe.mat(3,ivoif),ivoif=1,ipos,1)
  305. C if(idim.eq.3) write(*,*) 'coeff(4)=',
  306. C & (matcoe.mat(4,ivoif),ivoif=1,ipos,1)
  307. C cell=0.0D0
  308. C do ivoif=1,ipos,1
  309. C cell=cell+matcoe.mat(1,ivoif)
  310. C enddo
  311. C write(*,*) 'sum=',cell
  312. C if(abs(cell-1.0d0) .gt. 1.0d-10)then
  313. CC It must be true if I just consider Dirichlet B.C.
  314. C call erreur(5)
  315. C goto 9999
  316. C endif
  317. C segdes mlenti
  318. C segdes matcoe
  319. C enddo
  320. C
  321. SEGDES MELFL
  322. C
  323. SEGSUP MLREST
  324. SEGSUP MLPOSI
  325. C
  326. SEGDES MELSOM
  327. SEGSUP MLESOM
  328. C
  329. SEGDES MLEPOF
  330. SEGDES MLECOF
  331. C
  332. NSOMM=MLEPOI.LECT(/1)
  333. DO I1=1,NSOMM,1
  334. MLENTI=MLEPOI.LECT(I1)
  335. SEGSUP MLENTI
  336. MLREEL=MLECOE.LECT(I1)
  337. SEGSUP MLREEL
  338. ENDDO
  339. SEGSUP MLEPOI
  340. SEGSUP MLECOE
  341. C
  342. 9999 CONTINUE
  343. RETURN
  344. END
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  

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