Skip to content

benchmark: S4-B hierarchy cases and h-multigrid configurations - #51

Merged
jmartfrut merged 3 commits into
mainfrom
s4b-bench
Nov 9, 2026
Merged

jmartfrut merged 3 commits into
mainfrom
s4b-bench

Conversation

@jmartfrut

Copy link
Copy Markdown
Member

Benchmark-only changes for S4-B (HyperFEM's HMultigridSolver, branch s4b-hmultigrid): the cases that build a
MeshHierarchy and the solver configurations measured against CG + GAMG. No change in src/.

Branch s4b-bench on main, 3 commits (0103492, 8f1a559, 0b2b3e3). Measurements in design/solvers-s4b-status.md.

What changes

  • benchmark/solvers/cases.jl:
    • hcube_hex N K [λ]: N³ Cartesian hexahedra of the unit cube refined K times.
    • hcube_tet H K [λ]: Gmsh tetrahedra of the unit cube with mesh size H, physical groups fixedup (x = 0) and topsuf
      (x = 1) tagged with their closure (edges and vertices), refined K times. The hierarchy requires the same closed
      Dirichlet boundary on every level.
    • mech_case takes the λ of the neo-Hookean law (λ = 10, ν = 0.45, is the default of mech_cube; 1.5 gives ν = 0.3).
      The mechanics are those of mech_cube: clamped at x = 0, sheared 0.1 at x = 1, 5 load steps, order 1.
    • hem_plate_c n k: the EM plate 8 × 0.8 × 40 as (7n, 2n, 19n) Cartesian hexahedra refined k times, clamped at z = 0,
      electrodes on y = 0 (φ = 0) and y = 0.8 (φ = 0.2, the field of em_plate_c) with u_y = 0 on both (closed tags inherited
      by every level); carries the hierarchy and the test-space builders of the two fields.
  • benchmark/solvers/krylov.jl: configurations hmg_<krylov>[_lagN][_degK][_rngA][_lu|_mumps] — HMultigridSolver with CG or
    GMRES, reuse = N, Chebyshev degree K, range A, coarsest level by LU, MUMPS or (default) one GAMG V-cycle with the rigid
    modes of the coarse space (PETScSolver(:preonly, :gamg; nullspace = near_nullspace(coarse trial space))).
    • fshmg_<split>[_lagN][_lu] (S4-B step 5): HyperFEM's FieldSplitSolver with one h-multigrid V-cycle per block (coarse GAMG per block,
      or LU), against S2's fs_additive on the same fine mesh.
  • benchmark/solvers/run_s4b.sh: modes tet, hex (ν = 0.45), tetl, hexl (ν = 0.3) and em (hem_plate_c).

Results (our measurement: Mac M5 Max, 6 Julia threads, PETSc serial, Krylov rtol 1e-10, Newton rtol 1e-8; HyperFEM ab24cd8)

Seconds per Newton iteration (CG iterations per Newton iteration), ν = 0.45, same Newton trajectory in every run:

case dofs cg_gamg hmg_cg_lag3 gain
hcube_hex 4 4 (5 levels) 799k 8.83 (29.8) 1.75 (16.8) ×5.0
hcube_tet 0.15 3 (4 levels) 414k 5.70 (52.8) 2.67 (32.2) ×2.1
hcube_tet 0.12 3 (4 levels) 893k 15.97 (84.7) 2.80 (31.9) ×5.7

EM plate (u, φ), GMRES: hem_plate_c 1 3 (555k) fs_additive 10.14 (97.5), fshmg_additive_lag3 4.09 (55.8),
fshmg_schur_lag3 3.33 (49.9): ×2.5–3.0; hem_plate_c 1 2 (71k) 0.84 vs 0.71: ×1.2.

Requires HyperFEM with HMultigridSolver (branch s4b-hmultigrid; the benchmark environment develops ../HyperFEM.jl).

… unit cube with closed tags, refined K times) and hcube_hex N K, configurations hmg_<krylov>[_lagN][_degK][_rngA][_lu|_mumps] (HyperFEM's HMultigridSolver with a coarse GAMG V-cycle), run_s4b.sh
… 0.45 by default, 1.5 for ν = 0.3); run_s4b.sh tetl/hexl modes
…on a refined Cartesian hierarchy) and fshmg_<split>[_lagN][_lu] (FieldSplitSolver with one h-multigrid V-cycle per block); run_s4b.sh em mode
@jmartfrut
jmartfrut merged commit 000848d into main Nov 9, 2026
11 checks passed
@jmartfrut
jmartfrut deleted the s4b-bench branch November 9, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant