Télécharger topoptim.procedur

Retour à la liste

Numérotation des lignes :

  1. * TOPOPTIM PROCEDUR FD218221 25/12/18 21:15:12 12429
  2.  
  3. ************************************************************************
  4. ** Topology optimization procedure.
  5. **
  6. ** Author:
  7. ** Guenhael Le Quilliec (LaMe - Polytech Tours)
  8. **
  9. ** Version:
  10. ** 4.0 2025/12/05 Various updates and improvements of the structure,
  11. ** performance, and capabilities:
  12. ** - Method of Moving Asymptotes optimizer;
  13. ** - Volume minimization objective;
  14. ** - Von Mises stress aggregated constraint;
  15. ** - KLl, KSu, P-norm, and P-mean aggregation
  16. ** functions;
  17. ** - Compatible with penalized density-dependent
  18. ** loading;
  19. ** - Density filtering, constraint sensitivity
  20. ** filtering;
  21. ** - Binarization by projection using sigmoid
  22. ** functions;
  23. ** - RAMP penalty function.
  24. ** In addition, some new examples illustrate the use of
  25. ** these features.
  26. ** 3.0 2021/04/15 Improved the structure of TOPOPTIM for developers and
  27. ** added a new filtering function.
  28. ** 2.4 2021/04/14 Fixed an issue with TET4 in frozen area
  29. ** 2.3 2021/03/19 Modified default value of 'OC_L2'
  30. ** 2.2 2018/02/09 Made compatible with the new version of TOPOSAUV,
  31. ** allowing early stop and restart of the optimization
  32. ** 2.1 2017/11/11 Compliant mechanism output displacement maximization
  33. ** 2.0 2017/04/18 Geometric restrictions, non-linear, multiobjective,
  34. ** multiphysics, customizable topology optimization
  35. ** 1.1 2015/11/02 Check if volume fraction > proportion of frozen area
  36. ** 1.0 2014/04/28 Linear mono-objective topology optimization
  37. ************************************************************************
  38. *
  39. * Global structure
  40. * ----------------
  41. *
  42. * Start ─── → ─── TOPOPTIM
  43. * ├─ TOPOBOOT
  44. * │ ├─ TOPOEVOL
  45. * ↓ ├─ TOPORSTR
  46. * │ └─ TOPOPHYS
  47. * │ └─ TOPOPROJ
  48. * ├─ (TOPOPERS)
  49. * ┌ → ┼─ TOPOEVOL
  50. * │ ├─ TOPOPENA
  51. * │ ├─ TOPOACTI
  52. * │ │ └─ TOPOMATE
  53. * │ O ├─ (TOPOUPDT)
  54. * │ p ├─ TOPOCHAR
  55. * │ t ├─ TOPOINFO Other procedures
  56. * │ i ├─ TOPORESO called by TOPOPTIM
  57. * │ m ├─ TOPOOBJE
  58. * │ i │ ├─ TOPOCMPL ↔ TOPOFILT
  59. * │ z │ ├─ TOPORSTR ↔ TOPOCHAN
  60. * │ a │ └─ TOPODYDX ↔ TOPOFONC
  61. * │ t ├─ TOPOCONT ↔ TOPOMODI
  62. * ↑ i ↓ ├─ TOPOAGRE
  63. * │ o │ ├─ TOPODVSA
  64. * │ n │ ├─ TOPOADJO
  65. * │ │ │ └─ TOPOMATE
  66. * │ │ └─ TOPODYDX
  67. * │ ├─ TOPOLOGY
  68. * │ l │ └─ TOPOPHYS
  69. * │ o │ └─ TOPOPROJ
  70. * │ o ├─ TOPOCONV
  71. * │ p ├─ TOPOSAUV
  72. * │ ├─ (TOPOPERS)
  73. * │ ├─ TOPOVISU
  74. * │ │ └─ TOPOTEMP
  75. * └ ← ┤
  76. * └─── → ─── End if convergence
  77. * or last cycle
  78. *
  79. * General naming convention
  80. * -------------------------
  81. *
  82. * A → active zone N → normalized
  83. * B → base zone, union of D and F O → objective
  84. * C → constraint term of adjoint R → restart
  85. * method S → intermediate (smoothed /
  86. * d → derivative filtered) densities
  87. * D → design zone T → thermal
  88. * F → frozen zone or forces U → displacement
  89. * g → local constraints V → volume or volume fraction or
  90. * G → global constraint von Mises matrix
  91. * H → hat or Helmholtz filter W → working
  92. * I → intersection zone of D and A X → design variables
  93. * K → rigidity matrix Y → physical densities
  94. * L → logical Z → penalized physical densities
  95. * M → mechanical
  96. *
  97. * agg → aggregated min → minimal
  98. * bdc → boundary conditions mma → Method of Moving
  99. * bta → β Asymptotes
  100. * cas → case mod → model
  101. * cnt → contact msh → mesh
  102. * col → color msk → mask
  103. * cpl → compliance nam → name
  104. * cpn → component(s) nbr → number
  105. * crt → criterion old → old
  106. * ctr → centroid(s) out → output
  107. * cyc → cycle pos → position
  108. * dif → difference ptr → pointer
  109. * dst → density res → resolution
  110. * ene → energy rst → restriction
  111. * eps → ε sav → save
  112. * eql → equal sig → σ
  113. * eta → η spr → spring
  114. * evo → evolution stp → step
  115. * fld → field tab → table
  116. * grd → gradient tim → time
  117. * gsf → grey scale factor tmp → temporary variable
  118. * inp → input tot → total
  119. * itr → iteration typ → type
  120. * lam → λ uni → unitary
  121. * ldg → loading(s) upd → update
  122. * lim → limit val → value
  123. * lst → list var → variable
  124. * mat → material vnm → Von Mises
  125. * max → maximal wgt → weight
  126. * mcn → mechanism zon → zone
  127. * mic → microscopic
  128. *
  129. **********************************************************************
  130.  
  131. DEBP TOPOPTIM tab*'TABLE' ;
  132.  
  133. * Preprocessing
  134. * *************
  135. TOPOBOOT tab ;
  136.  
  137. * Work & logical tables
  138. * *********************
  139. Wtab = tab.'WTABLE' ;
  140. Ltab = Wtab.'LOGIQUE' ;
  141.  
  142. SI (Wtab.'CYCLE' EGA 1) ;
  143. SAUT 2 'LIGN' ;
  144. MESS '+-----------------------------------------------------------------------------+' ;
  145. MESS '| |' ;
  146. MESS '| |' ;
  147. MESS '| D E B U T D E L A P R O C E D U R E |' ;
  148. MESS '| |' ;
  149. MESS '| ______ ______ ______ ______ ______ ______ __ __ __ |' ;
  150. MESS '| /\__ _\/\ __ \ /\ == \/\ __ \ /\ == \/\__ _\/\ \ /\ =-./ \ v4.0 |' ;
  151. MESS '| \/_/\ \/\ \ \/\ \\ \ _-/\ \ \/\ \\ \ _-/\/_/\ \/\ \ \\ \ \-./\ \ ---- |' ;
  152. MESS '| \ \_\ \ \_____\\ \_\ \ \_____\\ \_\ \ \_\ \ \_\\ \_\ \ \_\ |' ;
  153. MESS '| \/_/ \/_____/ \/_/ \/_____/ \/_/ \/_/ \/_/ \/_/ \/_/ |' ;
  154. MESS '| _______________________________________________________________ |' ;
  155. MESS '| /\______________________________________________________________\ |' ;
  156. MESS '| \/______________________________________________________________/ |' ;
  157. MESS '| |' ;
  158. MESS '| |' ;
  159. MESS '+-----------------------------------------------------------------------------+' ;
  160. SAUT 1 'LIGN' ;
  161. FINS ;
  162.  
  163. * First call to user-defined procedure
  164. * ************************************
  165. SI tab.'PROCEDURE_TOPOPERS' ;
  166. TOPOPERS tab ;
  167. FINS ;
  168.  
  169. **********************************************************************
  170. * OPTIMIZATION LOOP *
  171. **********************************************************************
  172. REPE itr (ENTI 1e9) ;
  173.  
  174. * Save the iteration number and start iteration timer
  175. * ***************************************************
  176. Wtab.'ITERATION' = &itr ;
  177. Wtab.'HORLOGE' = TEMP 'HORL' ;
  178.  
  179. * Update values from corresponding evolutions
  180. * *******************************************
  181. TOPOEVOL tab ;
  182.  
  183. * Update penalized physical density fields
  184. * ****************************************
  185. TOPOPENA tab ;
  186.  
  187. * Update mesh, model, material, and contact of active zone
  188. * ********************************************************
  189. TOPOACTI tab ;
  190.  
  191. * User-defined procedure to update physical density-dependent data
  192. * ****************************************************************
  193. SI tab.'PROCEDURE_TOPOUPDT' ;
  194. TOPOUPDT tab ;
  195. FINS ;
  196.  
  197. * Initialize or update loading
  198. * ****************************
  199. TOPOCHAR tab ;
  200.  
  201. * General information before first resolution
  202. * *******************************************
  203. TOPOINFO tab ;
  204.  
  205. * Solve FE problem(s)
  206. * *******************
  207. TOPORESO tab ;
  208.  
  209. * Update the objective and its sensitivity
  210. * ****************************************
  211. TOPOOBJE tab ;
  212.  
  213. * Update the constraints and their sensitivities
  214. * **********************************************
  215. TOPOCONT tab ;
  216.  
  217. * Update topology
  218. * ***************
  219. TOPOLOGY tab ;
  220.  
  221. * Convergence test
  222. * ****************
  223. TOPOCONV tab ;
  224.  
  225. * Save output data
  226. * ****************
  227. TOPOSAUV tab ;
  228.  
  229. * User-defined procedure
  230. * **********************
  231. SI tab.'PROCEDURE_TOPOPERS' ;
  232. TOPOPERS tab ;
  233. FINS ;
  234.  
  235. * Display some results
  236. * ********************
  237. TOPOVISU tab ;
  238.  
  239. * End of cycle
  240. * ************
  241. tab.'CYCLE' = Wtab.'CYCLE' ;
  242. Wtab.'CYCLE' = Wtab.'CYCLE' + 1 ;
  243. SI Ltab.'STOP' ;
  244. QUIT itr ;
  245. FINS ;
  246.  
  247. FIN itr ;
  248. **********************************************************************
  249. * END OPTIMIZATION LOOP *
  250. **********************************************************************
  251.  
  252. * Some cleaning
  253. * *************
  254. OTER tab 'WTABLE' ;
  255. MENA 'OBLI' ;
  256.  
  257. FINP ;
  258.  
  259.  
  260.  
  261.  

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