Discussion:
[Meep-discuss] EPS averaging affecting harminv mode search and mode distribution
Chee Fai
2018-11-05 12:38:47 UTC
Permalink
Dear all,


I started using MEEP about 2 weeks ago and have been doing some test calculations on MEEP, mainly to reproduce results of cavity mode and Q factors of a H1 photonic crystal cavity as reported in this paper:

https://www.osapublishing.org/oe/abstract.cfm?uri=oe-20-27-28292



When EPS averaging is off, harminv could find the modes and the Q values. The mode frequency changes quite significantly with resolution and it doesn't quite converge to the right value but it finds the correct modes i.e. the modes have the expected field distributions. Overall, despite the deviation in the mode frequency and Q values, it works fairly well in finding the modes.


However, when I turn EPS averaging on, harminv could find the mode with the correct frequency and Q value but only for certain resolutions. The mode is lost somehow when I increase the resolution. Not only that, the mode distribution is totally off when averaging is on.

Note:

- I check the mode distribution by creating h5 output files over 1 wavelength to create PNG and gifs as it was done in the tutorial. I don't think this is the problem but I am going to try changing a method to create outputs of field distribution

- I perform harminv on Ex, Ey and Hz, all at the same non-zero position, away from points/lines of symmetry.


I have checked that the x, y and z symmetry that I applied are correct for the structure and the source. I have also tried to see what happens when I change the excitation bandwidth and/or simulation stop time but I didn't really see a trend that points to the problem of what could affect harminv and the mode distribution. I have also checked the archive to see if others have faced similar problems. Alas, I am here. I hope someone can point to the solution or a direction on how to solve this issue.


Thank you very much.


Best,

Chee


P.S. I can attach my code if it helps.
John Weiner
2018-11-05 14:17:46 UTC
Permalink
Hi Chee,

I have also observed unexpected behavior in results from meep as the resolution is varied. I have been studying the local density of states (LDOS) for a gaussian source placed near a spherical structure consisting of a lossless dielectric core with high permittivity and coated with a Ag layer. Analytical results exist for this 3D case, and I have been comparing these analytical results with those obtained with meep. So far I have been finding that at lower resolutions the meep results are in “good” agreement with the analytical results, but as the resolution is increased the agreement degrades. I don’t know if this has anything to do with sub pixel averaging. I have not yet tried to turn off sub pixel averaging, but I will try it to see what happens. According to the documentation sub pixel averaging has not yet been implemented for Drude-Lorentz materials such as Ag, and I don’t know what meep really does at the boundary between a nondispersive lossless dielectric and a Drude-Lorentz dispersive material.

Years ago I used the commercial code Lumerical to perform some FDTD simulations, and I found that unless the computational grid points fell EXACTLY on the discontinuous boundary between between materials with different permittivities, one would obtain spurious results. As resolution was varied, if the number of points per unit length happened to be commensurate with geometry boundary, then the results behaved as expected. If the resolution was incommensurate, however, the computation proceeded without error or warning, but the results were unphysical.

This experience may or may not have anything to do with what you observe, but it does illustrate unexpected behavior with increasing resolution. A more enlightened and sophisticated discussion from the writers and maintainers of the meep code might be in order.

Best regards,

John

> On Nov 5, 2018, at 7:38 AM, Chee Fai <***@hotmail.com> wrote:
>
> Dear all,
>
> I started using MEEP about 2 weeks ago and have been doing some test calculations on MEEP, mainly to reproduce results of cavity mode and Q factors of a H1 photonic crystal cavity as reported in this paper:
> https://www.osapublishing.org/oe/abstract.cfm?uri=oe-20-27-28292 <https://www.osapublishing.org/oe/abstract.cfm?uri=oe-20-27-28292>
>
>
> When EPS averaging is off, harminv could find the modes and the Q values. The mode frequency changes quite significantly with resolution and it doesn't quite converge to the right value but it finds the correct modes i.e. the modes have the expected field distributions. Overall, despite the deviation in the mode frequency and Q values, it works fairly well in finding the modes.
>
> However, when I turn EPS averaging on, harminv could find the mode with the correct frequency and Q value but only for certain resolutions. The mode is lost somehow when I increase the resolution. Not only that, the mode distribution is totally off when averaging is on.
> Note:
> - I check the mode distribution by creating h5 output files over 1 wavelength to create PNG and gifs as it was done in the tutorial. I don't think this is the problem but I am going to try changing a method to create outputs of field distribution
> - I perform harminv on Ex, Ey and Hz, all at the same non-zero position, away from points/lines of symmetry.
>
> I have checked that the x, y and z symmetry that I applied are correct for the structure and the source. I have also tried to see what happens when I change the excitation bandwidth and/or simulation stop time but I didn't really see a trend that points to the problem of what could affect harminv and the mode distribution. I have also checked the archive to see if others have faced similar problems. Alas, I am here. I hope someone can point to the solution or a direction on how to solve this issue.
>
> Thank you very much.
>
> Best,
> Chee
>
> P.S. I can attach my code if it helps.
> _______________________________________________
> meep-discuss mailing list
> meep-***@ab-initio.mit.edu <mailto:meep-***@ab-initio.mit.edu>
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss <http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss>
Ardavan Oskooi
2018-11-05 23:02:17 UTC
Permalink
Finding resonant modes using harminv is a topic that has come up
numerous times on this mailing list:

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg02636.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00683.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00592.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00540.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00594.html
Chee Fai
2018-11-09 05:05:14 UTC
Permalink
Hi Ardavan,


Thank you very much for your reply.

I have checked the issues in the threads that you posted and some others as well.


I will continue to do more test to find out what is wrong, whether it is something to do with harminv or eps averaging.


In the meantime, I notice that the field output files do have the right dimensions as specified if I perform 2 consecutive simulation runs as below:


sim.run( mp.in_volume(mp.Volume(center=mp.Vector3(), size=mp.Vector3(sx,sy,0)),
mp.at_end(mp.output_epsilon,
mp.output_hfield_z,
mp.output_efield_x,
mp.output_efield_y)),
mp.after_sources(harHz),mp.after_sources(harEx),mp.after_sources(harEy),
until_after_sources = simstoptime)

sim.run(mp.in_volume(mp.Volume(center=mp.Vector3(), size=mp.Vector3(sx,sy,sz)),
mp.at_every(1 / fcen / 4, mp.output_hfield_z),
mp.at_every(1 / fcen / 4, mp.output_efield_x),
mp.at_every(1 / fcen / 4, mp.output_efield_y)),
until=1 / fcen);

The output files consist of data of x-plane slices for both runs regardless of the volume that I specified. I guess there could be clash in the filenames for both runs?

Looking forward to your reply.

Thank you very much.

Best regards,
Chee


________________________________
From: meep-discuss <meep-discuss-***@ab-initio.mit.edu> on behalf of Ardavan Oskooi <***@gmail.com>
Sent: Tuesday, November 6, 2018 8:02 AM
To: meep-***@ab-initio.mit.edu
Subject: Re: [Meep-discuss] EPS averaging affecting harminv mode search and mode distribution

Finding resonant modes using harminv is a topic that has come up
numerous times on this mailing list:

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg02636.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00683.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00592.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00540.html

https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg00594.html
Chee Fai
2018-11-13 11:58:46 UTC
Permalink
Hi everyone,


Here is an update.


I have done some testing using the 3D nanobeam project python code found on the Simpetus website:

http://www.simpetus.com/projects.html#meep_cavity


I found that, with eps averaging on, harminv would still work when the resolution is at 42. However, harminv would fail when the resolution is increased to 44 (originally 40). Also, the mode field output is completely off.


When eps averaging is off, harminv found the mode succesfully though with a lower Q-factor, as well as output the expected mode field profiles.


I don't know if this is something to do with eps averaging itself or harminv or even with running the scripts on jupyter notebook with parallel meep.

Nonetheless, I have managed to reproduce the results of the reported H1 photonic crystal mode and Q-factor using a sufficiently large cell and high enough resolution with eps averaging turned off. In this sense, I think I can avoid possible issues with eps averaging.



I would appreciate it if you could consider the following feature requests:


1) Independent resolution for different axes:


For example: resolution_xaxis = 40, resolution_yaxis = 40, resolution_zaxis = 20.


Often in my simulations, I could use a low resolution in the z-axis. I t would be great is this feature gets implemented as this would mean reducing time with by setting the resolutions suitably.


2) Cylinder with major and minor axes / an elliptical cylinder


Essentially an ellipse with a non-zero height to simulation elliptical air-holes.

I will try to implement this using the prism function for now.


Thank you very much.


Best regards,

Chee







________________________________
From: meep-discuss <meep-discuss-***@ab-initio.mit.edu> on behalf of Chee Fai <***@hotmail.com>
Sent: Monday, November 5, 2018 9:38 PM
To: meep-***@ab-initio.mit.edu
Subject: [Meep-discuss] EPS averaging affecting harminv mode search and mode distribution


