Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow external/alternate mode solvers #1319

Open
3 tasks
stevengj opened this issue Aug 14, 2020 · 0 comments
Open
3 tasks

allow external/alternate mode solvers #1319

stevengj opened this issue Aug 14, 2020 · 0 comments

Comments

@stevengj
Copy link
Collaborator

stevengj commented Aug 14, 2020

It would be nice to allow alternative mode solvers (e.g. WGMS3d) to provide other features like cylindrical mode solvers.

In principle, we just need to provide a way to populate the eigenmode_data structure in mpb.cpp with an array of the E and H fields, along with the frequency and some other info, and the subsequent mode source and eigenmode decomposition will work as-is.

(Note that eigenmode_data currently contains some fields that are not used, such as evectmatrix H — the Fourier components of the fields in MPB's basis — which we could eliminate. The group velocity could be computed from the mode profile, in principle, via the ratio of Poynting flux to energy density, but we probably don't need it either.)

A possible plan of attack:

  • Refactor mpb.cpp so that there are lower-level methods for get_eigenmode_coefficients and add_eigenmode_source where you pass in the eigenmode_data structure, which should probably become a C++ class rather than a struct. The MPB-specific solver should declare a subclass that adds MPB-specific fields like mdata and evectmatrix H.
  • Add a higher-level Python API to make it easier to pass a custom eigenmode_data (or maybe a mode-solver function/object). Test it out with a "fake" mode solver that just returns some synthetic "mode".
  • Try out alternative mode solvers and make it easy to plug a good one into Meep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant