Télécharger rlenct.eso

Retour à la liste

Numérotation des lignes :

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

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