Skip to main content
Log in

An efficient 2D/3D NURBS-based topology optimization implementation using page-wise matrix operation in MATLAB

  • Educational Paper
  • Published:
Structural and Multidisciplinary Optimization Aims and scope Submit manuscript

Abstract

This paper presents a computationally efficient MATLAB implementation of two-dimensional/three-dimensional (2D/3D) topology optimization in non-uniform rational basis spline (NURBS) framework for educational purposes. The pseudo-densities and the related weights at control points define the NURBS-based density surface and are also simultaneously taken as the design variables, which extremely increases the computational expense due to the iterative numerical operations at Gauss integration points for isogeometric analysis (IGA) and sensitivity calculation. Thus, this paper designs the page-wise matrix operation and its implementation on graphics processing unit (GPU) to replace the element loop-based iteration to improve the computational efficiency. For the 2D problems, the main program of valid 34 lines of code (Appendix 1) is mainly divided by initialization of lines 3–11, IGA and sensitivity analysis of lines 13–30, and optimizer of lines 32–34. The sensitivity analysis function of valid 51 lines of code (Appendix 2) is programmed by the page-wise matrix operation. The optimization problems are solved by the Method of Moving Asymptotes (MMA) algorithm. The computational efficiency is largely improved in terms of the performance evaluation of the benchmark cases between the page-wise matrix-based procedure structure and the conventional element loop-based iteration algorithm. All programs that support the results of this study are completely provided and serve educational purposes for students and newcomers.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18

Abbreviations

2D:

Two-dimensional

3D:

Three-dimensional

CAD:

Computer-aided design

ELP:

Element loop

ESO:

Evolutionary structural optimization

GPU:

Graphics processing unit

IGA:

Isogeometric analysis

MMA:

Method of Moving Asymptotes

NURBS:

Non-uniform rational basis spline

PWM:

Page-wise matrix

SIMP:

Solid isotropic material with penalization

