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

Fixed run-k-points bug by adding change-k-point. #779

Merged
merged 5 commits into from
Mar 27, 2019

Conversation

acerjan
Copy link
Contributor

@acerjan acerjan commented Mar 22, 2019

Slight update to documentation to remind users to set the k-point prior to adding flux / energy regions.

Resolves #770.

…umentation to remind users to set the k-point prior to adding flux / energy regions.
scheme/meep.scm.in Outdated Show resolved Hide resolved
@stevengj
Copy link
Collaborator

I updated it with a few fixes:

  • Once you call change-k-point! you no longer need to call init-fields since the fields are already initialized.
  • In Python, we don't call output_epsilon by default anymore in other run functions, so that whole block can be eliminated.
  • In Python, the functions add_flux etcetera are now "lazy" (that is, they set up an initialization that is actually performed only when the run begins), so we can remove the language in the manual about only calling them after setting parameters.

@stevengj
Copy link
Collaborator

Will merge once tests are green again.

@acerjan
Copy link
Contributor Author

acerjan commented Mar 25, 2019

When I was testing change-k-point! without init-fields in scheme, the output-epsilon call threw errors complaining that the fields had not been initialized. That's why I left in init-fields.

@stevengj
Copy link
Collaborator

Oh, you are right, restart-fields only re-initializes the fields if they have already been initialized. I updated it to call init-fields, but with a guard to ensure that it only re-allocates the fields if needed.

@stevengj stevengj merged commit 5245a95 into NanoComp:master Mar 27, 2019
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* Fixed run-k-points bug by adding change-k-point. Slight update to documentation to remind users to set the k-point prior to adding flux / energy regions.

* delete unnecessary init-fields call

* in Python we don't output_epsilon by default

* add_flux/energy/force are lazy in Python

* init-fields if they aren't created yet
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.

2 participants