Télécharger topoptim_09.dgibi

Retour à la liste

Numérotation des lignes :

  1. * fichier topoptim_09.dgibi
  2. ************************************************************************
  3. ************************************************************************
  4.  
  5. ************************************************************************
  6. ** Topology optimization of a simple 2D structure subjected to a
  7. ** mechanical loading, with imposed initial topology and remeshing.
  8. **
  9. ** Author:
  10. ** Guenhael Le Quilliec (LaMe - Polytech Tours)
  11. **
  12. ** Version:
  13. ** V1.0 2017/04/18 Original version compatible with TOPOPTIM V2.1
  14. ************************************************************************
  15.  
  16. * General options
  17. OPTI 'DIME' 2 'MODE' 'PLAN' 'CONT' 'ELEM' QUA4 ;
  18. OPTI 'TRAC' 'PSC' ;
  19.  
  20. * Number of mesh refinement iterations
  21. nb0 = 5 ;
  22.  
  23. * Initialize the optimization table
  24. tab0 = TABL ;
  25. tab0.'FRACTION_VOLUME' = 0.5 ;
  26. tab0.'MAX_CYCLES' = 0 ;
  27.  
  28. * Remeshing loop
  29. REPE loop1 nb0 ;
  30.  
  31. * Mesh
  32. nelx0 = 15 * &loop1 ;
  33. nely0 = 5 * &loop1 ;
  34. p0 = 0.0 0.0 ;
  35. p1 = 0.0 20.0 ;
  36. p2 = 60.0 0.0 ;
  37. lgn0 = DROI nely0 p1 p0 ;
  38. msh0 = TRAN lgn0 nelx0 p2 ;
  39. p2 = msh0 POIN 'PROC' p2 ;
  40.  
  41. * Model and material
  42. mod0 = MODE msh0 'MECANIQUE' 'ELASTIQUE' ;
  43. mat0 = MATE mod0 'YOUN' 210.0e9 'NU' 0.3 ;
  44.  
  45. * Boundary conditions and loading
  46. bc0 = (BLOQ 'UX' lgn0) ET (BLOQ 'UY' p2) ;
  47. load0 = FORC (0.0 -1.0) p1 ;
  48.  
  49. * Finite element model table
  50. mdl0 = TABL ;
  51. mdl0.'MODELE' = mod0 ;
  52. mdl0.'CARACTERISTIQUES' = mat0 ;
  53. mdl0.'BLOCAGES_MECANIQUES' = bc0 ;
  54. mdl0.'CHARGEMENT' = load0 ;
  55.  
  56. * Add the finite element model to the optimization table
  57. tab0.'RESOLUTION_LINEAIRE' = mdl0 ;
  58.  
  59. * Progressively increase the maximum number of cycles
  60. SI (&loop1 < nb0) ;
  61. tab0.'MAX_CYCLES' = tab0.'MAX_CYCLES' + 4 * &loop1 ;
  62. SINO ;
  63. tab0.'MAX_CYCLES' = tab0.'MAX_CYCLES' + 50 ;
  64. FINS ;
  65.  
  66. * Optimization
  67. TOPOPTIM tab0 ;
  68.  
  69. FIN loop1 ;
  70.  
  71. * Plot to screen
  72. topo0 = tab0.'TOPOLOGIE'.(tab0.'CYCLE') ;
  73. topomsh0 = tab0.'MAILLAGE'.(tab0.'CYCLE') ;
  74. TRAC (REDU topo0 topomsh0) (REDU mod0 topomsh0)
  75. (PROG 0.0 'PAS' (1.0 / 56.0) 1.0) ;
  76.  
  77. FIN ;
  78.  
  79.  
  80.  
  81.  

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