Scalable 3D Matrix-free MultiGrid Matlab code

The Matlab code presented in this page is intended for both engineering education and for research. The code is a pure MATLAB-implemented framework for high-resolution topology optimization and porous infill optimization in 3D. The geometric multigrid method combined with an element-based matrix-free computing stencil is developed to solve the large-scale FEM linear systems (up to 128 million 1st-order hexahedral elements in a PC equipped with 64 GB RAM).

The code can be downloaded from GitHub here. A paper describing the code can be found here TBA and the reference for the Matlab code is https://doi.org/10.5281/zenodo.15399096

 

How to use it?

Interface (Details are provided at the beginning of the code as well):

TOP3D_XL(inputModel, consType, V0, nLoop, rMin, varargin);

Syntax 1:

%% Run Topology Optimization on the Cuboid Design Domain with Built-in Boundary Conditions

%% input volume: true(nely,nelx,nelz)

TOP3D_XL(true(50,100,50), 'GLOBAL', 0.12, 50, sqrt(3));

Syntax 2:

%% Run Porous Infill Optimization on the Cuboid Design Domain with Built-in Boundary Conditions

TOP3D_XL(true(50,100,50), 'LOCAL', 0.5, 300, sqrt(3), 6);

Syntax 3:

%% Run Topology Optimization on the External Design Domain Provided in *.TopVoxel

%% Download External Datasets (Femur, Molar, GEbracket): https://syncandshare.lrz.de/getlink/fiW6M69m5HoTUcH4T7wLKZ/ (until 2026.11.25)

TOP3D_XL('./data/Femur.TopVoxel', 'GLOBAL', 0.4, 50, sqrt(3));

Syntax 4:

%% Run Porous Infill Optimization on the External Design Domain Provided in *.TopVoxel

TOP3D_XL('./data/Femur.TopVoxel', 'LOCAL', 0.5, 300, sqrt(3), 6);