Dear all,


I started using MEEP about 2 weeks ago and have been doing some test calculations on MEEP, mainly to reproduce results of cavity mode and Q factors of a H1 photonic crystal cavity as reported in this paper:

https://www.osapublishing.org/oe/abstract.cfm?uri=oe-20-27-28292



When EPS averaging is off, harminv could find the modes and the Q values. The mode frequency changes quite significantly with resolution and it doesn't quite converge to the right value but it finds the correct modes i.e. the modes have the expected field distributions. Overall, despite the deviation in the mode frequency and Q values, it works fairly well in finding the modes.


However, when I turn EPS averaging on, harminv could find the mode with the correct frequency and Q value but only for certain resolutions. The mode is lost somehow when I increase the resolution. Not only that, the mode distribution is totally off when averaging is on.

Note:

- I check the mode distribution by creating h5 output files over 1 wavelength to create PNG and gifs as it was done in the tutorial. I don't think this is the problem but I am going to try changing a method to create outputs of field distribution

- I perform harminv on Ex, Ey and Hz, all at the same non-zero position, away from points/lines of symmetry.


I have checked that the x, y and z symmetry that I applied are correct for the structure and the source. I have also tried to see what happens when I change the excitation bandwidth and/or simulation stop time but I didn't really see a trend that points to the problem of what could affect harminv and the mode distribution. I have also checked the archive to see if others have faced similar problems. Alas, I am here. I hope someone can point to the solution or a direction on how to solve this issue.


Thank you very much.


Best,

Chee


P.S. I can attach my code if it helps.
Ardavan Oskooi
2018-11-13 16:46:57 UTC
Permalink
On 11/13/2018 3:58 AM, Chee Fai wrote:

> I found that, with eps averaging on, harminv would still work when the
> resolution is at 42. However, harminv would fail when the resolution
> is increased to 44 (originally 40). Also, the mode field output is
> completely off.
>

For your reference, we recently added a new FAQ on finding resonant
modes using Harminv:


https://meep.readthedocs.io/en/latest/FAQ/#harminv-is-unable-to-find-the-resonant-modes-of-my-structure



> I would appreciate it if you could consider the following feature
> requests:
>
>
> 1) Independent resolution for different axes:
>

Providing support for non-uniform resolutions would be a major
undertaking and one is which not part of our near-term plans. It is
possible using transformation optics to vary the spatial resolution
without any changes to the underlying code. This is described in the
notes linked to in this FAQ:


https://meep.readthedocs.io/en/latest/FAQ/#does-meep-support-a-non-uniform-grid



> 2) Cylinder with major and minor axes / an elliptical cylinder
>

There is already an Ellipsoid object with these properties which is
described in the documentation:
https://meep.readthedocs.io/en/latest/Python_User_Interface/#geometricobject.
Chee Fai
2018-11-14 03:39:52 UTC
Permalink
Dear Ardavan,


Thank you very much for your reply.


I should have looked at the documentations more close. It didn't occur to me immediately how the ellipsoid could work before posting.


Thank you very much once again.


Best,

Chee


________________________________
From: meep-discuss <meep-discuss-***@ab-initio.mit.edu> on behalf of Ardavan Oskooi <***@gmail.com>
Sent: Wednesday, November 14, 2018 1:46 AM
To: meep-***@ab-initio.mit.edu
Subject: Re: [Meep-discuss] EPS averaging affecting harminv mode search and mode distribution


On 11/13/2018 3:58 AM, Chee Fai wrote:

I found that, with eps averaging on, harminv would still work when the resolution is at 42. However, harminv would fail when the resolution is increased to 44 (originally 40). Also, the mode field output is completely off.


For your reference, we recently added a new FAQ on finding resonant modes using Harminv:


https://meep.readthedocs.io/en/latest/FAQ/#harminv-is-unable-to-find-the-resonant-modes-of-my-structure




I would appreciate it if you could consider the following feature requests:


1) Independent resolution for different axes:


Providing support for non-uniform resolutions would be a major undertaking and one is which not part of our near-term plans. It is possible using transformation optics to vary the spatial resolution without any changes to the underlying code. This is described in the notes linked to in this FAQ:



https://meep.readthedocs.io/en/latest/FAQ/#does-meep-support-a-non-uniform-grid


2) Cylinder with major and minor axes / an elliptical cylinder


There is already an Ellipsoid object with these properties which is described in the documentation: https://meep.readthedocs.io/en/latest/Python_User_Interface/#geometricobject.
Loading...