Skip to content

feat: add MeepMeshSim for GMSH mesh-based photonic simulations#39

Draft
vvahidd wants to merge 2 commits intomainfrom
meep-mesh-sim
Draft

feat: add MeepMeshSim for GMSH mesh-based photonic simulations#39
vvahidd wants to merge 2 commits intomainfrom
meep-mesh-sim

Conversation

@vvahidd
Copy link
Contributor

@vvahidd vvahidd commented Feb 26, 2026

Summary

  • Add MeepMeshSim class — alternative mesh-based workflow for Meep that mirrors Palace's mesh()write_config() pattern
  • Produces GMSH .msh + mesh_config.json that fully describes a photonic problem (materials, source, monitors, domain, solver)
  • Add include_airbox flag to generate_mesh() / add_dielectrics() — defaults to True for Palace (RF), False for Meep (photonics)
  • Add material field to volume groups in mesh config JSON for consistency with layer_volumes
  • New gsim.common.mesh module for solver-agnostic GMSH mesh generation

Test plan

  • uv run pytest tests/meep/test_mesh_sim.py -v — 21 new tests pass
  • uv run pytest tests/common/test_mesh.py -v — common mesh tests pass
  • uv run pytest tests/ — all existing tests still pass
  • Notebook nbs/mesh_ybranch.ipynb produces .msh + mesh_config.json

Add an alternative mesh-based workflow for Meep that mirrors Palace's
mesh() → write_config() pattern. Produces a GMSH .msh + mesh_config.json
that fully describes a photonic problem.

- MeepMeshSim class with geometry/source/domain/solver setters
- mesh_config.py writer for JSON problem definition
- include_airbox flag on generate_mesh (default False for photonics)
- gsim.common.mesh module for solver-agnostic GMSH mesh generation
- 21 new tests + notebook demo
Palace mesh modules import shared utilities from gsim.common.mesh
instead of duplicating them. Also includes auto-generated api.md.
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