Skip to content

feat(palace): auto-size mesh, always refine ports, improve CPW defaults#111

Merged
vvahidd merged 1 commit intomainfrom
feat/cpw-mesh-refinement-and-notebooks
Apr 17, 2026
Merged

feat(palace): auto-size mesh, always refine ports, improve CPW defaults#111
vvahidd merged 1 commit intomainfrom
feat/cpw-mesh-refinement-and-notebooks

Conversation

@vvahidd
Copy link
Copy Markdown
Contributor

@vvahidd vvahidd commented Apr 17, 2026

Summary

  • Add mesh/auto_size module — automatically scales refined_mesh_size to min_conductor_feature / 4 for the default preset
  • Rework _setup_mesh_fields to always refine conductor surface and port boundary edges (refine_near_conductor_curves now only controls PEC surfaces)
  • Default CPW port offset to length/2 (flush with conductor edge), length default → 2.0 µm
  • Split palace_cpw notebook into palace_cpw_lumped (lumped ports) and palace_cpw_waveport (wave ports)
  • Update mkdocs nav to reference the two new notebooks
  • Add unit tests for auto-sizing heuristics and mesh field line-collection logic

…rs, improve CPW port defaults

- Add mesh auto_size module that scales refined_mesh_size to min conductor feature / 4
- Rework _setup_mesh_fields to always refine conductor surfaces and port boundaries
  (refine_near_conductor_curves flag now only controls PEC surfaces)
- Default CPW port offset to length/2 (flush with conductor edge), length default 2.0
- Split palace_cpw notebook into palace_cpw_lumped and palace_cpw_waveport
- Update mkdocs nav to reference the two new notebooks
- Add unit tests for auto-sizing and mesh field line-collection logic
@github-actions github-actions bot added the enhancement New feature or request label Apr 17, 2026
@vvahidd vvahidd merged commit 739b5b3 into main Apr 17, 2026
7 checks passed
@vvahidd vvahidd deleted the feat/cpw-mesh-refinement-and-notebooks branch April 17, 2026 08:26
vvahidd added a commit that referenced this pull request Apr 18, 2026
Post PRs #111/#114, sim.mesh(preset="default") silently rescaled
refined_mesh_size to min(preset, min_feature/4) whenever the user
did not pass it explicitly. On a realistic CPW-via geometry this drove
cloud solve time from ~3.6 min to ~25 min while barely moving
S-params. Cloud benchmarks showed the default path was ~7x slower
than necessary and preset tiers were no longer honest speed/accuracy
steps (auto-sizing collapsed all three onto the same mesh).

- sim.mesh(auto_size: bool = False, cells_per_feature: int = 2):
  auto-sizing is now explicit opt-in; presets use their literal
  refined_mesh_size; cpf default drops 4 -> 2 (cpf=4 was
  over-refining typical CPWs to ~51k nodes; cpf=2 matches the
  fine preset at ~23k while still scaling small features).
- When auto_size=False and a conductor feature may be under-resolved,
  emit a warning suggesting auto_size=True.
- Log a post-mesh summary line:
  "Mesh: N nodes \u00b7 M tets \u00b7 refined=X um \u00b7 max=Y um".
- Warn when node count > 75,000 so slow configs are visible before
  cloud submission.

Tests updated: pass cells_per_feature=4 explicitly where intent needs
it; the generic auto-size-fires test asserts the new cpf=2 value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant