Télécharger coupler.procedur

Retour à la liste

Numérotation des lignes :

  1. * COUPLER PROCEDUR NOBODY 92/01/01 00:00:00 001
  2. 'DEBP' COUPLER;
  3. *
  4. *********************************************************;
  5. * THE PROCEDURE ' C O U P L E R ' *;
  6. *********************************************************;
  7. * SYNTAXE
  8. * _______
  9. *
  10. * GEO2 (RAC1) = COUPLER (GEO1) PO1 CARCOQ (N) (MOT1) ;
  11. *
  12. * This procedure generates the GEO2 translated from GEO1
  13. * according to half the thickness of each element in GEO1.
  14. * It also generates the geometry RAC1 for the use with the
  15. * finite element RACO.
  16. *
  17. * In INPUT
  18. *
  19. * GEO1 - Object MAILLAGE containing the shell geometry
  20. * Need to be given only when the MAILLAGE support
  21. * of the CARCOQ is different from GEO1.
  22. *
  23. * PO1 - Object POINT containing the eyepoint to define
  24. * the direction in which fluid is present.
  25. *
  26. * CARCOQ - Object CHAMELEM containing the caracteristics
  27. * of GEO1.
  28. *
  29. * N - Object ENTIER containing any positive integer.
  30. * It is an optional parameter to indicate the inve-
  31. * rsion of the fluid boundary with respect to shell
  32. * geometry GEO1.
  33. *
  34. * MOT1 - Object MOT. Optioal word equal to 'RAC' to indicate
  35. * the RACCORD geometry RAC1 is required.
  36. *
  37. * In OUTPUT
  38. *
  39. * GEO2 - Object MAILLAGE containing the traslated geometry.
  40. *
  41. *********************************************************************
  42. 'ARGU' PO3*'POINT' CARCOQ*'MCHAML' ;
  43. *
  44. * 'PLUS'SING THE GIVEN MAILLAGE
  45. *
  46. 'ARGU' S1/'MAILLAGE' ;
  47. 'SI' ('EXIS' S1) ;
  48. S2 = S1 PLUS (0 0) ;
  49. 'SINON' ;
  50. *** AFFS1 = 'EXTR' CARCOQ AFFE ;
  51. MAIL1 = 'MOT' MAIL ;
  52. *** S1 = 'EXTR' AFFS1 'MAIL' ;
  53. S1 = 'EXTR' CARCOQ MAIL1 ;
  54. S2 = S1 PLUS (0 0) ;
  55. 'FINSI' ;
  56. *
  57. * GENERATION OF THE RACCORD
  58. * RACTR IS THE POINTER FOR THE GENERATION
  59. *
  60.  
  61. MO1 = 'MOT' RAC ; RACTR = 1 < 0;
  62. ARGU RR/'MOT' ;
  63. 'SI' ('EXIS' RR) ;
  64. 'SI' ( 'EGA' RR MO1) ;
  65. RAC2 = 'RACC' 0.001 S2 S1 ;
  66. RACTR = 1 > 0 ;
  67. 'FINSI' ;
  68. 'FINSI' ;
  69. *
  70. *VECX,VECY ----- NORMALISED,UNADJUSTED VECTOR COMPONENTS IN X & Y
  71. * FOR EVERY ELEMENT AT EACH NODE
  72. *AX,AY ----- FINAL VECTOR COMPONENTS AT EACH NODE IN X & Y
  73. *THIC ----- ELEMENT THICKNESSES ASSOCIATED WITH EACH NODE
  74. *CCC ----- POINTER FOR NODE 'DEPL'ACING
  75. *
  76. *INITIALISATION OF THE TABLES
  77. *
  78. VECY = 'TABL' ;
  79. VECX = 'TABL' ;
  80. AX = 'TABL' ;
  81. AY = 'TABL' ;
  82. CCC = 'TABL' ;
  83. THIC = 'TABL' ;
  84. NN = 'NBEL' S2 ; NN2 = 'NBNO' S2 ;
  85. I = 0;
  86. 'REPE' BLOC1 NN ;
  87. I = I '+' 1 ; ELNO = 'ELEM' S2 I ;
  88. NNO = 'POIN' ELNO INIT;
  89. NN1 = 'POIN' ELNO FINA;
  90. AX.NNO = 0.0 ;VECX.NNO = 0.0 ;THIC.NNO = 0.0 ;
  91. AX.NN1 = 0.0 ;VECX.NN1 = 0.0 ;THIC.NN1 = 0.0 ;
  92. AY.NNO = 0.0 ;VECY.NNO = 0.0 ;CCC.NNO = 999;
  93. AY.NN1 = 0.0 ;VECY.NN1 = 0.0 ;CCC.NN1 = 999;
  94. 'FIN' BLOC1;
  95. *
  96. * CALCULATIONS START
  97. *
  98. I = 0;
  99. 'REPE' BLOC2 NN ;
  100. I = I '+' 1;
  101. ELNO = 'ELEM' S1 I ;
  102. *
  103. *'REDU'CTION OF THE INDIVIDUAL ELEMENT THICKNESSES FROM CHAMELEM CARA
  104. *
  105. C1 = 'REDU' CARCOQ ELNO; EP = 'MOT' EPAI ;
  106. TIC = 'EXTR' C1 EP 1 1 1 ;
  107. TIC = TIC '*' 0.5 ;
  108. *
  109. *EPS1 IS THE TOLERANCE USED FOR THE COMPARISION OF FLOTTANTS
  110. *
  111. EPS1 = TIC '*' 0.0001 ;
  112. ELNO = 'ELEM' S2 I ;
  113. P1 = ELNO 'POIN' INIT ;
  114. P2 = ELNO 'POIN' FINAL ;
  115. X1 = 'COOR' P1 1 ; Y1 = 'COOR' P1 2 ;
  116. X2 = 'COOR' P2 1 ; Y2 = 'COOR' P2 2 ;
  117. X3 = 'COOR' PO3 1 ; Y3 = 'COOR' PO3 2 ;
  118. X21 = X2 - X1 ;Y21 = Y2 - Y1 ;
  119. X31 = X3 - X1 ;Y31 = Y3 - Y1 ;
  120. *LIST X21;LIST Y21 ;LIST X31;LIST Y31 ;
  121. LENG = ( X21 '*' X21) '+' (Y21 '*' Y21 );
  122. LENG = LENG '**' 0.5 ;
  123.  
  124. ZVEC3 = (X21 '*' Y31) '-' (Y21 '*' X31 ) ;
  125.  
  126. VECX.P1 = (-1) '*' Y21 '*' TIC '/' LENG ;
  127. VECY.P1 = X21 '*' TIC '/' LENG ;
  128. *
  129. *MAKING THE DIRECTION OF VECX & VECY SAME AS THAT OF ZVEC3
  130. *
  131. TR1 = ZVEC3 '<' 0 ;
  132. SI TR1 ;
  133. VECX.P1 = (-1) '*' VECX.P1 ;
  134. VECY.P1 = (-1) '*' VECY.P1 ;
  135. FINSI ;
  136.  
  137. VECX.P2 = VECX.P1 ;
  138. VECY.P2 = VECY.P1 ;
  139. *
  140. * COUP2 --- LOOP FOR ADJUSTING VECX & VECY ACCORDING TO THE ADJACENT
  141. * ELEMENT THICKNESS OR SLOPE
  142. *
  143. NCOU2 = 0 ;
  144. 'REPE' COUP2 2 ;
  145. NCOU2 = NCOU2 '+' 1 ;
  146. A1 = AX.P1 ; A2 = AY.P1 ; A3 = VECX.P1 ; A4 = VECY.P1;
  147. XX1 = X1 ; YY1 = Y1 ; THIC1 = THIC.P1 ; THIC2 = TIC ;
  148.  
  149. 'SI' (NCOU2 'EGA' 2) ;
  150. A1 = AX.P2 ; A2 = AY.P2 ; A3 = VECX.P2 ; A4 = VECY.P2;
  151. XX1 = X2 ; YY1 = Y2 ; THIC1 = THIC.P2 ; THIC2 = TIC ;
  152. 'FINSI' ;
  153. *
  154. * TR2 --- LOGICAL VALUE FOR COMPARING THE (NORMALISED VECTOR/THICNESS)
  155. * OF THE ADJACENT ELEMENTS . ( in case of NO SLOPE BUT ONLY THICKNESS
  156. * CHANGE)
  157. *
  158. TR2 = 1 < 0 ;
  159.  
  160. EPS2 = EPS1 '*' TIC ;
  161. 'SI' (THIC1 'NEG' 0.0) ;
  162. AA1 = A1 '/' THIC1;
  163. AA2 = A2 '/' THIC1;
  164. AA3 = A3 '/' THIC2;
  165. AA4 = A4 '/' THIC2;
  166. TR2 = ( (AA1 'EGA' AA3 EPS2) 'ET' (AA2 'EGA' AA4 EPS2) );
  167.  
  168. FINSI ;
  169. REPE BLOC3 1 ;
  170. TR3 = ( (A1 'EGA' A3 EPS1) 'ET' (A2 'EGA' A4 EPS1) );
  171.  
  172. 'SI' TR3 ;
  173. *'MESS' 'ENTER SI TR3 . THE VECTOR FOR THIS NODE, WHICH IS EQUAL ';
  174. *'MESS' 'TO THE PRESENT CALCULATED VECX.P1.... IS AVAILABLE ';
  175.  
  176. D1 = A3 ;
  177. D2 = A4 ;
  178. 'QUIT' BLOC3 ;
  179. 'SINO' ;
  180. *'MESS' ' ENTER SINON TR3. THIS NODE IS EITHER NEW OR HAS GOT';
  181. *'MESS' ' A CHANGE OF SLOPE OR THICKNESS';
  182. 'SI' TR2;
  183. *'MESS' 'ENTER SI TR2 . THERE IS A THICKNESS CHANGE BUT NO SLOPE ';
  184. *'MESS' 'CHANGE AT THIS NODE ';
  185.  
  186. D1 = (a1 '+' A3 ) * 0.5 ;
  187. D2 = (a2 '+' A4 ) * 0.5 ;
  188. 'QUIT' BLOC3 ;
  189. 'SINO' ;
  190.  
  191.  
  192. TR4 = ( (A1 'EGA' 0. EPS1) 'ET' (A2 'EGA' 0. EPS1) );
  193.  
  194. 'SI' TR4 ;
  195. *'MESS' ' ENTER SI TR4. THIS IS A NEW NODE';
  196.  
  197. D1 = A3 ;
  198. D2 = A4 ;
  199. 'QUIT' BLOC3 ;
  200.  
  201. 'SINO' ;
  202. *'MESS' ' ENTER SINON TR4. THIS NODE HAS CHANGE OF SLOPE';
  203.  
  204. PP1 = X1 '+' A1 ; QQ1 = Y1 '+' A2 ;
  205. PP2 = X1 '+' A3 ; QQ2 = Y1 '+' A4 ;
  206. TR41 = A2 'EGA' 0.0 EPS1 ;
  207. 'SI' TR41 ;
  208. X = PP1 ;
  209. Y = (A3 '*' PP2) '+' (A4 '*' QQ2) '-' (A3 '*' PP1) ;
  210. Y = Y '/' A4;
  211. 'FINS' ;
  212.  
  213. TR42 = A4 'EGA' 0.0 EPS1 ;
  214. 'SI' TR42;
  215. X = PP2 ;
  216. Y = (A1 '*' PP1) '+' (A2 '*' QQ1) '-' (A1 '*' PP2) ;
  217. Y = Y '/' A2;
  218. 'FINS' ;
  219.  
  220. TR43 = ( ('NON' TR41) 'ET' ('NON' TR42) ) ;
  221.  
  222. 'SI' TR43 ;
  223. DUMMY = (A1 '/' A2) '-' (A3 '/' A4) ;
  224. X = (A1 '*' PP1 '/' A2) '+' QQ1 '-' QQ2 '-'
  225. (A3 '*' PP2 '/' A4) ;
  226. X = X '/' DUMMY ;
  227. Y = (A1 '*' PP1 '/' A2) '+' QQ1 '-' (A1 '*' X '/' A2) ;
  228. 'FINS';
  229.  
  230. D1 = X '-' X1 ; D2 = Y '-' Y1;
  231.  
  232. 'FINS' ;
  233.  
  234. 'FINS' ;
  235. 'FINS';
  236. 'FIN' BLOC3 ;
  237. 'SI' (NCOU2 'EGA' 1) ;
  238. AX.P1 = D1 ; AY.P1 = D2 ;
  239. 'FINSI' ;
  240. 'SI' (NCOU2 'EGA' 2) ;
  241. AX.P2 = D1 ; AY.P2 = D2 ;
  242. 'FINSI' ;
  243. 'FIN' COUP2 ;
  244. *
  245. * KEEPING TRACK OF THICKNESSES AT VARIOUS NODES FOR COMPARISION IN TR2
  246. *
  247. THIC.P1= TIC ;
  248. THIC.P2= THIC.P1 ;
  249. 'FIN' BLOC2 ;
  250. *
  251. * CHECK TO SEE WHETHER INVERSION OF THE MAILLAGE IS REQUIRED
  252. *
  253. VM = 'MOT' 'PLUS' ;
  254. 'ARGU' L/'ENTIER' ;
  255. 'SI' ( 'EXIS' L) ;
  256. VM = 'MOT' 'MOIN' ;
  257. 'FINS' ;
  258. *
  259. *'DEPL'ACING EVERY NODE ; 'ELEM' & 'POIN' OPTIONS ARE USED BECAUSE
  260. * 'POIN' DOES NOT IDENTIFY THE CORRECT NODE IN A GENERAL CASE
  261. *
  262.  
  263. I=0;
  264. REPE bloc3 NN ;
  265. I = I + 1;
  266. E1 = 'ELEM' S2 I;
  267. P1 = 'POIN' E1 1;
  268. P2 = 'POIN' E1 2 ;
  269. V1= (AX.P1 AY.P1);
  270. V2= (AX.P2 AY.P2);
  271. 'SI' (CCC.P1 'EGA' 999);
  272. DEPL P1 VM V1;
  273. * RESETTING THE POINTER
  274. CCC.P1=0;
  275. 'FINSI';
  276. 'SI' (CCC.P2 'EGA' 999);
  277. DEPL P2 VM V2;
  278. * RESETTING THE POINTER
  279. CCC.P2=0;
  280. 'FINSI';
  281. 'FIN' BLOC3;
  282. * RETURNING THE MAILLAGE
  283. 'RESP' S2; ;
  284. *
  285. * RETURNING THE RACO AFTER CHECKING WHETHER IT HAS BEEN ASKED FOR
  286. *
  287. 'SI' (RACTR) ;
  288. 'RESP' RAC2 ;
  289. 'FINSI' ;
  290. *
  291. 'FINP' ;
  292.  

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