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

specify direction in eigenmode source in optical forces tutorial #1204

Merged
merged 1 commit into from
May 2, 2020

Conversation

oskooi
Copy link
Collaborator

@oskooi oskooi commented Apr 30, 2020

Fixes #1202.

#1035 changed the default behavior when a 2d cell is combined with a k_point with a non-zero z component from a 3d to a 2d simulation. With this change, the 2d eigenmode source with eig_freq_match=True in Tutorial/Optical Forces was aborting with the error Could not determine normal direction for given grid_volume. To fix this, the direction property of the eigenmode source must be set to z from the default AUTOMATIC. (Note also that NO_DIRECTION will not work.)

The Jupyter notebook and the Scheme version are also updated with this change.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

@stevengj
Copy link
Collaborator

stevengj commented May 2, 2020

In a 2d simulation with a nonzero kz, I think we should be able to automate this.

@stevengj
Copy link
Collaborator

stevengj commented May 2, 2020

Arguable, we should be setting eig_match_freq = False here, because the kz is fixed by the simulation.

If eig_match_freq == False and we have a 2d simulation and a 2d region, with a nonzero kz (β), I think that Meep should automatically infer that the k direction is kz.

@stevengj stevengj merged commit 68011d9 into NanoComp:master May 2, 2020
@oskooi oskooi deleted the forces_special_kz branch May 2, 2020 03:39
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
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

Successfully merging this pull request may close these issues.

forcing sim to work in 3D rather than 2D
2 participants