You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 inmpb.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 asevectmatrix 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:
mpb.cpp
so that there are lower-level methods forget_eigenmode_coefficients
andadd_eigenmode_source
where you pass in theeigenmode_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 likemdata
andevectmatrix H
.eigenmode_data
(or maybe a mode-solver function/object). Test it out with a "fake" mode solver that just returns some synthetic "mode".The text was updated successfully, but these errors were encountered: