Skip to main content
Erschienen in: Structural and Multidisciplinary Optimization 1/2011

01.01.2011 | Educational Article

Efficient topology optimization in MATLAB using 88 lines of code

verfasst von: Erik Andreassen, Anders Clausen, Mattias Schevenels, Boyan S. Lazarov, Ole Sigmund

Erschienen in: Structural and Multidisciplinary Optimization | Ausgabe 1/2011

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

The paper presents an efficient 88 line MATLAB code for topology optimization. It has been developed using the 99 line code presented by Sigmund (Struct Multidisc Optim 21(2):120–127, 2001) as a starting point. The original code has been extended by a density filter, and a considerable improvement in efficiency has been achieved, mainly by preallocating arrays and vectorizing loops. A speed improvement with a factor of 100 is obtained for a benchmark example with 7,500 elements. Moreover, the length of the code has been reduced to a mere 88 lines. These improvements have been accomplished without sacrificing the readability of the code. The 88 line code can therefore be considered as a valuable successor to the 99 line code, providing a practical instrument that may help to ease the learning curve for those entering the field of topology optimization. The paper also discusses simple extensions of the basic code to include recent PDE-based and black-and-white projection filtering methods. The complete 88 line code is included as an appendix and can be downloaded from the web site www.​topopt.​dtu.​dk.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Anhänge
Nur mit Berechtigung zugänglich
Fußnoten
1
The slight difference which can be observed between the 88-line and the 99-line code is due to the difference in the SIMP formulation.
 
