-
Notifications
You must be signed in to change notification settings - Fork 626
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
add support for out-of-plane wavevector in 2d cell to fields::get_eigenmode #1968
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1968 +/- ##
==========================================
+ Coverage 73.09% 73.13% +0.04%
==========================================
Files 17 17
Lines 4917 4917
==========================================
+ Hits 3594 3596 +2
+ Misses 1323 1321 -2
|
The unit test for mode decomposition and the |
Maybe try a longer wavelength where there is only the 0th (specular) diffracted order, just to simplify things. |
With only a single reflected or transmitted diffraction order, the results from the mode decomposition agree with the Poynting flux. It is only when where there are more than one orders that the results disagree. Here is a unit test which demonstrates this. This is strange because the dominant planewave used to compute the mode coefficient and shown in the output is correct. Perhaps there is a bug in MPB's |
Don't forget that kz ≠ 0 allows the grating structure to couple the s and p polarizatios. So you have to compute both the s and p diffracted orders and add up their powers. |
Summing up the flux in each of the diffraction orders for both the S- and P-polarizations does indeed produce the same result as the total Poynting flux. I have added a unit test in |
Notes:
|
Might be nice to have a test for the relative phase of the eigenmode coefficients. You can just do a transmission calculations through a flat interface between a material ε1 and air, and another simulation through ε2 and air; then the relative phase of the two eigenmode transmission coefficients should match the prediction from the Fresnel equations. |
Closes #1957.