Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Wasserstein Crossover EA for Topology Optimization (L-bracket, body-fitted HF)

A research prototype of an evolutionary topology-optimization framework whose crossover operator is the Wasserstein barycenter of two material-density distributions. The operator follows

T. Kii, K. Yaji, H. Teramoto, K. Fujita, "Wasserstein crossover for evolutionary algorithm-based topology optimization", CMAME 451 (2026) 118713,

and is demonstrated on a single example — the L-bracket stress problem — with a body-fitted-mesh high-fidelity (HF) stress model ported from

Z. Zhuang, Y. Xiong, Y. He, Y.M. Xie, "...density projection and body-fitted mesh" (DPTO), Engineering Structures 349 (2026) 121854.

Only original code is in this repo; neither paper's PDF/source is redistributed.

⚠️ Status / honesty. This is a prototype, not a 1:1 numerical reproduction of either paper. Two P0 integration bugs in the body-fitted HF (the fixed support became void; the applied load scaled with mesh spacing) were found by review and are now fixed and verified (below); a connectivity guard makes the HF robust to disconnected offspring (no more solver segfaults).

Definitive verdict — paper-scale run (N_pop=N_xo=N_lf=100, t_max=100) under the paper-faithful Eq. 17 HF pre-process, held-out-validated: the EA genuinely improves designs, and the gains generalize. With the paper's Helmholtz filter + Dirichlet-at-BCs pre-process (§4.2 of the paper, implemented after a method-fidelity review found it missing), matched-volume best-J₁ drops −12.2 % (V 0.42–0.53) and −8.9 % (V 0.53–0.57) on held-out mesh seeds, essentially identical to the training-seed values — no winner's curse. The earlier run without the Eq. 17 filter showed the same training gains but they shrank to −6 % out-of-sample (the EA was partly exploiting sub-pixel mesh artifacts that the paper's landscape does not reward); the filter also culls degenerate barely-connected extremes naturally. Earlier small runs (16–18 designs, 15 gens) were flat — a scale/diversity artifact. Low-volume bands (V<0.42) stay pinned at the re-entrant-corner singularity floor. Raw HV (+0.2 %, monotone) is a poor headline; held-out matched-volume best-J₁ is the right metric. The old "−32 %" numbers (buggy HF + fillet) stay retracted. Full write-up: project review §13–14, method-fidelity review.


Paper-scale L-bracket under the Eq. 17 pre-process, initial LF vs Wasserstein-optimized at equal volume (J₂=0.512): fewer, rounder holes and redistributed peak stress — the paper's Fig. 8 signature.


Components and their validation

Component File Validation
Wasserstein barycenter crossover (conv. Sinkhorn, Eqs. 10–13, adaptive ε) src/wasserstein.py morphing demo; deterministic unit tests (test_operator.py)
Q4 plane-stress FEM + SIMP + P-norm stress LF (adjoint) src/topopt.py adjoint vs finite differences ≈ 2e-5 (test_fem.py)
MMA optimizer src/mma.py used by the stress LF
NSGA-II selection + hypervolume + elitism (per-objective extremes kept) src/selection.py unit tests incl. elitism regression
Body-fitted-mesh HF (contour → DistMesh → CST → von Mises) src/bodyfitted.py CST patch test exact; MATLAB cross-check to ~1e-12; mesh quality
EA framework loop (Algorithm 3) src/framework.py end-to-end runs
L-bracket problem (LF + body-fitted HF) src/lbracket.py see below

What is not claimed: a paper-level framework reproduction, a contour-conforming (constrained) mesh, or a verified DPTO end-to-end match (only the element FEA is cross-checked, on identical meshes).

The L-bracket problem

A 150×150 domain with an upper-right passive void (the L), a sharp re-entrant corner at (60,60) (no fillet), the top edge of the vertical arm fixed, and a downward load on the right tip of the horizontal arm.

  • LF (seeds the population): density-method P-norm von Mises stress minimization on a structured grid with the passive void (SIMP + density filter
    • MMA), seeded over filter radius × volume fraction. The paper uses a 4 (radius) × 25 (volume) = 100-design seeding grid (Table 1; N_pop = N_xo = N_lf = 100, t_max = 100); the runner defaults to a tractable 4 × 12 = 48 and exposes --n-s1/--n-s2 for full scale. A randomized multistart (each seed starts from a smooth random density) boosts topological diversity beyond what (R,V) seeding alone gives (mean pairwise design distance +44 % in a small test); disable with --no-random-init. The LF cache is keyed by a config hash.
  • HF (drives the EA): the design is resampled onto a node grid, the 0.5 iso-contour is meshed body-fitted (DistMesh), and the true max von Mises (+ volume fraction) is evaluated on it, averaged over a few mesh seeds.

The body-fitted HF reproduces the L-bracket stress physics (concentration at the re-entrant corner):

P0 fixes (just applied) and their acceptance checks

Bug (external review) Fix Acceptance
_to_hf_field zero-filled the domain boundary → fixed support became Emin void → structure floating edge-clamp the LF→HF interpolation so material reaches the boundary fixed nodes incident to a solid triangle 0/33 → 15/34; max|U| 8.1e8 → 2.8e2
lbracket_bcs applied −F0/lload per node → total load scaled with mesh spacing (−0.5 at the EA's h=2) consistent nodal loads (tributary length) total Fy = −1.0 at every spacing (0.5/1/2/3)
disconnected offspring → singular spsolve → C-level segfault (uncatchable in Python) crashed the run at t=3 _load_path_ok connectivity guard: skip the solve (J₁=inf) unless solid joins support↔load in one component floating / split designs return inf (no crash); full run completes (exit 0)

Layout & quick start

src/  wasserstein.py  topopt.py  mma.py  selection.py  bodyfitted.py  lbracket.py  framework.py
      topo_selection.py   (optional PH-Wasserstein selection; needs the TDA env)
experiments/  test_operator.py  test_fem.py  test_bodyfitted.py  demo_morphing.py  run_lbracket.py
pip install -r requirements.txt          # numpy scipy matplotlib (jax optional)
python experiments/test_operator.py      # operator / selection / hypervolume unit tests
python experiments/test_fem.py           # FEM + adjoint sensitivity
python experiments/test_bodyfitted.py    # body-fitted HF (patch test, mesh, physics)
python experiments/run_lbracket.py       # L-bracket Wasserstein-crossover EA (sharp corner)

Honest limitations (tracked)

  • L-bracket EA improves designs at paper scale (100 designs, 100 gens): with the Eq. 17 pre-process, matched-volume best-J₁ −12.2 % / −8.9 % on held-out mesh seeds, ≈ the training values (no winner's curse). Without the filter the same training gains shrank to −6 % out-of-sample — the paper's landscape is what makes the gains generalize. Small runs (16–18 designs, 15 gens) were flat — a scale/diversity artifact, not a dead end. Low-volume bands stay at the re-entrant-corner floor. Still open: crossover ablation (Wasserstein vs linear vs none), no-random-init ablation, ε recalibration (transport still blurrier than the paper's regime), multiple EA seeds.
  • HF is a boundary-refined Delaunay with centroid solid/void classification — not a constrained contour-conforming mesh.
  • Mesh-to-mesh noise (~3–5% CV) is reduced by seed-averaging, not eliminated; results should be checked on held-out mesh seeds (winner's curse).
  • ph_wasserstein is an inspired approximation, not an exact implementation of the paper's persistent-homology selection.
  • HF objective is the true max (mesh-sensitive at the sharp corner), not DPTO's smooth p-norm; single EA seed; no crossover ablation yet.

See ADVERSARIAL_REVIEW.md and ADVERSARIAL_PROJECT_REVIEW.md for the full critique and the running list of what is / isn't supported by evidence.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages