Télécharger toporstr.procedur

Retour à la liste

Numérotation des lignes :

  1. * TOPORSTR PROCEDUR FD218221 25/12/18 21:15:13 12429
  2.  
  3. ************************************************************************
  4. ** Procedure called by TOPOOBJE to apply geometric restrictions to an
  5. ** input field.
  6. **
  7. ** Remark: the input field must be an intensive quantity
  8. ** and defined on the design zone (D).
  9. **
  10. ** Author:
  11. ** Guenhael Le Quilliec (LaMe - Polytech Tours)
  12. **
  13. ** Version:
  14. ** 2.0 2025/11/13 Made compatible with TOPOPTIM V4.0
  15. ** 1.1 2021/03/19 Fixed a minor issue by adding 'SCALAIRE' type for the
  16. ** sensitivity
  17. ** 1.0 2017/04/18 Initial version
  18. ************************************************************************
  19.  
  20. DEBP TOPORSTR tab*'TABLE' fldD*'MCHAML' ;
  21.  
  22. * General input data
  23. * ******************
  24.  
  25. Wtab = tab.'WTABLE' ;
  26. Ltab = Wtab.'LOGIQUE' ;
  27.  
  28. * If there is nothing to do
  29. * *************************
  30.  
  31. SI (NON Ltab.'RESTRICTIONS') ;
  32. * Return input field
  33. QUIT TOPORSTR ;
  34. FINS ;
  35.  
  36. * Input data
  37. * **********
  38.  
  39. * Criterion to fuse the nodes
  40. crt = tab.'ELIM_CRITERE' ;
  41. * Node mesh of the centroids
  42. ctrmshD = Wtab.'MAILLAGE_GRAVITE_D' ;
  43.  
  44. * Preprocessing
  45. * *************
  46.  
  47. * Switch from element field to nodal field
  48. fldD = PROI ctrmshD fldD ;
  49.  
  50. * Apply restrictions
  51. * ******************
  52.  
  53. * Loop over each restriction
  54. REPE itr (DIME tab.'RESTRICTIONS') ;
  55. * Find the next restriction
  56. SI (EXIS tab.'RESTRICTIONS' &itr) ;
  57. rst = tab.'RESTRICTIONS'.&itr ;
  58. SINO ;
  59. QUIT itr ;
  60. FINS ;
  61. * Get node mesh of centroids of the restricted zone
  62. * and its initial sensitivity
  63. Lrstzon = EXIS rst 'ZONE' ;
  64. SI Lrstzon ;
  65. ctrmsh1 = (REDU Wtab.'UNIT_D' rst.'ZONE') POIN 'SUPE' -1.0 ;
  66. ELIM ctrmshD ctrmsh1 crt ;
  67. fld1 = REDU fldD ctrmsh1 ;
  68. SINO ;
  69. ctrmsh1 = ctrmshD ;
  70. fld1 = fldD ;
  71. FINS ;
  72. * Make copies with prescribed geometric transformation
  73. * Fuse nodes of their supports
  74. * Compute mean sensitivity fields
  75. SI (EGA rst.'TYPE' 'SYME_POIN') ;
  76. msh2 fld2 = ctrmsh1 fld1 SYME 'POIN' rst.'POIN1' ;
  77. ELIM ctrmsh1 msh2 crt ;
  78. fld1 = (fld1 + fld2) / 2.0 ;
  79. FINS ;
  80. SI (EGA rst.'TYPE' 'SYME_DROI') ;
  81. msh2 fld2 = ctrmsh1 fld1 SYME 'DROI' rst.'POIN1' rst.'POIN2' ;
  82. ELIM ctrmsh1 msh2 crt ;
  83. fld1 = (fld1 + fld2) / 2.0 ;
  84. FINS ;
  85. SI (EGA rst.'TYPE' 'SYME_PLAN') ;
  86. msh2 fld2 = ctrmsh1 fld1 SYME 'PLAN' rst.'POIN1' rst.'POIN2' rst.'POIN3' ;
  87. ELIM ctrmsh1 msh2 crt ;
  88. fld1 = (fld1 + fld2) / 2.0 ;
  89. FINS ;
  90. SI (EGA rst.'TYPE' 'PERIODICITE_CIRCULAIRE') ;
  91. SI (rst.'PERIODES' EGA 2) ;
  92. SI ((VALE 'DIME') EGA 3) ;
  93. msh2 fld2 = ctrmsh1 fld1 TOUR 180.0 rst.'POIN1' rst.'POIN2' ;
  94. SINO ;
  95. msh2 fld2 = ctrmsh1 fld1 TOUR 180.0 rst.'POIN1' ;
  96. FINS ;
  97. ELIM ctrmsh1 msh2 crt ;
  98. fld1 = (fld1 + fld2) / 2.0 ;
  99. SINO ;
  100. mshtab = TABL ;
  101. mshtab.(0) = ctrmsh1 ;
  102. fldtab = TABL ;
  103. fldtab.(0) = fld1 ;
  104. p0 = rst.'PERIODES' ;
  105. a0 = 360.0 / p0 ;
  106. SI ((VALE 'DIME') EGA 3) ;
  107. p1 = rst.'POIN1' ;
  108. p2 = rst.'POIN2' ;
  109. REPE itr1 (p0 - 1) ;
  110. old = &itr1 - 1 ;
  111. mshtab.&itr1 fldtab.&itr1 = mshtab.old fldtab.old TOUR a0 p1 p2 ;
  112. FIN itr1 ;
  113. SINO ;
  114. p1 = rst.'POIN1' ;
  115. REPE itr1 (p0 - 1) ;
  116. old = &itr1 - 1 ;
  117. mshtab.&itr1 fldtab.&itr1 = mshtab.old fldtab.old TOUR a0 p1 ;
  118. FIN itr1 ;
  119. FINS ;
  120. REPE itr1 (p0 - 1) ;
  121. ELIM ctrmsh1 mshtab.&itr1 crt ;
  122. fld1 = fld1 + fldtab.&itr1 ;
  123. FIN itr1 ;
  124. fld1 = fld1 / p0 ;
  125. FINS ;
  126. FINS ;
  127. SI (EGA rst.'TYPE' 'PERIODICITE_AXIALE') ;
  128. mshtab = TABL ;
  129. mshtab.(0) = ctrmsh1 ;
  130. fldtab = TABL ;
  131. fldtab.(0) = fld1 ;
  132. p0 = rst.'PERIODES' ;
  133. v0 = rst.'POIN2' MOIN rst.'POIN1' ;
  134. REPE itr1 (p0 - 1) ;
  135. old = &itr1 - 1 ;
  136. mshtab.&itr1 fldtab.&itr1 = mshtab.old fldtab.old PLUS v0 ;
  137. itr2 = -1 * &itr1 ;
  138. old = itr2 + 1 ;
  139. mshtab.itr2 fldtab.itr2 = mshtab.old fldtab.old MOIN v0 ;
  140. FIN itr1 ;
  141. REPE itr1 (p0 - 1) ;
  142. ELIM ctrmsh1 mshtab.&itr1 crt ;
  143. fld1 = fld1 + fldtab.&itr1 ;
  144. itr2 = -1 * &itr1 ;
  145. ELIM ctrmsh1 mshtab.itr2 crt ;
  146. fld1 = fld1 + fldtab.itr2 ;
  147. FIN itr1 ;
  148. fld1 = fld1 / p0 ;
  149. FINS ;
  150. * Compute final sensitivity
  151. SI Lrstzon ;
  152. fldD = fldD - (REDU fldD ctrmsh1) + fld1 ;
  153. SINO ;
  154. fldD = fld1 ;
  155. FINS ;
  156. FIN itr ;
  157.  
  158. * Postprocessing
  159. * **************
  160.  
  161. * Switch sensitivity back from nodal field to element field
  162. fldD = MANU 'CHML' Wtab.'MODELE_D' 'REPA' 'SCAL' (EXTR fldD 'VALE')
  163. 'TYPE' 'SCALAIRE' 'GRAVITE' ;
  164. * In thermal mode, 'GRAVITE' option is not respected
  165. * This issue is resolved by using CHAN 'GRAVITE'
  166. SI (NON Ltab.'MECANIQUE') ;
  167. fldD = CHAN 'GRAVITE' fldD Wtab.'MODELE_D' ;
  168. FINS ;
  169.  
  170. FINP fldD ;
  171.  
  172.  
  173.  

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