RasmahRasmah

Multi-Material Topology Optimization

Overview

Single-material topology optimization chooses where a single solid goes. Multi-material optimization chooses which of several solids goes where — e.g. a stiff but heavy material and a compliant but light one. Each element carries one density per material, and the modulus interpolates with SIMP

E_e = ρ₁ᵖ E₁ + ρ₂ᵖ E₂ + … + ρₙᵖ Eₙ

so the optimizer places each material where its stiffness is best used. Rasmah’s MultiMaterialTopOpt minimizes compliance subject to one volume fraction per material.

Two-material design

Pass the materials (stiffest first) and the per-material volume budgets:

using Rasmah

m = tetrahedralize_box(1.0, 1.0, 1.0, 4, 4, 4)
bs = box_boundary_sets(m, 1.0, 1.0, 1.0)
fixed = dofs(m, bs[:zmin])

materials = [
    Material(youngs_modulus = 2e3, poisson_ratio = 0.3),   # stiff
    Material(youngs_modulus = 1e3, poisson_ratio = 0.3),   # compliant
]

x, hist = solve(MultiMaterialTopOpt(), m, materials;
                fixed = fixed, loads = bs[:zmax] => [0.0, 0.0, -1.0],
                volfracs = [0.3, 0.3], max_iter = 30)

ne = size(m.elements, 2)
ρ₁, ρ₂ = x[1:ne], x[ne+1:2ne]

println("compliance ", round(hist[1]; digits = 3), " → ", round(hist[end]; digits = 3))
println("material A volume = ", round(sum(ρ₁) / ne; digits = 3))
println("material B volume = ", round(sum(ρ₂) / ne; digits = 3))

vtk(m; field = ρ₁, fieldname = "material A (stiff)", edges = true)
compliance 0.012 → 0.001
material A volume = 0.3
material B volume = 0.3

The stiff material concentrates along the load path (high strain energy) while the compliant material fills the remainder — the classic two-phase stiff/soft trade-off.

Next steps