A Matlab code for analysis and topology optimization with Third Medium Contact
Andreas Henrik Frederiksen, Ole Sigmund, Federico Ferrari
TL;DR
The paper introduces an open-source Matlab implementation of the Third Medium Contact (TMC) model for density-based topology optimization of hyperelastic structures. It combines TMC with HuHu-regularization to stabilize void-element distortions, enabling differentiable, fully implicit contact within optimization loops. The framework employs a PDE-based density filter, Heaviside projection (with beta continuation), and RAMP interpolation to drive end-compliance minimization under volume constraints, demonstrated on C-shape and TO scenarios. The contribution is an accessible, educational codebase that reproduces results and serves as a platform for extending TMC TO to more complex problems and higher dimensions.
Abstract
We present a Matlab code for modelling and topology optimization of hyperelastic structures, including contact modelled by the Third Medium Contact (TMC) approach. By using the so-called HuHu-regularization we penalize the skew distortion of the bilinear finite elements discretizing void regions, thus promoting convergence of the nonlinear solver. First, we show how this method is implemented in a compact code, allowing to simulate contact and force transfer in hyperelastic structures. Then, we solve a topology optimization problem for minimum end-compliance of a structure exhibiting contact. The Matlab scripts that replicate the results are included, and we discuss some possible extensions to more general problems.
