Heat conduction
Steady heat conduction with the thermal compliance as objective. The conductivity outside the conductor is called kmin (a void, H0 and H3) or k0 (a second conductor, the volume-to-point problem) here, and Emin in build_heat and bench_case (the name of the bank for the void). 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.
Heat conduction with a flux on the boundary (H0 and H3)
Steady conduction on the unit square, k = kmin + (1 − kmin) ρ³ (densities) or kmin + (1 − kmin) χ (the level set), kmin = 1e-3, volume fraction 0.4, the objective the thermal compliance J = ∫ q T dΓ (self-adjoint), rmin = 0.04, τ = 2e-4, the six methods of the bank with their defaults. H0 is the thermal problem of GridapTopOpt (Wegert et al. 2024): T = 0 on x = 0 for y ≤ 0.2 and y ≥ 0.8, a flux density 1 entering on x = 1 for |y − ½| ≤ 0.1; mesh 100 × 100. H3 has one sink, T = 0 on x = 0 for |y − ½| ≤ 0.05, and a total flux 1 entering through three patches of width 0.2 at the middle of the other three sides; mesh 200 × 200. No published value of J exists (GridapTopOpt gives the setup, not J): the reference is density SiMPL, P0, on the same mesh, and in H0 also the mesh (see the mesh study). Rule: J_bin within 5 % for every row. validation/heat_flux.jl.
heat H0, 100 × 100 (H0: sink on x = 0 for y ≤ 0.2 and y ≥ 0.8, flux density 1 on x = 1 for |y − ½| ≤ 0.1)
| variant | J | J_bin | vs ref (J_bin) | perimeter | holes | V_bin (½) | iterations |
|---|---|---|---|---|---|---|---|
| density OC, P0 | 0.127918 | 0.11462 | +0.34 % | 4.54 | 0 | 0.3996 | 35 (converged) |
| density OC, P1 | 0.128177 | 0.114622 | +0.35 % | 4.54 | 0 | 0.4012 | 35 (converged) |
| density SiMPL, P0 | 0.126796 | 0.114227 | +0.00 % | 4.4 | 0 | 0.4004 | 26 (converged) |
| density SiMPL, P1 | 0.127097 | 0.114333 | +0.09 % | 4.38 | 0 | 0.4008 | 24 (converged) |
| reaction–diffusion level set, Ersatz() | 0.113232 | 0.114149 | -0.07 % | 4.78 | 0 | 0.3996 | 55 (converged) |
| reaction–diffusion density | 0.117582 | 0.113859 | -0.32 % | 4.6 | 0 | 0.4012 | 48 (converged) |
heat H3, 200 × 200 (H3: sink on x = 0 for |y − ½| ≤ 0.05, total flux 1 through three patches of width 0.2)
| variant | J | J_bin | vs ref (J_bin) | perimeter | holes | V_bin (½) | iterations |
|---|---|---|---|---|---|---|---|
| density OC, P0 | 1.97315 | 1.80107 | +0.50 % | 4.39 | 0 | 0.3999 | 37 (converged) |
| density OC, P1 | 1.97455 | 1.80103 | +0.49 % | 4.39 | 0 | 0.4012 | 36 (converged) |
| density SiMPL, P0 | 1.96711 | 1.79219 | +0.00 % | 4.47 | 0 | 0.4006 | 28 (converged) |
| density SiMPL, P1 | 1.96723 | 1.79284 | +0.04 % | 4.49 | 0 | 0.4007 | 29 (converged) |
| reaction–diffusion level set, Ersatz() | 1.79026 | 1.82373 | +1.76 % | 4.46 | 0 | 0.4000 | 51 (converged) |
| reaction–diffusion density | 1.84323 | 1.79178 | -0.02 % | 4.47 | 0 | 0.3989 | 34 (converged) |
In H0 the six methods are within 0.7 % without changing any option, and every one stops with its default stop: one concentrated heat input, two thick arms, no fine scale. H3 is a trident whose three arms share the material: the density methods and the reaction–diffusion density are within 0.5 %, and the level set is 1.8 % above with its own J (1.790, with Ersatz()) below every other J_bin. The difference is the reading of its cut cells: the whole heat goes through the sink, a neck of width 0.1, and with the contrast 1e3 half a cut cell of conductor more or less there changes J by a few percent. In the probes that chose the setup (on the Validation page) the gap closed with the mesh and with the contrast, not with τ. Spreading the flux over a whole side or over many small patches brought back the fine scale of a uniform source: those setups need a study of the minimum length scale and are not in the bank; a uniform source with a contrast that the mesh resolves is the volume-to-point case below.
The fixed report table:
Apple M5 Max, 4 threads, Julia 1.13.0 · commit 3b98442 · 2026-11-30 17:25.
| 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) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| heat H0 100×100 | density OC, P0 | 0.127918 | 0.11462 | 0.114227 | +0.34 % (J_bin) | 0.4000 | 0.4000 | 0.131 | 4.54 | 0 | 35 (converged, objective_range) | 36/0/71/0 | 1.0 | 0.0283 |
| heat H0 100×100 | density OC, P1 | 0.128177 | 0.114622 | 0.114227 | +0.35 % (J_bin) | 0.4000 | 0.4000 | 0.133 | 4.54 | 0 | 35 (converged, objective_range) | 36/0/71/0 | 0.9 | 0.0253 |
| heat H0 100×100 | density SiMPL, P0 (reference) | 0.126796 | 0.114227 | 0.114227 | +0.00 % (J_bin) | 0.4000 | 0.4000 | 0.127 | 4.4 | 0 | 26 (converged, objective_range) | 30/0/56/0 | 0.7 | 0.0234 |
| heat H0 100×100 | density SiMPL, P1 | 0.127097 | 0.114333 | 0.114227 | +0.09 % (J_bin) | 0.4000 | 0.4000 | 0.130 | 4.38 | 0 | 24 (converged, objective_range) | 43/0/67/0 | 0.9 | 0.0218 |
| heat H0 100×100 | reaction–diffusion level set, Ersatz() | 0.113232 | 0.114149 | 0.114227 | -0.07 % (J_bin) | 0.4000 | 0.4000 | 0.026 | 4.78 | 0 | 55 (converged, all) | 56/0/0/55 | 1.6 | 0.028 |
| heat H0 100×100 | reaction–diffusion density | 0.117582 | 0.113859 | 0.114227 | -0.32 % (J_bin) | 0.4001 | 0.4000 | 0.055 | 4.6 | 0 | 48 (converged, all) | 49/0/0/48 | 1.2 | 0.0236 |
| heat H3 200×200 | density OC, P0 | 1.97315 | 1.80107 | 1.79219 | +0.50 % (J_bin) | 0.4000 | 0.4000 | 0.123 | 4.39 | 0 | 37 (converged, objective_range) | 38/0/75/0 | 2.8 | 0.0734 |
| heat H3 200×200 | density OC, P1 | 1.97455 | 1.80103 | 1.79219 | +0.49 % (J_bin) | 0.4000 | 0.4000 | 0.124 | 4.39 | 0 | 36 (converged, objective_range) | 37/0/73/0 | 3.0 | 0.0815 |
| heat H3 200×200 | density SiMPL, P0 (reference) | 1.96711 | 1.79219 | 1.79219 | +0.00 % (J_bin) | 0.4000 | 0.4000 | 0.126 | 4.47 | 0 | 28 (converged, objective_range) | 30/0/58/0 | 2.4 | 0.0813 |
| heat H3 200×200 | density SiMPL, P1 | 1.96723 | 1.79284 | 1.79219 | +0.04 % (J_bin) | 0.4000 | 0.4000 | 0.126 | 4.49 | 0 | 29 (converged, objective_range) | 32/0/61/0 | 2.3 | 0.0721 |
| heat H3 200×200 | reaction–diffusion level set, Ersatz() | 1.79026 | 1.82373 | 1.79219 | +1.76 % (J_bin) | 0.4001 | 0.4000 | 0.011 | 4.46 | 0 | 51 (converged, all) | 52/0/0/51 | 4.1 | 0.0792 |
| heat H3 200×200 | reaction–diffusion density | 1.84323 | 1.79178 | 1.79219 | -0.02 % (J_bin) | 0.3999 | 0.4000 | 0.045 | 4.47 | 0 | 34 (converged, all) | 35/0/0/34 | 2.5 | 0.0718 |
Volume-to-point heat conduction (Bejan 1997)
The classical tree: the unit square generates heat uniformly (q = 1, total 1) and is insulated except for a short sink, T = 0 on y = 0 for |x − ½| ≤ 0.05; a fraction 0.2 of a good conductor (k = 1) is laid out in a poor one (k0 = 1e-2, a second material: contrast 100) to minimise J = ∫ q T dΩ, which is the mean temperature; SIMP p = 3, rmin = 0.02 (2 cells), τ = 2e-4, mesh 100 × 100. The problem goes back to Bejan (1997); the topology optimisation version is the heat code of the book of Bendsøe and Sigmund (2003), which is not distributed with the open codes (top88 and top3d refer to the book for it) and uses a sensitivity filter that HyperShape does not have: no published J is reproduced. Contrast 100 and volume 0.2 give a tree of about ten branches that the mesh resolves (with a contrast of 1e3 the branches were thinner than the mesh: Validation page). Three references:
- a reference driver in Octave written for the bank (
validation/data/vtp: its CSV files and a description of the algorithm detailed enough to write it again; the driver is not in the repository): Q1 elements, one density per cell, the cell mean of the Helmholtz-filtered density as in top88, OC with move 0.2, stop at max|Δx| ≤ 0.01. The row "P0, cell mean, OC as top88" is HyperShape with that formulation (CellMean(dΩ) ∘ HelmholtzFilter,OC(adapt = nothing),StopCriteria(change_tol = 0.01)): rule J within 1 % (another code, the same discretisation and formulation). It is a second implementation of the same algorithm, not a published value; - between methods, density SiMPL, P0:
J_binwithin 5 % for density SiMPL P1 and the reaction–diffusion density (Δt = 0.1: with the default step neither reaction–diffusion row stops, as in the inverter); - the mesh (informative).
Density OC and the reaction–diffusion level set are informative rows, and so is density SiMPL P0 with a tanh projection (β from 1 to 16, doubling every 40 iterations). validation/heat_vtp.jl.
| variant | role | J | J_bin | vs ref | perimeter | holes | grey | iterations |
|---|---|---|---|---|---|---|---|---|
| reference driver in Octave | reference of the implementation | 3.26042 | 3.10695 | – | 7.46 | 0 | 0.121 | 490 |
| P0, cell mean, OC as top88 | rule (1 % on J) | 3.26042 | 3.10693 | -0.00 % (J) | 7.5 | 0 | 0.121 | 491 (converged) |
| density OC, P0 | informative | 3.47243 | 3.39223 | +40.55 % (J_bin) | 7.1 | 0 | 0.116 | 119 (converged) |
| density OC, P1 | informative | 3.34269 | 3.26747 | +35.38 % (J_bin) | 6.98 | 0 | 0.120 | 226 (converged) |
| density SiMPL, P0 | reference between methods | 2.70264 | 2.41349 | +0.00 % (J_bin) | 9.46 | 0 | 0.148 | 72 (converged) |
| density SiMPL, P1 | rule (5 %) | 2.66183 | 2.40572 | -0.32 % (J_bin) | 8.5 | 0 | 0.145 | 80 (converged) |
| reaction–diffusion level set, Ersatz(), Δt = 0.1 | informative | 2.54728 | 2.76084 | +14.39 % (J_bin) | 6.52 | 0 | 0.039 | 75 (converged) |
| reaction–diffusion density, Δt = 0.1 | rule (5 %) | 2.43797 | 2.32543 | -3.65 % (J_bin) | 8.6 | 0 | 0.103 | 112 (converged) |
| density SiMPL, P0, TanhProjection β = 1 → 16 every 40 iterations | informative | 2.16119 | 2.19147 | -9.20 % (J_bin) | 10.88 | 0 | 0.063 | 175 (converged) |
The formulation of the driver is reproduced: J −0.0002 % after 491 iterations against 490 (the history of HyperShape is shifted by one, as with top88), 0.04 % of the cells in a different phase (both printed by the script); the design of the driver evaluated here gives the J that the driver printed to 1e-9 (checked by the script; 6e-12). The problem has many local minima, and the methods land in different trees. OC, in HyperShape and in the driver alike, ends in a tree confined to the lower half of the square (+35 % to +41 % in J_bin); density SiMPL finds a better one (22 % better than the OC of the reference formulation in J_bin, a fact checked by the script); the reaction–diffusion density finds a slightly better one still (−3.7 %), and the projection the sharpest (−9.2 %). The level set, started from solid, only removes material: it grows needles without side branches (+14 % on 100 × 100; on 200 × 200 it does not stop: Validation page) and its needles lose at the 0/1 reading (its own J, 2.547, is below the J_bin of SiMPL). That trees are not the optimum of this problem is the point of Yan, Wang and Sigmund (2018, On the non-optimality of tree structures for heat conduction, Int. J. Heat Mass Transf. 122:660–680); here the rule between methods is kept for the rows that reach the same tree, and the spread of the others is the result. Mesh study (density SiMPL P0, every design read as 0/1 keeping the volume and evaluated on 400 × 400; informative):
| method | mesh | J | J_bin (own mesh) | J_bin on 400 × 400 | vs 400 × 400 (on it) | cells changing phase | perimeter | iterations |
|---|---|---|---|---|---|---|---|---|
| density SiMPL, P0 | 100 × 100 | 2.70264 | 2.41349 | 2.45431 | +12.45 % | 7.86 % | 9.46 | 72 (converged) |
| density SiMPL, P0 | 200 × 200 | 2.55473 | 2.21699 | 2.2321 | +2.27 % | 3.86 % | 10.32 | 90 (converged) |
| density SiMPL, P0 | 400 × 400 | 2.5464 | 2.18248 | 2.18248 | +0.00 % | 0.00 % | 10.73 | 88 (converged) |
The tree gains branches as the mesh resolves them (on 100 × 100 rmin is two cells): J_bin on 400 × 400 drops by 12 % from the design of 100 × 100 and by 2.3 % from that of 200 × 200, so the 1 % rule of the mesh study does not hold and is not required.
The fixed report table (the first row is the driver; the rows of the mesh study are compared with the design on 400 × 400 on its own mesh):
Apple M5 Max, 4 threads, Julia 1.13.0 · commit 3b98442 · 2026-11-30 17:29.
| 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) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| volume-to-point 100×100 | reference driver in Octave 9.1 (data/vtp): P0, cell mean, OC move 0.2, change ≤ 0.01 | 3.26042 | 3.10695 | – | – | 0.2000 | 0.2000 | 0.121 | 7.46 | 0 | 490 | – | – | – |
| volume-to-point 100×100 | P0, cell mean, OC as top88 (against the driver: J, 1 %) | 3.26042 | 3.10693 | 3.26042 | -0.00 % (J) | 0.2000 | 0.2000 | 0.121 | 7.5 | 0 | 491 (converged, change_tol) | 492/0/983/0 | 12.2 | 0.0249 |
| volume-to-point 100×100 | density OC, P0 (informative) | 3.47243 | 3.39223 | 2.41349 | +40.55 % (J_bin) | 0.2000 | 0.2000 | 0.116 | 7.1 | 0 | 119 (converged, objective_range) | 120/0/239/0 | 2.9 | 0.0245 |
| volume-to-point 100×100 | density OC, P1 (informative) | 3.34269 | 3.26747 | 2.41349 | +35.38 % (J_bin) | 0.2000 | 0.2000 | 0.120 | 6.98 | 0 | 226 (converged, objective_range) | 227/0/453/0 | 5.7 | 0.0251 |
| volume-to-point 100×100 | density SiMPL, P0 (reference between methods) | 2.70264 | 2.41349 | 2.41349 | +0.00 % (J_bin) | 0.2000 | 0.2000 | 0.148 | 9.46 | 0 | 72 (converged, objective_range) | 78/0/150/0 | 1.8 | 0.0229 |
| volume-to-point 100×100 | density SiMPL, P1 | 2.66183 | 2.40572 | 2.41349 | -0.32 % (J_bin) | 0.2000 | 0.2000 | 0.145 | 8.5 | 0 | 80 (converged, objective_range) | 89/0/169/0 | 2.1 | 0.0232 |
| volume-to-point 100×100 | reaction–diffusion level set, Ersatz(), Δt = 0.1 (informative) | 2.54728 | 2.76084 | 2.41349 | +14.39 % (J_bin) | 0.2000 | 0.2000 | 0.039 | 6.52 | 0 | 75 (converged, all) | 76/0/0/75 | 2.1 | 0.0272 |
| volume-to-point 100×100 | reaction–diffusion density, Δt = 0.1 | 2.43797 | 2.32543 | 2.41349 | -3.65 % (J_bin) | 0.2001 | 0.2000 | 0.103 | 8.6 | 0 | 112 (converged, all) | 113/0/0/112 | 2.5 | 0.0223 |
| volume-to-point 100×100 | density SiMPL, P0, TanhProjection β = 1 → 16 every 40 iterations (informative) | 2.16119 | 2.19147 | 2.41349 | -9.20 % (J_bin) | 0.2000 | 0.2000 | 0.063 | 10.88 | 0 | 175 (converged, objective_range) | 199/0/850/0 | 6.5 | 0.0329 |
| volume-to-point 100×100 (mesh study) | density SiMPL, P0 | 2.70264 | 2.41349 | 2.18248 | +10.58 % (J_bin) | 0.2000 | 0.2000 | 0.148 | 9.46 | 0 | 72 (converged, objective_range) | 78/0/150/0 | 1.8 | 0.0229 |
| volume-to-point 200×200 (mesh study) | density SiMPL, P0 | 2.55473 | 2.21699 | 2.18248 | +1.58 % (J_bin) | 0.2000 | 0.2000 | 0.142 | 10.32 | 0 | 90 (converged, objective_range) | 98/0/188/0 | 7.5 | 0.0764 |
| volume-to-point 400×400 (mesh study) | density SiMPL, P0 (finest: reference) | 2.5464 | 2.18248 | 2.18248 | +0.00 % (J_bin) | 0.2000 | 0.2000 | 0.143 | 10.73 | 0 | 88 (converged, objective_range) | 94/0/182/0 | 32.0 | 0.34 |