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. graph0 = FAUX ;
  17.  
  18. * General options
  19. OPTI 'DIME' 2 'MODE' 'PLAN' 'CONT' 'ELEM' QUA4 ;
  20.  
  21. * Number of mesh refinement iterations
  22. nb0 = 5 ;
  23.  
  24. * Initialize the optimization table
  25. tab0 = TABL ;
  26. tab0.'FRACTION_VOLUME' = 0.5 ;
  27. tab0.'MAX_CYCLES' = 0 ;
  28. tab0.'TRAC' = graph0 ;
  29.  
  30. * Remeshing loop
  31. REPE loop1 nb0 ;
  32.  
  33. * Mesh
  34. nelx0 = 15 * &loop1 ;
  35. nely0 = 5 * &loop1 ;
  36. p0 = 0.0 0.0 ;
  37. p1 = 0.0 20.0 ;
  38. p2 = 60.0 0.0 ;
  39. lgn0 = DROI nely0 p1 p0 ;
  40. msh0 = TRAN lgn0 nelx0 p2 ;
  41. p2 = msh0 POIN 'PROC' p2 ;
  42.  
  43. * Model and material
  44. mod0 = MODE msh0 'MECANIQUE' 'ELASTIQUE' ;
  45. mat0 = MATE mod0 'YOUN' 210.0e9 'NU' 0.3 ;
  46.  
  47. * Boundary conditions and loading
  48. bc0 = (BLOQ 'UX' lgn0) ET (BLOQ 'UY' p2) ;
  49. load0 = FORC (0.0 -1.0) p1 ;
  50.  
  51. * Finite element model table
  52. mdl0 = TABL ;
  53. mdl0.'MODELE' = mod0 ;
  54. mdl0.'CARACTERISTIQUES' = mat0 ;
  55. mdl0.'BLOCAGES_MECANIQUES' = bc0 ;
  56. mdl0.'CHARGEMENT' = load0 ;
  57.  
  58. * Add the finite element model to the optimization table
  59. tab0.'RESOLUTION_LINEAIRE' = mdl0 ;
  60.  
  61. * Progressively increase the maximum number of cycles
  62. SI (&loop1 < nb0) ;
  63. tab0.'MAX_CYCLES' = tab0.'MAX_CYCLES' + 4 * &loop1 ;
  64. SINO ;
  65. tab0.'MAX_CYCLES' = tab0.'MAX_CYCLES' + 50 ;
  66. FINS ;
  67.  
  68. * Optimization
  69. TOPOPTIM tab0 ;
  70.  
  71. FIN loop1 ;
  72.  
  73. * Plot to screen
  74. topo0 = tab0.'TOPOLOGIE'.(tab0.'CYCLE') ;
  75. topomsh0 = tab0.'MAILLAGE'.(tab0.'CYCLE') ;
  76. SI graph0 ;
  77. TRAC (REDU topo0 topomsh0) (REDU mod0 topomsh0)
  78. (PROG 0.0 'PAS' (1.0 / 56.0) 1.0) ;
  79. FINS ;
  80.  
  81. FIN ;
  82.  
  83.  
  84.  
  85.  

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