* fichier topoptim_09.dgibi ************************************************************************ ************************************************************************ ************************************************************************ ** Topology optimization of a simple 2D structure subjected to a ** mechanical loading, with imposed initial topology and remeshing. ** ** Author: ** Guenhael Le Quilliec (LaMe - Polytech Tours) ** ** Version: ** V1.0 2017/04/18 Original version compatible with TOPOPTIM V2.1 ************************************************************************ graph0 = FAUX ; * General options OPTI 'DIME' 2 'MODE' 'PLAN' 'CONT' 'ELEM' QUA4 ; * Number of mesh refinement iterations nb0 = 5 ; * Initialize the optimization table tab0 = TABL ; tab0.'FRACTION_VOLUME' = 0.5 ; tab0.'MAX_CYCLES' = 0 ; tab0.'TRAC' = graph0 ; * Remeshing loop REPE loop1 nb0 ; * Mesh nelx0 = 15 * &loop1 ; nely0 = 5 * &loop1 ; p0 = 0.0 0.0 ; p1 = 0.0 20.0 ; p2 = 60.0 0.0 ; lgn0 = DROI nely0 p1 p0 ; msh0 = TRAN lgn0 nelx0 p2 ; p2 = msh0 POIN 'PROC' p2 ; * Model and material mod0 = MODE msh0 'MECANIQUE' 'ELASTIQUE' ; mat0 = MATE mod0 'YOUN' 210.0e9 'NU' 0.3 ; * Boundary conditions and loading bc0 = (BLOQ 'UX' lgn0) ET (BLOQ 'UY' p2) ; load0 = FORC (0.0 -1.0) p1 ; * Finite element model table mdl0 = TABL ; mdl0.'MODELE' = mod0 ; mdl0.'CARACTERISTIQUES' = mat0 ; mdl0.'BLOCAGES_MECANIQUES' = bc0 ; mdl0.'CHARGEMENT' = load0 ; * Add the finite element model to the optimization table tab0.'RESOLUTION_LINEAIRE' = mdl0 ; * Progressively increase the maximum number of cycles SI (&loop1 < nb0) ; tab0.'MAX_CYCLES' = tab0.'MAX_CYCLES' + 4 * &loop1 ; SINO ; tab0.'MAX_CYCLES' = tab0.'MAX_CYCLES' + 50 ; FINS ; * Optimization TOPOPTIM tab0 ; FIN loop1 ; * Plot to screen topo0 = tab0.'TOPOLOGIE'.(tab0.'CYCLE') ; topomsh0 = tab0.'MAILLAGE'.(tab0.'CYCLE') ; SI graph0 ; TRAC (REDU topo0 topomsh0) (REDU mod0 topomsh0) (PROG 0.0 'PAS' (1.0 / 56.0) 1.0) ; FINS ; FIN ;