An efficient 137-line MATLAB code for geometrically nonlinear topology optimization using bi-directional evolutionary structural optimization method

Abstract

Topology optimization, as a powerful conceptual design method, has been widely adopted in both academic research and industrial applications. To further promote the development of topology optimization, many computer programs have been published for educational purposes over the past decades. However, most of the computer programs are constructed based on a linear assumption. On the basis of bi-directional evolutionary structural optimization (BESO) method, the paper presents a MATLAB implementation of the geometrically nonlinear topology optimization code for compliance minimization of statically loaded structures. Excluding 19 lines which are used for explanation, only 118 lines are needed for the initialization of the design parameters, nonlinear finite element analysis, sensitivity calculation, sensitivity filtration, and topological design variables update. Different design problems can be solved by modifying several lines in the proposed program. The complete 137-line code is included as an Appendix and is intended for educational purposes only.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

References

  1. Andreassen E, Clausen A, Schevenels M, Lazarov BS, Sigmund O (2011) Efficient topology optimization in Matlab using 88 lines of code. Struct Multidiscip Optim 43(1):1–16. https://doi.org/10.1007/s00158-010-0594-7

    Article  MATH  Google Scholar 

  2. Bendsøe MP (1989) Optimal shape design as a material distribution problem. Struct Optim 1(4):193–202. https://doi.org/10.1007/BF01650949

    Article  Google Scholar 

  3. Bendsøe MP, Kikuchi N (1988) Generating optimal topologies in structural design using a homogenization method. Comput Methods Appl Mech Eng 71(2):197–224. https://doi.org/10.1016/0045-7825(88)90086-2

    MathSciNet  Article  MATH  Google Scholar 

  4. Bendsøe MP, Sigmund O (2003) Topology optimization: theory, methods and applications. Springer, Berlin

    Google Scholar 

  5. Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidiscip Optim 41(3):453–464. https://doi.org/10.1007/s00158-009-0430-0

    MathSciNet  Article  MATH  Google Scholar 

  6. Chen Q, Zhang X, Zhu B (2019) A 213-line topology optimization code for geometrically nonlinear structures. Struct Multidiscip Optim 59(5):1863–1879. https://doi.org/10.1007/s00158-018-2138-5

    MathSciNet  Article  Google Scholar 

  7. Crisfield MA (1991) Non-linear finite element analysis of solids and structures. Wiley, New York

    Google Scholar 

  8. Deaton JD, Grandhi RV (2014) A survey of structural and multidisciplinary continuum topology optimization: post 2000. Struct Multidiscip Optim 49(1):1–38. https://doi.org/10.1007/s00158-013-0956-z

    MathSciNet  Article  Google Scholar 

  9. Ferrari F, Sigmund O (2020) A new generation 99 line Matlab code for compliance topology optimization and its extension to 3D. Struct Multidiscip Optim 62(4):2211–2228. https://doi.org/10.1007/s00158-020-02629-w

    MathSciNet  Article  Google Scholar 

  10. Guo X, Zhang W, Zhang J, Yuan J (2016) Explicit structural topology optimization based on moving morphable components (MMC) with curved skeletons. Comput Methods Appl Mech Eng 310:711–748. https://doi.org/10.1016/j.cma.2016.07.018

    MathSciNet  Article  MATH  Google Scholar 

  11. Han YS, Xu B, Zhao L, Xie YM (2019) Topology optimization of continuum structures under hybrid additive-subtractive manufacturing constraints. Struct Multidiscip Optim 60(6):2571–2595. https://doi.org/10.1007/s00158-019-02334-3

    Article  Google Scholar 

  12. Huang X, Xie YM (2007) Convergent and mesh-independent solutions for the bi-directional evolutionary structural optimization method. Finite Elem Anal Des 43(14):1039–1049. https://doi.org/10.1016/j.finel.2007.06.006

    Article  Google Scholar 

  13. Huang X, Xie YM (2008) Topology optimization of nonlinear structures under displacement loading. Eng Struct 30:2057–2068. https://doi.org/10.1016/j.engstruct.2008.01.009

    Article  Google Scholar 

  14. Huang X, Xie YM (2009) Bi-directional evolutionary topology optimization of continuum structures with one or multiple materials. Comput Mech 43(3):393–401. https://doi.org/10.1007/s00466-008-0312-0

    MathSciNet  Article  MATH  Google Scholar 

  15. Huang X, Xie YM (2010a) A further review of ESO type methods for topology optimization. Struct Multidiscip Optim 41(5):671–683. https://doi.org/10.1007/s00158-010-0487-9

    Article  Google Scholar 

  16. Huang X, Xie YM (2010b) Topology optimization of continuum structures: methods and applications. Wiley, Chichester. https://doi.org/10.1002/9780470689486

    Google Scholar 

  17. Kim C, Jung M, Yamada T et al (2020) Freefem++ code for reaction-diffusion equation–based topology optimization: for high-resolution boundary representation using adaptive mesh refinement. Struct Multidiscip Optim 62:439–455. https://doi.org/10.1007/s00158-020-02498-3

    MathSciNet  Article  Google Scholar 

  18. Lagaros ND, Vasileiou N, Kazakis G (2019) Ac# code for solving 3d topology optimization problems using sap2000. Optim Eng 20(1):1–35. https://doi.org/10.1007/s11081-018-9384-7

    Article  MATH  Google Scholar 

  19. Laurain A (2018) A level set-based structural optimization code using FEniCS. Struct Multidiscip Optim 58(3):1311–1334. https://doi.org/10.1007/s00158-018-1950-2

    MathSciNet  Article  Google Scholar 

  20. Liang Y, Cheng G (2020) Further elaborations on topology optimization via sequential integer programming and canonical relaxation algorithm and 128-line MATLAB code. Struct Multidiscip Optim 61(1):411–431. https://doi.org/10.1007/s00158-019-02396-3

    Article  Google Scholar 

  21. Liu K, Tovar A (2014) An efficient 3d topology optimization code written in Matlab. Struct Multidiscip Optim 50(6):1175–1196. https://doi.org/10.1007/s00158-014-1107-x

    MathSciNet  Article  Google Scholar 

  22. Loyola RA, Querin OM, Jiménez AG et al (2018) A sequential element rejection and admission (SERA) topology optimization code written in Matlab. Struct Multidiscip Optim 58(3):1297–1310. https://doi.org/10.1007/s00158-018-1939-x

    MathSciNet  Article  Google Scholar 

  23. Luo Z, Tong L, Wang MY, Wang S (2007) Shape and topology optimization of compliant mechanisms using a parameterization level set method. J Comput Phys 227(1):680–705. https://doi.org/10.1016/j.jcp.2007.08.011

    MathSciNet  Article  MATH  Google Scholar 

  24. Picelli R, Sivapuram R, Xie YM (2020) A 101-line MATLAB code for topology optimization using binary variables and integer programming. Struct Multidiscip Optim. https://doi.org/10.1007/s00158-020-02719-9

  25. Qian X (2013) Topology optimization in B-spline space. Comput Methods Appl Mech Eng 265:15–35. https://doi.org/10.1016/j.cma.2013.06.001

    MathSciNet  Article  MATH  Google Scholar 

  26. Rong JH, Xie YM, Yang XY (2001) An improved method for evolutionary structural optimisation against buckling. Comput Struct 79(3):253–263. https://doi.org/10.1016/S0045-7949(00)00145-0

    Article  Google Scholar 

  27. Rozvany GIN (2001) Aims, scope, methods, history and unified terminology of computer-aided topology optimization in structural mechanics. Struct Multidiscip Optim 21(2):90–108. https://doi.org/10.1007/s001580050174

    MathSciNet  Article  Google Scholar 

  28. Sethian JA, Wiegmann A (2000) Structural boundary design via level set and immersed interface methods. Int J Numer Methods Eng 163(2):489–528. https://doi.org/10.1006/jcph.2000.6581

    MathSciNet  Article  MATH  Google Scholar 

  29. Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidiscip Optim 21(2):120–127. https://doi.org/10.1007/s001580050176

    Article  Google Scholar 

  30. Sigmund O, Maute K (2013a) Topology optimization approaches-a comparative review. Struct Multidiscip Optim 48(6):1031–1055. https://doi.org/10.1007/s00158-013-0978-6

    MathSciNet  Article  Google Scholar 

  31. Sigmund O, Maute K (2013b) Topology optimization approaches-a comparative review. Struct Multidiscip Optim 48(6):1031–1055. https://doi.org/10.1007/s00158-013-0978-6

    MathSciNet  Article  Google Scholar 

  32. Suzuki K, Kikuchi N (1991) A homogenization method for shape and topology optimization. Comput Methods Appl Mech Eng 93(3):291–318. https://doi.org/10.1016/0045-7825(91)90245-2

    Article  MATH  Google Scholar 

  33. Talischi C, Paulino GH, Pereira A, Menezes IFM (2012) Polytop: a matlab implementation of a general topology optimization framework using unstructured polygonal finite element meshes. Struct Multidiscip Optim 45(3):329–357. https://doi.org/10.1007/s00158-011-0696-x

    MathSciNet  Article  MATH  Google Scholar 

  34. Tavakoli R, Mohseni SM (2014) Alternating active-phase algorithm for multimaterial topology optimization problems: a 115-line Matlab implementation. Struct Multidiscip Optim 49(4):621–642. https://doi.org/10.1007/s00158-013-0999-1

    MathSciNet  Article  Google Scholar 

  35. Wang MY, Wang X, Guo D (2003) A level set method for structural topology optimization. Comput Methods Appl Mech Eng 192:227–246. https://doi.org/10.1016/S0045-7825(02)00559-5

    MathSciNet  Article  MATH  Google Scholar 

  36. Wang R, Zhang X, Zhu B (2019) Imposing minimum length scale in moving morphable component (mmc)-based topology optimization using an effective connection status (ecs) control method. Comput Methods Appl Mech Eng 351:667–693. https://doi.org/10.1016/j.cma.2019.04.007

    MathSciNet  Article  MATH  Google Scholar 

  37. Wei P, Li Z, Li X, Wang MY (2018) An 88-line MATLAB code for the parameterized level set method based topology optimization using radial basis functions. Struct Multidiscip Optim 58:831–849. https://doi.org/10.1007/s00158-018-1904-8

    MathSciNet  Article  Google Scholar 

  38. Xia L, Breitkopf P (2015) Design of materials using topology optimization and energy-based homogenization approach in Matlab. Struct Multidiscip Optim 52:1229–1241. https://doi.org/10.1007/s00158-015-1294-0

    MathSciNet  Article  Google Scholar 

  39. Xia L, Xia Q, Huang X, Xie YM (2018) Bi-directional evolutionary structural optimization on advanced structures and materials: a comprehensive review. Arch Comput Methods Eng 25:437–478. https://doi.org/10.1007/s11831-016-9203-2

    MathSciNet  Article  MATH  Google Scholar 

  40. Xie YM, Steven GP (1993) A simple evolutionary procedure for structural optimization. Comput Struct 49(5):885–896. https://doi.org/10.1016/0045-7949(93)90035-C

    Article  Google Scholar 

  41. Xie YM, Steven GP (1994) Optimal design of multiple load case structures using an evolutionary procedure. Eng Comput 11(4):295–302. https://doi.org/10.1108/02644409410799290

    Article  MATH  Google Scholar 

  42. Xu B, Han YS, Zhao L (2020) Bi-directional evolutionary topology optimization of geometrically nonlinear continuum structures with stress constraints. Appl Math Model 80:771–791. https://doi.org/10.1016/j.apm.2019.12.009

    MathSciNet  Article  MATH  Google Scholar 

  43. Yaghmaei M, Ghoddosian A, Khatibi MM (2020) A filter-based level set topology optimization method using a 62-line Matlab code. Struct Multidiscip Optim 62:1001–1018. https://doi.org/10.1007/s00158-020-02540-4

    MathSciNet  Article  Google Scholar 

  44. Zhang W, Yuan J, Zhang J, Guo X (2016) A new topology optimization approach based on moving morphable components (mmc) and the ersatz material model. Struct Multidiscip Optim 53(6):1243–1260. https://doi.org/10.1007/s00158-015-1372-3

    MathSciNet  Article  Google Scholar 

  45. Zhou M, Rozvany GIN (1991) The COC algorithm, part II: topological, geometrical and generalized shape optimization. Comput Methods Appl Mech Eng 89(1):309–336. https://doi.org/10.1016/0045-7825(91)90046-9

    Article  Google Scholar 

  46. Zhu J, Zhang W, Xia L (2016) Topology optimization in aircraft and aerospace structures design. Arch Comput Methods Eng 23(4):595–622. https://doi.org/10.1007/s11831-015-9151-2

    MathSciNet  Article  MATH  Google Scholar 

  47. Zhu B, Zhang X, Zhang H, Liang J, Zang H, Li H, Wang R (2020a) Design of compliant mechanisms using continuum topology optimization: a review. Mech Mach Theory 143:103622. https://doi.org/10.1016/j.mechmachtheory.2019.103622

    Article  Google Scholar 

  48. Zhu B, Zhang X, Li H, Liang J, Wang R, Li H, Nishiwaki S (2020b) An 89-line code for geometrically nonlinear topology optimization written in FreeFEM. Struct Multidiscip Optim. https://doi.org/10.1007/s00158-020-02733-x

  49. Zuo ZH, Xie YM (2015) A simple and compact python code for complex 3d topology optimization. Adv Eng Softw 85:1–11. https://doi.org/10.1016/j.advengsoft.2015.02.006

    Article  Google Scholar 

Download references

Funding

This work was sponsored by the National Natural Science Foundation of China (11872311).

Author information

Affiliations

Authors

Corresponding author

Correspondence to Bin Xu.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Replication of results

All the necessary data to reproduce the results reported here are provided in the Appendix. Readers can also contact us to obtain the codes by email: hanys0407@mail.nwpu.edu.cn

Additional information

Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Highlights

• A 137-line MATLAB code for topological optimization of geometrically nonlinear structure is constructed.

• The presented code is easier to implement and understand.

• The iterative curves converge to constant values stably, and the convergence rate is fast.

Responsible Editor: Emilio Carlos Nelli Silva

Appendices

Appendix 1: Topology optimization of geometrically nonlinear structure

figuremfiguremfigurem

Appendix 2: Topology optimization of linear structure

figurenfigurenfiguren

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Han, Y., Xu, B. & Liu, Y. An efficient 137-line MATLAB code for geometrically nonlinear topology optimization using bi-directional evolutionary structural optimization method. Struct Multidisc Optim (2021). https://doi.org/10.1007/s00158-020-02816-9

Download citation

Keywords

  • Topology optimization
  • MATLAB code
  • Geometrically nonlinear
  • BESO method
  • Education