Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Efficient topology optimization in MATLAB using 88 lines of code

Published: 01 January 2011 Publication History

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 .

References

[1]
Alberty J, Carstensen C, Funken S (1999) Remarks around 50 lines of Matlab: short finite element implementation. Numer Algorithms 20(2-3):117-137.
[2]
Alberty J, Carstensen C, Funken S, Klose R (2002) Matlab implementation of the finite element method in elasticity. Computing 69(3):239-263.
[3]
Allaire G (2009) Shape and topology optimization by the level set method. http://www.cmap.polytechnique.fr/~allaire
[4]
Bendsøe M (1989) Optimal shape design as a material distribution problem. Struct Optim 1:193-202.
[5]
Bendsøe M, Sigmund O (2003) Topology optimization. Theory, methods and applications. Springer, Berlin.
[6]
Bourdin B (2001) Filters in topology optimization. Int J Numer Methods Eng 50(9):2143-2158.
[7]
Bruns TE, Tortorelli DA (2001) Topology optimization of non-linear elastic structures and compliant mechanisms. Comput Methods Appl Mech Eng 190(26-27):3443-3459.
[8]
Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidisc Optim 41(3):453-464.
[9]
Dabrowski M, Krotkiewski M, Schmid D (2008) MILAMIN: MATLAB-based finite element method solver for large problems. Geochemistry Geophysics Geosystems 9(4). 2007GC001719.
[10]
Davis T (2007) Creating sparse finite-element matrices in MATLAB. Guest blog in Loren on the art of MATLAB. http://blogs. mathworks.com/loren/2007/03/01/creating-sparse-finite-elementmatrices-in-matlab/; http://blogs.mathworks.com/loren/
[11]
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.
[12]
Díaz A, Sigmund O (1995) Checkerboard patterns in layout optimization. Struct Optim 10(1):40-45.
[13]
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-254.
[14]
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-226.
[15]
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.
[16]
Lazarov B, Sigmund O (2010) Filters in topology optimization based on Helmholtz type differential equations. Int J Numer Methods Eng.
[17]
Sigmund O (1994) Design of material structures using topology optimization. PhD thesis, DCAMM S-report S69, Department of Solid Mechanics, Technical University of Denmark.
[18]
Sigmund O (1997) On the design of compliant mechanisms using topology optimization. Mech Struct Mach 25(4):493-524.
[19]
Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21(2):120-127.
[20]
Sigmund O (2007) Morphology-based black and white filters for topology optimization. Struct Multidisc Optim 33(4-5):401- 424.
[21]
Sigmund O (2009) Manufacturing tolerant topology optimization. Acta Mech Sin 25(2):227-239.
[22]
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-75.
[23]
Suresh K (2010) A 199-line Matlab code for Pareto-optimal tracing in topology optimization. Struct Multidisc Optim 42(5):665-679.
[24]
Svanberg K (1987) Method of moving asymptotes--a new method for structural optimization. Int J Numer Methods Eng 24(2):359-373.
[25]
The MathWorks (2010) MATLAB programming fundamentals.
[26]
Wang F, Lazarov B, Sigmund O (2010) On projection methods, convergence and robust formulations in topology optimization (submitted).
[27]
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-336.

Cited By

View all
  • (2024)Accelerating topology optimization using deep learning-based image super-resolutionEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.108370133:PDOnline publication date: 1-Jul-2024
  • (2024)A two-stage network framework for topology optimization incorporating deep learning and physical informationEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.108185133:PBOnline publication date: 1-Jul-2024
  • (2024)Dynamic graph-based convergence acceleration for topology optimization in unstructured meshesEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.107916132:COnline publication date: 1-Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Structural and Multidisciplinary Optimization
Structural and Multidisciplinary Optimization  Volume 43, Issue 1
January 2011
145 pages

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 01 January 2011

Author Tags

  1. Computational efficiency
  2. Education
  3. MATLAB
  4. Topology optimization

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Accelerating topology optimization using deep learning-based image super-resolutionEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.108370133:PDOnline publication date: 1-Jul-2024
  • (2024)A two-stage network framework for topology optimization incorporating deep learning and physical informationEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.108185133:PBOnline publication date: 1-Jul-2024
  • (2024)Dynamic graph-based convergence acceleration for topology optimization in unstructured meshesEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.107916132:COnline publication date: 1-Jun-2024
  • (2024)A new rational approach to multi-input multi-output 3D topology optimizationComputers and Structures10.1016/j.compstruc.2024.107362298:COnline publication date: 15-Jul-2024
  • (2024)Construction of ellipsoid convex model of bounded uncertainties with outlier detection for application in non-probabilistic topology optimizationComputers and Structures10.1016/j.compstruc.2024.107322296:COnline publication date: 1-Jun-2024
  • (2024)Multi–materials topology optimization using deep neural network for coupled thermo–mechanical problemsComputers and Structures10.1016/j.compstruc.2023.107218291:COnline publication date: 15-Jan-2024
  • (2024)Designing piezoelectric stretcher through multiphysics topology for enhanced photodynamic therapy in cancer treatmentAdvances in Engineering Software10.1016/j.advengsoft.2024.103621191:COnline publication date: 1-May-2024
  • (2024)B-ITOAdvances in Engineering Software10.1016/j.advengsoft.2024.103620191:COnline publication date: 1-May-2024
  • (2024)Topology optimization for stationary fluid–structure interaction problems with turbulent flow via sequential integer linear programming and smooth explicit boundariesAdvances in Engineering Software10.1016/j.advengsoft.2024.103599190:COnline publication date: 1-Apr-2024
  • (2024)Convolutional encoder–decoder network using transfer learning for topology optimizationNeural Computing and Applications10.1007/s00521-023-09308-z36:8(4435-4450)Online publication date: 1-Mar-2024
  • Show More Cited By

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media