Télécharger topoptim_02_Binarization.dgibi

Retour à la liste

Numérotation des lignes :

  1. * fichier topoptim_02_Binarization.dgibi
  2. ************************************************************************
  3. ************************************************************************
  4.  
  5. ************************************************************************
  6. ** Topology optimization of the MBB beam with variable penalty factor
  7. ** and binarization (0-1 design) using either:
  8. ** - Q factor (only compatible with OC);
  9. ** - projection (preferably with density filtering).
  10. **
  11. ** Author:
  12. ** Guenhael Le Quilliec (LaMe - Polytech Tours)
  13. **
  14. ** Version:
  15. ** V4.0 2025/12/15 Updated to make it compatible with TOPOPTIM V4.0
  16. ** V3.0 2021/05/06 Updated to make it compatible with TOPOPTIM V3.0
  17. ** V2.0 2017/04/18 Updated to make it compatible with TOPOPTIM V2.0
  18. ** V1.0 2014/04/28 Original version compatible with TOPOPTIM V1.0
  19. ************************************************************************
  20.  
  21. * Plot results
  22. graph0 = FAUX ;
  23.  
  24. * Binarization by projection
  25. proj0 = FAUX ;
  26.  
  27. * General options
  28. OPTI 'DIME' 2 'MODE' 'PLAN' 'CONT' 'ELEM' 'QUA4' ;
  29.  
  30. * Number of elements
  31. nelx0 = 90 ;
  32. nely0 = 30 ;
  33.  
  34. * Dimensions
  35. l0 = nelx0 * 1.0 ;
  36. h0 = nely0 * 1.0 ;
  37.  
  38. * Mesh
  39. p0 = 0.0 0.0 ;
  40. p1 = 0.0 h0 ;
  41. p2 = l0 0.0 ;
  42. ln0 = DROI nely0 p0 p1 ;
  43. msh0 = nelx0 TRAN ln0 p2 ;
  44. p2 = msh0 POIN 'PROC' p2 ;
  45.  
  46. * Model and material
  47. mod0 = MODE msh0 'MECANIQUE' 'ELASTIQUE' ;
  48. mat0 = MATE mod0 'YOUN' 210.0e9 'NU' 0.3 ;
  49.  
  50. * Boundary conditions
  51. bc0 = (BLOQ 'UX' ln0) ET (BLOQ 'UY' p2) ;
  52.  
  53. * Loading
  54. load0 = FORC (0.0 -1.0) p1 ;
  55.  
  56. * Penalty factor evolution
  57. pnl_p0 = EVOL 'MANU' 'CYCLES' (PROG 5 15) 'P' (PROG 1.0 3.0) ;
  58.  
  59. * Finite element model table
  60. mdl0 = TABL ;
  61. mdl0.'MODELE' = mod0 ;
  62. mdl0.'CARACTERISTIQUES' = mat0 ;
  63. mdl0.'BLOCAGES_MECANIQUES' = bc0 ;
  64. mdl0.'CHARGEMENT' = load0 ;
  65.  
  66. * Optimization table
  67. tab0 = TABL ;
  68. tab0.'TRAC' = graph0 ;
  69. tab0.'RESOLUTION_LINEAIRE' = mdl0 ;
  70. tab0.'FRACTION_VOLUME_LIMITE' = 0.4 ;
  71. tab0.'PENALISATION_P' = pnl_p0 ;
  72. * Monitor its value
  73. tab0.'MESS' = MOTS 'PENALISATION_P' ;
  74. *tab0.'FILTRE' = MOT 'EDP' ;
  75. *tab0.'FILTRE_EDP_RAYON' = 3.0 * l0 / (FLOT nelx0) ;
  76. *tab0.'FILTRE' = MOT 'CHAPEAU' ;
  77. *tab0.'FILTRE_CHAPEAU_RAYON' = 3.0 * l0 / (FLOT nelx0) ;
  78. *tab0.'OPTIMISEUR' = MOT 'MMA' ;
  79.  
  80. * Personnal procedure to control the on the fly the value of the
  81. * projection stiffness
  82. DEBP TOPOPERS tab0 ;
  83. * Input data
  84. Wtab = tab0.'WTABLE' ;
  85. Ltab = Wtab.'LOGIQUE' ;
  86. * If stop trigger is activated
  87. SI (Ltab.'STOP' ET (tab0.'PROJECTION_RAIDEUR' < 512)) ;
  88. * Update projection stiffness
  89. tab0.'PROJECTION_RAIDEUR' = tab0.'PROJECTION_RAIDEUR' * 2.0 ;
  90. * Increase max number of cycles
  91. tab0.'MAX_CYCLES' = Wtab.'CYCLE' + 50 ;
  92. * Disable stop trigger to continue optimization
  93. Ltab.'STOP' = FAUX ;
  94. FINS ;
  95. FINP ;
  96.  
  97. SI proj0 ;
  98. * Density filtering
  99. tab0.'FILTRER' = MOT 'DENSITE' ;
  100. * Initialization of max cycles and projection stiffness
  101. tab0.'MAX_CYCLES' = 50 ;
  102. tab0.'PROJECTION_RAIDEUR' = 1.0 ;
  103. tab0.'PROCEDURE_TOPOPERS' = VRAI ;
  104. * Monitor its value
  105. tab0.'MESS' = tab0.'MESS' ET (MOTS 'PROJECTION_RAIDEUR') ;
  106. SINO ;
  107. * Use Gibiane filter
  108. tab0.'FILTRE_GIBIANE_TAUX' = 10 ;
  109. * OC gray scale factor evolution
  110. oc_q0 = EVOL 'MANU' 'CYCLES' (PROG 25 105) 'Q' (PROG 1.0 5.0) ;
  111. tab0.'OC_Q' = oc_q0 ;
  112. FINS ;
  113.  
  114. * Optimization
  115. TOPOPTIM tab0 ;
  116.  
  117. * Plot final topology (physical density)
  118. topo0 = tab0.'TOPOLOGIE'.(tab0.'CYCLE') ;
  119. topomsh0 = tab0.'MAILLAGE'.(tab0.'CYCLE') ;
  120. SI graph0 ;
  121. TRAC (REDU topo0 topomsh0) (REDU mod0 topomsh0)
  122. (PROG 0.0 'PAS' (1.0 / 56.0) 1.0)
  123. 'TITR' 'Topologie finale' ;
  124. FINS ;
  125.  
  126. * Plot output evolutions
  127. SI graph0 ;
  128. REPE loop0 (DIME tab0.'EVOLUTIONS_SAUVEES') ;
  129. evoname0 = EXTR tab0.'EVOLUTIONS_SAUVEES' &loop0 ;
  130. DESS tab0.'EVOLUTIONS'.evoname0 'POSY' 'EXCE'
  131. 'TITR' (CHAI 'Evolution de' ' ' evoname0
  132. ' au cours des cycles d''optimisation') ;
  133. FIN loop0 ;
  134. FINS ;
  135.  
  136. FIN ;
  137.  
  138.  
  139.  

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