RasmahRasmah

Moving Morphable Components (MMC) Topology Optimization

Overview

The density method discretizes the design as a per-element field. Moving Morphable Components (MMC) takes the opposite view: the design is a small set of explicit geometric bars, each described by (cx, cy, L, t, θ) — center, length, thickness and rotation. The material is the smooth union of these bars; the optimizer moves, stretches and rotates them to minimize compliance. Because the number of design variables is tiny (5 per component), MMC gives smooth, directly-interpretable results.

Components as design variables

MMCTopOpt seeds ncomp bars and optimizes their parameters. Start from a mesh of the design domain:

using Rasmah

g = LevelSetGrid(16, 16, 1.0 / 15, 1.0 / 15)
m = grid_triangle_mesh(g)
N = size(m.vertices, 2)

fixed = Int[]; loads = zeros(2N)
for i in 1:N
    x = m.vertices[:, i]
    x[1] < 1e-12 && append!(fixed, 2i - 1, 2i)
    x[1] > 1 - 1e-12 && (loads[2i] = -1.0)
end

x, hist = mmc_topopt_optimize!(m, 1e3, 0.3, fixed, loads, zeros(5 * 8);
                               ncomp = 8, volfrac = 0.4, maxiter = 20)

println("component parameters (first bar cx,cy,L,t,θ): ", round.(x[1:5]; digits = 2))

ρ = component_densities(x, m; ncomp = 8)
vtk(m; field = ρ, fieldname = "component density", edges = true)
component parameters (first bar cx,cy,L,t,θ): [0.33, -0.52, 0.05, 0.05, 1.3]

Each bar is a design variable group — the printed parameters are directly the center, length, thickness and angle of a physical member.

Next steps