Compliant mechanisms
The rows of the fixed table are described on the Benchmarks page, with the rule for comparing methods (LUSolver, backend :compiled; "–" marks what a row does not have). The SVG figures are written to the results folder by each script; the ones shown here are copies in docs/src/assets/benchmarks.
Force inverter: one problem, every method
A compliant mechanism: the objective is not the compliance and its adjoint is not the state. The upper half (0, 1) × (0, ½) of the unit square with symmetry on y = 0, plane stress, E = 1, ν = 0.3, Emin = 1e-3, clamped on x = 0 for y ≥ 0.45; a total input force 1 along +x spread over the input port (x = 0, y ≤ 0.05) and springs of total stiffness kin = kout = 0.1 spread over the input port and the output port (x = 1, y ≤ 0.05), the stiffness of top3d (Liu and Tovar 2014, §6.2); volume fraction 0.3; the objective is the mean displacement of the output port along +x, minimised (negative: the mechanism inverts the motion; J_bin is the same functional evaluated on the 0/1 design); rmin = 0.025, τ = 2e-4 (κ = 1e-4); mesh 160 × 80 (ports of 8 cells). In the user's script the springs are two boundary terms of the bilinear form, and the objective needs AdjointProblem(SymmetricState(); …) and dJdu = LinearInState(). No published value can be reproduced (the one of SiMPL, −0.4598 on 512 × 512, depends on settings that the paper does not give): the reference is density SiMPL, P0, on the same mesh. Two settings of the methods are written in the script, as a user writes them: Δt = 0.1 for reaction–diffusion (with the default step the density ends in a limit cycle and never meets its stop, and so does the level set on 320 × 160: probes that chose the setup, on the Validation page), and two informative rows of OC: with the step of the mechanism codes (move = 0.1, damping = 0.3) and with move = 0.05. Rule: J_bin within 5 % of the reference for SiMPL P1 and the two reaction–diffusion rows; OC is informative. validation/inverter.jl.
| variant | role | J | J_bin | vs ref (J_bin) | perimeter | holes | V_bin (½) | iterations |
|---|---|---|---|---|---|---|---|---|
| density SiMPL, P0 | reference | -1.16123 | -1.30727 | +0.00 % | 4.213 | 1 | 0.3016 | 57 (converged) |
| density SiMPL, P1 | rule (5 %) | -1.15837 | -1.29974 | -0.58 % | 4.269 | 1 | 0.3014 | 37 (converged) |
| reaction–diffusion level set, Ersatz(), Δt = 0.1 | rule (5 %) | -1.32525 | -1.32006 | +0.98 % | 4.194 | 1 | 0.3005 | 71 (converged) |
| reaction–diffusion density, Δt = 0.1 | rule (5 %) | -1.2853 | -1.33221 | +1.91 % | 4.425 | 1 | 0.3007 | 91 (converged) |
| density OC, P0, move 0.1, damping 0.3 | informative | -0.0752973 | -0.0688097 | -94.74 % | 4.644 | 2 | 0.3019 | 66 (converged) |
| density OC, P0, move 0.05, damping 0.3 | informative | -1.0732 | -1.2304 | -5.88 % | 4.481 | 1 | 0.3010 | 70 (converged) |
The four methods with the rule give the same topology (one hole, the classical inverter) within 2.5 % (J_bin from −0.58 % to +1.91 % of the reference). OC with the step of the mechanism codes does not invert (J_bin −0.069, −95 %): its design has no material at the input port, so the load acts on void and spring. With SIMP a region that OC empties in its first steps does not come back (the derivative vanishes at ρ = 0, and the density filter does not restore it). Halving the step, OC(adapt = nothing, move = 0.05, damping = 0.3), gives the same topology 5.9 % behind the reference. The failure is checked by the script (J_bin above −0.2). The radius rmin = 0.025 and the springs 0.1 / 0.1 are those of this problem: why (grey hinges with a larger radius; with an output nearly free the hinges decide J) is on the Validation page, from the probes that chose the setup. The mesh study is informative (no rule; the hinges sharpen with the mesh):
| method | mesh | J | J_bin (own mesh) | J_bin on 320 × 160 | vs 320 × 160 (on it) | cells changing phase | holes | iterations |
|---|---|---|---|---|---|---|---|---|
| density SiMPL, P0 | 80 × 40 | -1.13638 | -1.28909 | -1.25416 | -4.11 % | 4.68 % | 1 | 43 (converged) |
| density SiMPL, P0 | 160 × 80 | -1.16123 | -1.30727 | -1.29659 | -0.86 % | 5.44 % | 1 | 57 (converged) |
| density SiMPL, P0 | 320 × 160 | -1.15699 | -1.30785 | -1.30785 | +0.00 % | 0.00 % | 1 | 38 (converged) |
| reaction–diffusion level set, Ersatz(), Δt = 0.1 | 80 × 40 | -1.22376 | -1.24497 | -1.21932 | -6.12 % | 26.82 % | 0 | 88 (converged) |
| reaction–diffusion level set, Ersatz(), Δt = 0.1 | 160 × 80 | -1.32525 | -1.32006 | -1.30777 | +0.69 % | 4.80 % | 1 | 71 (converged) |
| reaction–diffusion level set, Ersatz(), Δt = 0.1 | 320 × 160 | -1.32294 | -1.29876 | -1.29876 | +0.00 % | 0.00 % | 1 | 167 (converged) |
On 80 × 40 the level set ends without the hole (27 % of the cells differ from its design on 320 × 160); density SiMPL keeps the topology on the three meshes and its design on 160 × 80 is within 0.9 % of the one on 320 × 160 on that mesh. Between methods the rule of 5 % holds on the three meshes.
The fixed report table (J_bin, V_bin, perimeter and holes of the design read keeping the volume; the rows of the mesh study are compared with the design on 320 × 160 on its own mesh):
Apple M5 Max, 4 threads, Julia 1.13.0 · commit 3b98442 · 2026-11-30 17:22.
| case | variant | J | J_bin | ref | vs ref | V | V_bin | grey | perimeter | holes | iterations | solves state/adjoint/filter/step | time (s) | time ÷ state solves (s) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| inverter 160×80 | density SiMPL, P0 (reference) | -1.16123 | -1.30727 | -1.30727 | +0.00 % (J_bin) | 0.3000 | 0.3000 | 0.140 | 4.213 | 1 | 57 (converged, objective_range) | 76/57/133/0 | 5.7 | 0.0753 |
| inverter 160×80 | density SiMPL, P1 | -1.15837 | -1.29974 | -1.30727 | -0.58 % (J_bin) | 0.3000 | 0.3000 | 0.144 | 4.269 | 1 | 37 (converged, objective_range) | 43/37/80/0 | 3.3 | 0.077 |
| inverter 160×80 | reaction–diffusion level set, Ersatz(), Δt = 0.1 | -1.32525 | -1.32006 | -1.30727 | +0.98 % (J_bin) | 0.3000 | 0.3000 | 0.026 | 4.194 | 1 | 71 (converged, all) | 72/71/0/71 | 5.7 | 0.0785 |
| inverter 160×80 | reaction–diffusion density, Δt = 0.1 | -1.2853 | -1.33221 | -1.30727 | +1.91 % (J_bin) | 0.3000 | 0.3000 | 0.065 | 4.425 | 1 | 91 (converged, all) | 92/91/0/91 | 6.9 | 0.0753 |
| inverter 160×80 | density OC, P0, move 0.1, damping 0.3 (informative) | -0.0752973 | -0.0688097 | -1.30727 | -94.74 % (J_bin) | 0.3000 | 0.3000 | 0.158 | 4.644 | 2 | 66 (converged, objective_range) | 67/66/133/0 | 5.1 | 0.0754 |
| inverter 160×80 | density OC, P0, move 0.05, damping 0.3 (informative) | -1.0732 | -1.2304 | -1.30727 | -5.88 % (J_bin) | 0.3000 | 0.3000 | 0.151 | 4.481 | 1 | 70 (converged, objective_range) | 71/70/141/0 | 5.6 | 0.0791 |
| inverter 80×40 (mesh study) | density SiMPL, P0 | -1.13638 | -1.28909 | -1.30785 | -1.43 % (J_bin) | 0.3000 | 0.3000 | 0.155 | 4.288 | 1 | 43 (converged, objective_range) | 49/43/92/0 | 1.1 | 0.0222 |
| inverter 160×80 (mesh study) | density SiMPL, P0 | -1.16123 | -1.30727 | -1.30785 | -0.04 % (J_bin) | 0.3000 | 0.3000 | 0.140 | 4.213 | 1 | 57 (converged, objective_range) | 76/57/133/0 | 5.7 | 0.0753 |
| inverter 320×160 (mesh study) | density SiMPL, P0 (finest: reference) | -1.15699 | -1.30785 | -1.30785 | +0.00 % (J_bin) | 0.3000 | 0.3000 | 0.140 | 4.406 | 1 | 38 (converged, objective_range) | 62/38/100/0 | 18.1 | 0.292 |
| inverter 80×40 (mesh study) | reaction–diffusion level set, Ersatz(), Δt = 0.1 | -1.22376 | -1.24497 | -1.29876 | -4.14 % (J_bin) | 0.2999 | 0.3000 | 0.050 | 3.563 | 0 | 88 (converged, all) | 89/88/0/88 | 2.0 | 0.0222 |
| inverter 160×80 (mesh study) | reaction–diffusion level set, Ersatz(), Δt = 0.1 | -1.32525 | -1.32006 | -1.29876 | +1.64 % (J_bin) | 0.3000 | 0.3000 | 0.026 | 4.194 | 1 | 71 (converged, all) | 72/71/0/71 | 5.7 | 0.0785 |
| inverter 320×160 (mesh study) | reaction–diffusion level set, Ersatz(), Δt = 0.1 (finest: reference) | -1.32294 | -1.29876 | -1.29876 | +0.00 % (J_bin) | 0.3000 | 0.3000 | 0.014 | 4.353 | 1 | 167 (converged, all) | 168/167/0/167 | 53.5 | 0.319 |