Efficient Large-Scale 3D Topology Optimization with Matrix-free MATLAB Code
Junpeng Wang1, Niels Aage2, Jun Wu3, Ole Sigmund2, Rüdiger Westermann1
1 Chair of Computer Graphics and Visualization, Technical University of Munich, Germany
2 Denmark University of Technology, Denmark
3 Delft University of Technology, Delft, 2628 CE, The Netherlands

Abstract
This paper presents an efficient MATLAB framework for large-scale density-based topology optimization and porous infill optimization in 3D. Besides showing comparable computational efficiency with existing MATLAB implementations at equivalent simulation scales, this framework supports significantly larger models with up to $128$ million hexahedral simulation elements on a standard PC equipped with 64 GB RAM. Furthermore, it can handle arbitrary non-cuboid simulation domains and does not require powers-of-two differences in the elements' spatial resolutions. To achieve this, the technical contribution concentrates on solving the linear system of static finite element method (FEM). A tailored element-based matrix-free computing stencil is demonstrated to circumvent the vast memory consumption in large-scale FEM. Its computational efficiency is assured by fully leveraging the efficient matrix-vector operations and indexing functionalities in MATLAB. We further improve the efficiency of the MATLAB-implemented geometric multigrid method with a non-dyadic Galerkin coarsening and a diagonal relaxation scheme. All code is made publicly available at https://github.com/PSLer/TOP3D_XL.
Associated publications
Efficient Large-Scale 3D Topology Optimization with Matrix-free MATLAB Code
Junpeng Wang, Niels Aage, Jun Wu, Ole Sigmund, Rüdiger Westermann
to appear in Structural and Multidisciplinary Optimization, 2025