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

Tutorial examples/absorbed_power_density.py problems #1336

Closed
slagwad opened this issue Aug 31, 2020 · 5 comments
Closed

Tutorial examples/absorbed_power_density.py problems #1336

slagwad opened this issue Aug 31, 2020 · 5 comments

Comments

@slagwad
Copy link

slagwad commented Aug 31, 2020

Hello, when I attempt examples/absorbed_power_density.py from https://github.com/NanoComp/meep/blob/master/python/examples/absorbed_power_density.py it gives me an error stating the yee_grid is not understood in dft_fields. When I comment out the yes_grid command it works and gives roughly equivalent results to those posted at https://meep.readthedocs.io/en/latest/Python_Tutorials/Basics/#absorbed-power-density-map-of-a-lossy-cylinder.

My second issue is that if I replace the material from SiO2 to cSi at 0.8um wavelength the results show:
flux:, -1.1632079183598192e-05 (dft_fields), 1.570299363693065 (dft_flux), 1.0000074075551788 (error)

where the dft_flux seems realistic but the dft_fields is clearly not right. I would appreciate your help resolving these two inconsistencies. Thank you

@oskooi
Copy link
Collaborator

oskooi commented Aug 31, 2020

The yee_grid parameter of add_dft_fields was added in #1095 and released with Meep v1.13. You need to upgrade to the latest version which produces the correct result for cSi at 0.8 μm:

flux:, 1.5648277747465522 (dft_fields), 1.5702993636930598 (dft_flux), 0.003484424099643892 (error)

power_density_map_cSi_0 8um

@slagwad
Copy link
Author

slagwad commented Aug 31, 2020

Thank you. I tried to update meep inside my conda wrapper by performing a "conda activate mp" followed by "conda update pymeep" and agreed to the updates but even after starting a new shell window and activating mp, it still gives me the yee_grid error. What is the right way to update my pymeep inside this conda container?

Also, when I run the above but with a continuous source "mp.ContinuousSource" instead of the Gaussian, it ends up with an effectively infinite run time. I tried shortening the source width by 2*pml assuming that it was an interaction between the source and the assumed metallic side walls but that did not help. Thanks again!

@slagwad
Copy link
Author

slagwad commented Aug 31, 2020

I figured out the update problem. I used "conda update -c conda-forge pymeep" and it worked.
I would still like help with the "mp.ContinuousSource" question. Much appreciated

@oskooi
Copy link
Collaborator

oskooi commented Aug 31, 2020

That's because the run condition in that tutorial is sim.run(until_after_sources=100) which for a ContinuousSource is infinite and thus the simulation will never terminate. In general, you need to use a GaussianSource whenever you are computing DFT fields as explained in this FAQ.

(Note: GitHub issues are not a general help desk. They are for reporting bugs and feature requests. For questions related to usage, you should use the mailing list.)

@oskooi oskooi closed this as completed Aug 31, 2020
@slagwad
Copy link
Author

slagwad commented Sep 4, 2020

Hello Ardavan, I have searched for the mailing list specific to Meep but could not find it. Would you kindly provide the link? Is it the one for www.simpetus.com? Thx again

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

No branches or pull requests

2 participants