Benchmarks ← back to the optimizer

Does the GPU solver get the numbers right, or does it just draw nice trusses? Every gate below runs here, in your browser: the finite-element kernel against a patch test and beam theory, the float32 GPU optimizer against a Float64 port of the 88-line MATLAB code, the classic MBB benchmark, mesh convergence, a watertight check on the exported STL, and the performance targets.

Two to six minutes on a laptop GPU. Keep the tab open.
GateMeasuredCriterionStatus

MBB beam, 60 × 20, volume fraction 0.5, p = 3, rmin = 1.5

GPU, sensitivity filter GPU, density filter CPU reference (dashed). Compliance against iteration.

What is being compared. The reference is a line-by-line Float64 port of Andreassen et al. (2011), Efficient topology optimization in MATLAB using 88 lines of code, solved with a banded Cholesky factorisation, so its displacements are exact to rounding. The GPU path solves the same equations with a matrix-free Jacobi-preconditioned conjugate gradient in float32, which is why the agreement gates have tolerances rather than demanding equality. The beam reference is the Timoshenko tip deflection with shear factor 5/6; a plane-stress finite-element cantilever with its root fully clamped is expected to come out slightly stiffer than that.

Emin. The MATLAB code uses Emin = 10⁻⁹ for void, which is fine in double precision with a direct solver. In float32 a stiffness contrast of 10⁹ exceeds the seven significant digits available, so the GPU uses Emin = 10⁻⁴. The Emin row quantifies what that changes: the Float64 reference is run with both values and the final compliance and density fields are compared. Void regions then carry a ten-thousandth of the stiffness of solid ones, which shifts the compliance by a fraction of a percent, and can nudge the optimizer onto a neighbouring local optimum with a visibly different member layout at almost the same compliance.

Mesh convergence. A point load on a two-dimensional continuum has a logarithmically infinite displacement under it, so the compliance of the textbook MBB problem grows without bound as the mesh is refined. The convergence gate therefore spreads the load and the roller support over a fixed 5% of the beam length, which makes the physical problem well posed, and scales the filter radius with the mesh so the minimum member size stays the same physical length.

What this does not test. Nothing here checks the deformed-shape animation, the stress view beyond its use in the sensitivities, or the behaviour of the inexact (capped) solves the interactive page uses at high resolution; those are shown in the optimizer as qualitatively right, not validated.