How darkfanxing/matlab-topology-optimization works
Project type and purpose
• This is a MATLAB-based topology optimization tool (88 lines of code) that implements structural optimization using methods like MMA (Method of Moving Asymptotes) and Optimality Criteria.
• Its purpose is to read a design scenario (sample geometry/load case), run an iterative optimization loop (compute stiffness, sensitivities, apply filters, update densities), and output a final topology.
File structure
• Top-level:
• src/ – all MATLAB code
• src/assets/samples/ – predefined geometry/load cases (.m files returning mesh, loads, BCs)
• src/main.m – entry point, parameter definitions, scenario selection, control loop
• src/topology_optimization.m – core loop implementation
• Subdirectories:
• src/update_methods/mma/ – MMA update functions (init, solver, parameter setup)
• src/utils/ – helper functions (design-variable filters, projection, stiffness matrix, sensitivities)
• No server/client or UI—this is a standalone computational pipeline invoked by main.m.
README for additional insights
• main.m drives the run (user sets parameters, chooses sample).
• Users can swap in new samples, change MMA parameters, filters, projection, or stiffness routines.
• References point to the underlying algorithms (MMA paper, 88-line MATLAB implementation).