Optimization and Engineering

, Volume 20, Issue 1, pp 1–35 | Cite as

A C# code for solving 3D topology optimization problems using SAP2000

  • Nikos D. LagarosEmail author
  • Nikos Vasileiou
  • Georgios Kazakis
Educational Article


SAP2000 is well-known commercial software for analysis and design of structural systems that is equipped with an open application programming interface (OAPI). In this work, a code written in C# able to solve three-dimensional topology optimization problems is presented, where a topology optimization framework was integrated into SAP2000 taking advantage of its OAPI feature. The code is partially based on the 99 and 88 line codes written by Sigmund (Struct Multidiscip Optim 21(2):120–127, 2001) and Andreassen et al. (Struct Multidiscip Optim 43(1):1–16, 2011). The code solves the problem of minimum compliance while through OAPI it takes advantage of all modelling capabilities of SAP2000. The paper covers the theoretical aspects of topology optimization incorporated in the code and provides detailed description of their numerical implementations. Special effort was made to the latter one, describing in detail all numerical aspects of the code, in order to facilitate the reader to understand the code, and therefore being able to further enhance its capabilities. The complete code can be downloaded from GitHub (


Topology optimization SAP2000 OAPI C# code Optimality criteria Method of moving asymptotes Conceptual design 



This research has been supported by the OptArch project: “Optimization Driven Architectural Design of Structures” (No: 689983) belonging to the Marie Skłodowska-Curie Actions (MSCA) Research and Innovation Staff Exchange (RISE) H2020-MSCA-RISE-2015.


  1. Allaire G (2002) Shape optimization by the homogenization method, applied mathematical sciences, vol 146. Springer, New YorkCrossRefzbMATHGoogle Scholar
  2. Allaire G (2017) Codes: Accessed Nov 2017
  3. Allaire G, Jouve F, Toader AM (2004) Structural optimization using sensitivity analysis and a level-set method. J Comput Phys 194(1):363–393MathSciNetCrossRefzbMATHGoogle Scholar
  4. 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–16CrossRefzbMATHGoogle Scholar
  5. ANSYS Topology Optimization (2017) Accessed Nov 2017
  6. Beghini LL, Beghini A, Katz N, Baker WF, Paulino GH (2014) Connecting architecture and engineering through structural topology optimization. Eng Struct 59:716–726CrossRefGoogle Scholar
  7. Bendsøe MP, Sigmund O (1999) Material interpolations in topology optimization. Arch Appl Mech 69:635–654CrossRefzbMATHGoogle Scholar
  8. Bendsøe MP, Sigmund O (2003) Topology optimization-theory, methods and applications. Springer, BerlinzbMATHGoogle Scholar
  9. Gallagher RH, Zienkiewicz OC (1973) Optimum structural design: theory and applications. Wiley, New YorkzbMATHGoogle Scholar
  10. Haug EJ, Arora JS (1974) Optimal mechanical design techniques based on optimal control methods, ASME paper No 64-DTT-10. In: Proceedings of the 1st ASME design technology transfer conference, New York, pp 65–74Google Scholar
  11. Liu K, Tovar A (2014) An efficient 3D topology optimization code written in Matlab. Struct Multidiscip Optim 50(6):1175–1196MathSciNetCrossRefGoogle Scholar
  12. Moses F (1974) Mathematical programming methods for structural optimization. ASME Struct Optim Symp AMD 7:35–48Google Scholar
  13. OptiStruct (2017) Accessed Nov 2017
  14. Sheu CY, Prager W (1968) Recent development in optimal structural design. Appl Mech Rev 21(10):985–992Google Scholar
  15. Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidiscip Optim 21(2):120–127MathSciNetCrossRefGoogle Scholar
  16. Spunt L (1971) Optimum structural design. Prentice-Hall, Englewood CliffsGoogle Scholar
  17. Stromberg LL, Beghini A, Baker WF, Paulino GH (2012) Topology optimization for braced frames: combining continuum and beam/column elements. Eng Struct 37:106–124CrossRefGoogle Scholar
  18. Svanberg K (1987) The method of moving asymptotes-a new method for structural optimization. Int J Numer Methods Eng 24(2):359–373MathSciNetCrossRefzbMATHGoogle Scholar
  19. 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–357MathSciNetCrossRefzbMATHGoogle Scholar
  20. Wilson EL, Habibullah A (2017) SAP 2000 software, version 19. Computer and Structures, Inc. (CSI), BerkeleyGoogle Scholar
  21. Zuo ZH, Xie YM (2015) A simple and compact Python code for complex 3D topology optimization. Adv Eng Softw 85:1–11CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  • Nikos D. Lagaros
    • 1
    Email author
  • Nikos Vasileiou
    • 1
  • Georgios Kazakis
    • 1
  1. 1.Department of Structural Engineering, Institute of Structural Analysis and Antiseismic Research, School of Civil EngineeringNational Technical University of AthensAthensGreece

Personalised recommendations