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.

variantroleJJ_binvs ref (J_bin)perimeterholesV_bin (½)iterations
density SiMPL, P0reference-1.16123-1.30727+0.00 %4.21310.301657 (converged)
density SiMPL, P1rule (5 %)-1.15837-1.29974-0.58 %4.26910.301437 (converged)
reaction–diffusion level set, Ersatz(), Δt = 0.1rule (5 %)-1.32525-1.32006+0.98 %4.19410.300571 (converged)
reaction–diffusion density, Δt = 0.1rule (5 %)-1.2853-1.33221+1.91 %4.42510.300791 (converged)
density OC, P0, move 0.1, damping 0.3informative-0.0752973-0.0688097-94.74 %4.64420.301966 (converged)
density OC, P0, move 0.05, damping 0.3informative-1.0732-1.2304-5.88 %4.48110.301070 (converged)

The six designs of the force inverter 160 × 80 read as 0/1 keeping the volume and mirrored about the axis, the reference (density SiMPL, P0) first

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):

methodmeshJJ_bin (own mesh)J_bin on 320 × 160vs 320 × 160 (on it)cells changing phaseholesiterations
density SiMPL, P080 × 40-1.13638-1.28909-1.25416-4.11 %4.68 %143 (converged)
density SiMPL, P0160 × 80-1.16123-1.30727-1.29659-0.86 %5.44 %157 (converged)
density SiMPL, P0320 × 160-1.15699-1.30785-1.30785+0.00 %0.00 %138 (converged)
reaction–diffusion level set, Ersatz(), Δt = 0.180 × 40-1.22376-1.24497-1.21932-6.12 %26.82 %088 (converged)
reaction–diffusion level set, Ersatz(), Δt = 0.1160 × 80-1.32525-1.32006-1.30777+0.69 %4.80 %171 (converged)
reaction–diffusion level set, Ersatz(), Δt = 0.1320 × 160-1.32294-1.29876-1.29876+0.00 %0.00 %1167 (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.

casevariantJJ_binrefvs refVV_bingreyperimeterholesiterationssolves state/adjoint/filter/steptime (s)time ÷ state solves (s)
inverter 160×80density SiMPL, P0 (reference)-1.16123-1.30727-1.30727+0.00 % (J_bin)0.30000.30000.1404.213157 (converged, objective_range)76/57/133/05.70.0753
inverter 160×80density SiMPL, P1-1.15837-1.29974-1.30727-0.58 % (J_bin)0.30000.30000.1444.269137 (converged, objective_range)43/37/80/03.30.077
inverter 160×80reaction–diffusion level set, Ersatz(), Δt = 0.1-1.32525-1.32006-1.30727+0.98 % (J_bin)0.30000.30000.0264.194171 (converged, all)72/71/0/715.70.0785
inverter 160×80reaction–diffusion density, Δt = 0.1-1.2853-1.33221-1.30727+1.91 % (J_bin)0.30000.30000.0654.425191 (converged, all)92/91/0/916.90.0753
inverter 160×80density OC, P0, move 0.1, damping 0.3 (informative)-0.0752973-0.0688097-1.30727-94.74 % (J_bin)0.30000.30000.1584.644266 (converged, objective_range)67/66/133/05.10.0754
inverter 160×80density OC, P0, move 0.05, damping 0.3 (informative)-1.0732-1.2304-1.30727-5.88 % (J_bin)0.30000.30000.1514.481170 (converged, objective_range)71/70/141/05.60.0791
inverter 80×40 (mesh study)density SiMPL, P0-1.13638-1.28909-1.30785-1.43 % (J_bin)0.30000.30000.1554.288143 (converged, objective_range)49/43/92/01.10.0222
inverter 160×80 (mesh study)density SiMPL, P0-1.16123-1.30727-1.30785-0.04 % (J_bin)0.30000.30000.1404.213157 (converged, objective_range)76/57/133/05.70.0753
inverter 320×160 (mesh study)density SiMPL, P0 (finest: reference)-1.15699-1.30785-1.30785+0.00 % (J_bin)0.30000.30000.1404.406138 (converged, objective_range)62/38/100/018.10.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.29990.30000.0503.563088 (converged, all)89/88/0/882.00.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.30000.30000.0264.194171 (converged, all)72/71/0/715.70.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.30000.30000.0144.3531167 (converged, all)168/167/0/16753.50.319