Efficient topology optimization in MATLAB using 88 lines of code

被引:1191
作者
Andreassen, Erik [1 ]
Clausen, Anders [1 ]
Schevenels, Mattias [2 ]
Lazarov, Boyan S. [1 ]
Sigmund, Ole [1 ]
机构
[1] Tech Univ Denmark, Dept Mech Engn, DK-2800 Lyngby, Denmark
[2] Katholieke Univ Leuven, Dept Civil Engn, B-3001 Leuven, Belgium
关键词
Topology optimization; MATLAB; Education; Computational efficiency; FILTERS; WRITTEN; DESIGN;
D O I
10.1007/s00158-010-0594-7
中图分类号
TP39 [计算机的应用];
学科分类号
081203 ; 0835 ;
摘要
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.
引用
收藏
页码:1 / 16
页数:16
相关论文
共 27 条
[1]   Matlab implementation of the finite element method in elasticity [J].
Alberty, J ;
Carstensen, C ;
Funken, SA ;
Klose, R .
COMPUTING, 2002, 69 (03) :239-263
[2]   Remarks around 50 lines of Matlab: short finite element implementation [J].
Alberty, J ;
Carstensen, C ;
Funken, SA .
NUMERICAL ALGORITHMS, 1999, 20 (2-3) :117-137
[3]  
ALLAIRE G, 2009, SHAPE TOPOLOGY OPTIM
[4]  
[Anonymous], 2013, Topology optimization: theory, methods, and applications
[5]  
[Anonymous], 2009, WATER RES
[6]  
Bendsoe M. P., 1989, Struct. Optim., V1, P193, DOI [10.1007/BF01650949, DOI 10.1007/BF01650949]
[7]   Filters in topology optimization [J].
Bourdin, B .
INTERNATIONAL JOURNAL FOR NUMERICAL METHODS IN ENGINEERING, 2001, 50 (09) :2143-2158
[8]   Topology optimization of non-linear elastic structures and compliant mechanisms [J].
Bruns, TE ;
Tortorelli, DA .
COMPUTER METHODS IN APPLIED MECHANICS AND ENGINEERING, 2001, 190 (26-27) :3443-3459
[9]   A discrete level-set topology optimization code written in Matlab [J].
Challis, Vivien J. .
STRUCTURAL AND MULTIDISCIPLINARY OPTIMIZATION, 2010, 41 (03) :453-464
[10]   MILAMIN: MATLAB-based finite element method solver for large problems [J].
Dabrowski, M. ;
Krotkiewski, M. ;
Schmid, D. W. .
GEOCHEMISTRY GEOPHYSICS GEOSYSTEMS, 2008, 9