References

  • Agrawal V, Gautam SS (2019) IGA: a simplified introduction and implementation details for finite element users. J Inst Eng C 100(3):561–585

    Google Scholar 

  • Allaire G, Michailidis G (2018) Modal basis approaches in shape and topology optimization of frequency response problems. Int J Numer Methods Eng 113(8):1258–1299

    MathSciNet  Google Scholar 

  • Allaire G, Jouve F, Toader AM (2004) Structural optimization using sensitivity analysis and a level-set method. J Comput Phys 194(1):363–393

    MathSciNet  Google Scholar 

  • Andreassen E, Andreasen CS (2014) How to determine composite material properties using numerical homogenization. Comput Mater Sci 83:488–495

    Google Scholar 

  • Andreassen E, Clausen A, Schevenels M, Lazarov BS, Sigmund O (2011) Efficient topology optimization in MATLAB using 88 lines of code. Struct Multidisc Optim 43(1):1–16

    Google Scholar 

  • Bendsøe MP (1989) Optimal shape design as a material distribution problem. Struct Optim 1:193–202

    Google Scholar 

  • Bendsøe MP, Kikuchi N (1988) Generating optimal topologies in structural design using homogenization method. Comput Methods Appl Mech Eng 71(2):197–224

    MathSciNet  Google Scholar 

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

    Google Scholar 

  • Challis VJ (2010) A discrete level-set topology optimization code written in MATLAB. Struct Multidisc Optim 41(3):453–464

    MathSciNet  Google Scholar 

  • Cheng GD, Jiang Z (1992) Study on topology optimization with stress constraints. Eng Optim 20(2):129–148

    Google Scholar 

  • Costa G, Montemurro M, Pailhés J (2018) A 2D topology optimization algorithm in NURBS framework with geometric constraints. Int J Mech Mater Des 14:669–696

    Google Scholar 

  • Costa G, Montemurro M, Pailhés J (2019a) Minimum length scale control in a NURBS-based SIMP method. Comput Methods Appl Mech Eng 354:963–989

    MathSciNet  Google Scholar 

  • Costa G, Montemurro M, Pailhés J, Perry N (2019b) Maximum length scale requirement in a topology optimization method based on NURBS hyper-surfaces. CIRP Ann Manuf Technol 68:153–156

    Google Scholar 

  • Costa G, Montemurro M, Pailhés J (2021) NURBS hyper-surfaces for 3D topology optimization problems. Mech Adv Mater Struct 28(7):665–684

    Google Scholar 

  • Cottrell JA, Hughes TJR, Bazilevs Y (2009) Isogeometric analysis: toward integration of CAD and FEA. John, New York

    Google Scholar 

  • Da CD, Xia L, Li GY, Huang XD (2018) Evolutionary topology optimization of continuum structures with smooth boundary representation. Struct Multidisc Optim 57(6):2143–2159

    MathSciNet  Google Scholar 

  • Dong GY, Tang YL, Zhao YYF (2019) A 149 line homogenization code for three-dimensional cellular materials written in MATLAB. J Eng Mater Technol Trans ASME 141:011005

    Google Scholar 

  • Gao J, Gao L, Luo Z, Li PG (2019a) Isogeometric topology optimization for continuum structures using density distribution function. Int J Numer Methods Eng 119:991–1017

    MathSciNet  Google Scholar 

  • Gao J, Luo Z, Xia L, Gao L (2019b) Concurrent topology optimization of multiscale composite structures in MATLAB. Struct Multidisc Optim 60(6):2621–2651

    MathSciNet  Google Scholar 

  • Gao J, Xue HP, Gao L, Luo Z (2019c) Topology optimization for auxetic metamaterials based on isogeometric analysis. Comput Methods Appl Mech Eng 352:211–236

    MathSciNet  Google Scholar 

  • Gao J, Luo Z, Xiao M, Gao L, Li PG (2020a) A NURBS-based multi-material interpolation (N-MMI) for isogeometric topology optimization of structures. Appl Math Model 81:818–843

    MathSciNet  Google Scholar 

  • Gao J, Xiao M, Gao L, Yan JH, Yan WT (2020b) Isogeometric topology optimization for computational design of re-entrant and chiral auxetic composites. Comput Methods Appl Mech Eng 362:112876

    MathSciNet  Google Scholar 

  • Gao J, Xiao M, Zhang Y, Gao L (2020c) A comprehensive review of isogeometric topology optimization: methods, applications and prospects. Chinese J Mech Eng 33:87

    Google Scholar 

  • Gao J, Wang L, Luo Z, Gao L (2021) IgaTop: an implementation of topology optimization for structures using IGA in MATLAB. Struct Multidisc Optim 64(3):223–233

    MathSciNet  Google Scholar 

  • Guo X, Zhang WS, Wang MY, Wei P (2011) Stress-related topology optimization via level set approach. Comput Methods Appl Mech Eng 200(47–48):3439–3452

    MathSciNet  Google Scholar 

  • Gupta V, Jameel A, Verma SK, Anand S, Anand Y (2023) An insight on NURBS based isogeometric analysis, its current status and involvement in mechanical applications. Arch Comput Methods Eng 30(2):1187–1230

    Google Scholar 

  • Hassani B, Hinton E (1999) Homogenization and structural topology optimization: theory, practice and software. Springer, Berlin

    Google Scholar 

  • Hassani B, Khanzadi M, Tavakkoli SM (2012) An isogeometrical approach to structural topology optimization by optimality criteria. Struct Multidisc Optim 45(2):223–233

    MathSciNet  Google Scholar 

  • Huang XD, Xie YM (2010) A further review of ESO type methods for topology optimization. Struct Multidisc Optim 41(5):671–683

    Google Scholar 

  • Hughes TJR, Cottrell JA, Bazilevs Y (2005) Isogeometric analysis: CAD, finite elements, NURBS, exact geometry and mesh refinement. Comput Methods Appl Mech Eng 194:4135–4195

    MathSciNet  Google Scholar 

  • Kang Z, Wang YQ (2011) Structural topology optimization based on non-local Shepard interpolation of density field. Comput Methods Appl Mech Eng 200(49–52):1669–1700

    MathSciNet  Google Scholar 

  • Kang Z, Wang YQ (2012) A nodal variable method of structural topology optimization based on Shepard interpolant. Int J Numer Methods Eng 90(3):329–342

    MathSciNet  Google Scholar 

  • Liu K, Tovar A (2014) An efficient 3D topology optimization code written in MATLAB. Struct Multidisc Optim 50(6):1175–1196

    MathSciNet  Google Scholar 

  • Liu P, Shi LT, Kang Z (2020) Multi-material structural topology optimization considering material interfacial stress constraints. Comput Methods Appl Mech Eng 363:112887

    MathSciNet  Google Scholar 

  • Montemurro M (2022) On the structural stiffness maximisation of anisotropic continua under inhomogeneous Neumann-Dirichlet boundary conditions. Compos Struct 287:115289

    Google Scholar 

  • Montemurro M, Roiné T, Pailhès J (2022) Multi-scale design of multi-material lattice structures through a CAD-compatible topology optimisation algorithm. Eng Struct 273:115009

    Google Scholar 

  • Nguyen VP, Anitescu C, Bordas SPA, Rabczuk T (2015) Isogeometric analysis: an overview and computer implementation aspects. Math Comput Simul 117:89–116

    MathSciNet  Google Scholar 

  • Piegl L, Tiller W (1997) The NURBS book, 2nd edn. Springer, New York

    Google Scholar 

  • Qian XP (2013) Topology optimization in B-spline space. Comput Methods Appl Mech Eng 265:15–35

    MathSciNet  Google Scholar 

  • Rodriguez T, Montemurro M, Texier PL, Pailhès J (2020) Structural displacement requirement in a topology optimization algorithm based on isogeometric entities. J Optim Theor Appl 184:250–276

    MathSciNet  Google Scholar 

  • Roiné T, Montemurro M, Pailhès J (2021) Stress-based topology optimization through non-uniform rational basis spline hyper-surfaces. Mech Adv Mater Struct 29(23):3387–3407

    Google Scholar 

  • Sigmund O (2001) A 99 line topology optimization code written in MATLAB. Struct Multidisc Optim 21(2):120–127

    Google Scholar 

  • Sigmund O, Maute K (2013) Topology optimization approaches: a comparative review. Struct Multidisc Optim 48(6):1031–1055

    Google Scholar 

  • Spink M, Claxton D, de Falco C, Vázquez R (2001) NURBS Toolbox. http://octave.sourceforge.net/nurbs

  • Suzuki K, Kikuchi N (1991) A homogenization method for shape and topology optimization. Comput Methods Appl Mech Eng 93(3):291–318

    Google Scholar 

  • Svanberg K (1987) The method of moving asymptotes—a new method for structural optimization. Int J Numer Methods Eng 24(2):359–373

    MathSciNet  Google Scholar 

  • Svanberg K (2002) A class of globally convergent optimization methods based on conservative convex separable approximations. SIAM J Optim 12(2):555–573

    MathSciNet  Google Scholar 

  • Thel S, Hahn D, Haupt M, Heimbs S (2022) A passive load alleviation aircraft wing: topology optimization for maximizing nonlinear bending-torsion coupling. Struct Multidisc Optim 65(5):155

    MathSciNet  Google Scholar 

  • Voet Y (2023) On the fast assemblage of finite element matrices with application to nonlinear heat transfer problems. Appl Math Comput 436:127516

    MathSciNet  Google Scholar 

  • Wang MY, Wang XM, Guo DM (2003) A level set method for structural topology optimization. Comput Methods Appl Mech Eng 192(1–2):227–324

    MathSciNet  Google Scholar 

  • Wei P, Li ZY, Li XP, Wang MY (2018) An 88-line MATLAB code for the parameterized level set method based topology optimization using radial basis functions. Struct Multidisc Optim 58(2):831–849

    MathSciNet  Google Scholar 

  • Xia L, Breitkopf P (2015) Design of materials using topology optimization and energy-based homogenization approach in MATLAB. Struct Multidisc Optim 52(6):1229–1241

    MathSciNet  Google Scholar 

  • Xie YM, Steven GP (1993) A simple evolutionary procedure for structural optimization. Comput Struct 49(5):885–896

    Google Scholar 

  • Xie YM, Steven GP (1997) Evolutionary structural optimization. Springer, London

    Google Scholar 

  • Xu J, Gao L, Xiao M, Gao J, Li H (2020) Isogeometric topology optimization for rational design of ultra-lightweight architected materials. Int J Mech Sci 166:105103

    Google Scholar 

  • Zhang ZD, Ibhadode O, Bonakdar A, Toyserkani E (2021) TopADD: a 2D/3D integrated topology optimization parallel-computing framework for arbitrary design domains. Struct Multidisc Optim 64(3):1701–1723

    MathSciNet  Google Scholar 

  • Zhou M, Rozvany GIN (1991) The COC algorithm, part II: topological, geometry and generalized shape optimization. Comput Methods Appl Mech Eng 89(1–3):309–336

    Google Scholar 

Download references

Acknowledgements

The authors are grateful to Professor K. Svanberg for the assistance on the MMA and GCMMA algorithms. The insightful comments of the reviewers are cordially appreciated.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Chungang Zhuang.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Replication of results

The source codes can be downloaded from the relative website of this paper. All the presented results are obtained by direct running of the codes.

Additional information

Responsible Editor: Shikui Chen

Publisher's Note

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

Appendices

Appendix 1

figure i

Appendix 2

figure j

Appendix 3

The meanings of some parameters mentioned in this paper are presented in Table 11, and the information on other parameters can be obtained according to the instruction of the available codes.

Table 11 Meanings of some parameters mentioned in this paper

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhuang, C., Xiong, Z. & Ding, H. An efficient 2D/3D NURBS-based topology optimization implementation using page-wise matrix operation in MATLAB. Struct Multidisc Optim 66, 254 (2023). https://doi.org/10.1007/s00158-023-03701-x

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00158-023-03701-x

Keywords

Navigation