Literatur
Zurück zum Zitat Alberty J, Carstensen C, Funken S (1999) Remarks around 50 lines of Matlab: short finite element implementation. Numer Algorithms 20(2–3):117–137MATHCrossRefMathSciNet Alberty J, Carstensen C, Funken S (1999) Remarks around 50 lines of Matlab: short finite element implementation. Numer Algorithms 20(2–3):117–137MATHCrossRefMathSciNet
Zurück zum Zitat Alberty J, Carstensen C, Funken S, Klose R (2002) Matlab implementation of the finite element method in elasticity. Computing 69(3):239–263CrossRefMathSciNet Alberty J, Carstensen C, Funken S, Klose R (2002) Matlab implementation of the finite element method in elasticity. Computing 69(3):239–263CrossRefMathSciNet
Zurück zum Zitat Bendsøe M (1989) Optimal shape design as a material distribution problem. Struct Optim 1:193–202CrossRef Bendsøe M (1989) Optimal shape design as a material distribution problem. Struct Optim 1:193–202CrossRef
Zurück zum Zitat Bendsøe M, Sigmund O (2003) Topology optimization. Theory, methods and applications. Springer, Berlin Bendsøe M, Sigmund O (2003) Topology optimization. Theory, methods and applications. Springer, Berlin
Zurück zum Zitat Bruns TE, Tortorelli DA (2001) Topology optimization of non-linear elastic structures and compliant mechanisms. Comput Methods Appl Mech Eng 190(26–27):3443–3459MATHCrossRef Bruns TE, Tortorelli DA (2001) Topology optimization of non-linear elastic structures and compliant mechanisms. Comput Methods Appl Mech Eng 190(26–27):3443–3459MATHCrossRef
Zurück zum Zitat Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidisc Optim 41(3):453–464CrossRefMathSciNet Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidisc Optim 41(3):453–464CrossRefMathSciNet
Zurück zum Zitat Dabrowski M, Krotkiewski M, Schmid D (2008) MILAMIN: MATLAB-based finite element method solver for large problems. Geochemistry Geophysics Geosystems 9(4). doi:10.1029/2007GC001719 Dabrowski M, Krotkiewski M, Schmid D (2008) MILAMIN: MATLAB-based finite element method solver for large problems. Geochemistry Geophysics Geosystems 9(4). doi:10.​1029/​2007GC001719
Zurück zum Zitat Davis T (2008) User guide for CHOLMOD: a sparse Cholesky factorization and modification package. Department of Computer and Information Science and Engineering, University of Florida, Gainesville, FL, USA Davis T (2008) User guide for CHOLMOD: a sparse Cholesky factorization and modification package. Department of Computer and Information Science and Engineering, University of Florida, Gainesville, FL, USA
Zurück zum Zitat Díaz A, Sigmund O (1995) Checkerboard patterns in layout optimization. Struct Optim 10(1):40–45CrossRef Díaz A, Sigmund O (1995) Checkerboard patterns in layout optimization. Struct Optim 10(1):40–45CrossRef
Zurück zum Zitat Guest J, Prevost J, Belytschko T (2004) Achieving minimum length scale in topology optimization using nodal design variables and projection functions. Int J Numer Methods Eng 61(2):238–254MATHCrossRefMathSciNet Guest J, Prevost J, Belytschko T (2004) Achieving minimum length scale in topology optimization using nodal design variables and projection functions. Int J Numer Methods Eng 61(2):238–254MATHCrossRefMathSciNet
Zurück zum Zitat Jog C, Haber R (1996) Stability of finite element models for distributed-parameter optimization and topology design. Comput Methods Appl Mech Eng 130(3–4):203–226MATHCrossRefMathSciNet Jog C, Haber R (1996) Stability of finite element models for distributed-parameter optimization and topology design. Comput Methods Appl Mech Eng 130(3–4):203–226MATHCrossRefMathSciNet
Zurück zum Zitat Lazarov B, Sigmund O (2009) Sensitivity filters in topology optimisation as a solution to helmholtz type differential equation. In: Proc. of the 8th world congress on structural and multidisciplinary optimization Lazarov B, Sigmund O (2009) Sensitivity filters in topology optimisation as a solution to helmholtz type differential equation. In: Proc. of the 8th world congress on structural and multidisciplinary optimization
Zurück zum Zitat Lazarov B, Sigmund O (2010) Filters in topology optimization based on Helmholtz type differential equations. Int J Numer Methods Eng. doi:10.1002/nme.3072 Lazarov B, Sigmund O (2010) Filters in topology optimization based on Helmholtz type differential equations. Int J Numer Methods Eng. doi:10.​1002/​nme.​3072
Zurück zum Zitat Sigmund O (1994) Design of material structures using topology optimization. PhD thesis, DCAMM S-report S69, Department of Solid Mechanics, Technical University of Denmark Sigmund O (1994) Design of material structures using topology optimization. PhD thesis, DCAMM S-report S69, Department of Solid Mechanics, Technical University of Denmark
Zurück zum Zitat Sigmund O (1997) On the design of compliant mechanisms using topology optimization. Mech Struct Mach 25(4):493–524CrossRef Sigmund O (1997) On the design of compliant mechanisms using topology optimization. Mech Struct Mach 25(4):493–524CrossRef
Zurück zum Zitat Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21(2):120–127CrossRef Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21(2):120–127CrossRef
Zurück zum Zitat Sigmund O (2007) Morphology-based black and white filters for topology optimization. Struct Multidisc Optim 33(4–5):401–424CrossRef Sigmund O (2007) Morphology-based black and white filters for topology optimization. Struct Multidisc Optim 33(4–5):401–424CrossRef
Zurück zum Zitat Sigmund O (2009) Manufacturing tolerant topology optimization. Acta Mech Sin 25(2):227–239CrossRef Sigmund O (2009) Manufacturing tolerant topology optimization. Acta Mech Sin 25(2):227–239CrossRef
Zurück zum Zitat Sigmund O, Petersson J (1998) Numerical instabilities in topology optimization: a survey on procedures dealing with checkerboards, mesh-dependencies and local minima. Struct Optim 16(1):68–75CrossRef Sigmund O, Petersson J (1998) Numerical instabilities in topology optimization: a survey on procedures dealing with checkerboards, mesh-dependencies and local minima. Struct Optim 16(1):68–75CrossRef
Zurück zum Zitat Svanberg K (1987) Method of moving asymptotes—a new method for structural optimization. Int J Numer Methods Eng 24(2):359–373MATHCrossRefMathSciNet Svanberg K (1987) Method of moving asymptotes—a new method for structural optimization. Int J Numer Methods Eng 24(2):359–373MATHCrossRefMathSciNet
Zurück zum Zitat The MathWorks (2010) MATLAB programming fundamentals The MathWorks (2010) MATLAB programming fundamentals
Zurück zum Zitat Wang F, Lazarov B, Sigmund O (2010) On projection methods, convergence and robust formulations in topology optimization (submitted) Wang F, Lazarov B, Sigmund O (2010) On projection methods, convergence and robust formulations in topology optimization (submitted)
Zurück zum Zitat Zhou M, Rozvany G (1991) The COC algorithm. Part II: topological, geometrical and generalized shape optimization. Comput Methods Appl Mech Eng 89(1–3):309–336CrossRef Zhou M, Rozvany G (1991) The COC algorithm. Part II: topological, geometrical and generalized shape optimization. Comput Methods Appl Mech Eng 89(1–3):309–336CrossRef
Metadaten
Titel
Efficient topology optimization in MATLAB using 88 lines of code
verfasst von
Erik Andreassen
Anders Clausen
Mattias Schevenels
Boyan S. Lazarov
Ole Sigmund
Publikationsdatum
01.01.2011
Verlag
Springer-Verlag
Erschienen in
Structural and Multidisciplinary Optimization / Ausgabe 1/2011
Print ISSN: 1615-147X
Elektronische ISSN: 1615-1488
DOI
https://doi.org/10.1007/s00158-010-0594-7

Weitere Artikel der Ausgabe 1/2011

Structural and Multidisciplinary Optimization 1/2011 Zur Ausgabe

    Marktübersichten

    Die im Laufe eines Jahres in der „adhäsion“ veröffentlichten Marktübersichten helfen Anwendern verschiedenster Branchen, sich einen gezielten Überblick über Lieferantenangebote zu verschaffen.