Skip to content

Update adapt cost microbenchmark for current APIs - #476

Open
ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:ss2098/update-adapt-cost-microbench
Open

Update adapt cost microbenchmark for current APIs#476
ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:ss2098/update-adapt-cost-microbench

Conversation

@ss2098

@ss2098 ss2098 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This PR updates scripts/adapt_cost_microbench.py so the microbenchmark runs with the current Underworld3 APIs.

Changes include:

  • convert AdvDiffusionSLCN estimate_dt() output to a scalar before passing it to solve()
  • replace internal mesh._deform_mesh() calls with the public mesh.deform() API
  • replace the retired smooth_mesh_interior(..., method="anisotropic") path with uw.meshing.node_redistribution()
  • add fail-fast SNES convergence checks so the benchmark does not continue after a failed solve
  • simplify the Stokes boundary condition so the microbenchmark runs stably as a cost diagnostic

This does not change solver internals.

Validation:

  • pixi run python scripts/adapt_cost_microbench.py

Example local output:

  • plain (adv+stokes) step: 1.217 s
  • one pristine adaptation total: 3.586 s
  • adaptation / step ratio: 2.9x

@ss2098
ss2098 requested a review from lmoresi as a code owner July 29, 2026 08:11
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