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

For Bug#1117 #1219

Merged
merged 76 commits into from
May 19, 2020
Merged

For Bug#1117 #1219

merged 76 commits into from
May 19, 2020

Conversation

seewhydee
Copy link
Contributor

@seewhydee seewhydee commented May 14, 2020

This switches gyromagnetic media to use the default needs_P function, and modifies gyrotropic_susceptibility::update_P to handle the cases where sigma is NULL.

The Faraday rotation test case (https://meep.readthedocs.io/en/latest/Python_Tutorials/Gyrotropic_Media/) is unaffected, and the test case by @mojv doesn't crash anymore. I haven't performed any additional tests.

Fixes #1117.

seewhydee and others added 30 commits May 8, 2019 22:08
src/susceptibility.cpp Outdated Show resolved Hide resolved
@oskooi
Copy link
Collaborator

oskooi commented May 14, 2020

Does this PR also address #1084?

@stevengj
Copy link
Collaborator

stevengj commented May 14, 2020

@oskooi, no, improving memory usage for susceptibilities in general is a separate issue. As noted above, however, I think we can do better for the specific case of gyrotropic media.

src/susceptibility.cpp Outdated Show resolved Hide resolved
@stevengj stevengj merged commit 65b69ef into NanoComp:master May 19, 2020
@stevengj
Copy link
Collaborator

Thanks for looking into this, @seewhydee!

bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* Implement gyrotropic susceptibility class.

* Add Python and Scheme support for gyrotropic media.

* Initialize bias vector in python susceptibility struct.

* Remove "bias" from gyrotropic_susceptibility; the information is already in gyro_tensor.

* Add gyrotropic media to docs

* Minor copyedit

* Fix logic in py_susceptibility_to_susceptibility

* In add_susceptibilities, always pass a 3-vector as gyrotropic bias

* First try at gyrotropic media tutorial

* Fix errors in gyrotropy formulas in notes

* Re-implemention of gyrotropy using LLG equation

* Tweak handling of sigma tensor in gyrotropic case

* Update Python doc.

* Drop 2pi factor from gyrotropic sigma

* Doc updates

* Fix last change to update_P

* Fix printf typo

* Remove spurious 2pi factor in alpha (which is not a rate)

* Minor code tweak

* Use a central-difference scheme for the LLG dynamics, which seems slighly more stable...

* Try implementing the full nonlinear LLG equation

* Add implicit static polarization to gyrotropy implementation

* Put static P back in in subtract_P

* Add gyrotropy example

* Fix; use LOOP_OVER_VOL instead of LOOP_OVER_VOL_OWNED to ensure updating of off-diagonal components

* Clamp the magnitude of the LLG polarization vector.

* Revert inadvertent unrelated change to meep.i

* Minor code cleanup

* Flag "needs_W_notowned" for gyrotropic media

* Update gyrotropic P components explicitly; don't use LOOP_OVER_VOL_OWNED

* Enable needs_P on all components for gyrotropic media

* Fix gyrotropy scheme to track 9 polarization components per unit cell.

* Revert unrelated last change to meep.i

* Avoiding need for allocation of P_tmp in gyrotropy_data.

* Implement num_cinternal_notowned stuff for gyrotropic media

* Update documentation for gyrotropic media, and relax some minor restrictions.

* Add virtual keywords to gyrotropic_susceptibility methods

* Merge latest changes from master

* Remove gyrotropic-dispersion.py (incomplete attempt)

* Complete merge

* Update Materials.md to discuss both Lorentzian and LLG gyrotropic models

* Introduce a new gyrotropy_model enum type, to allow for the LLG model.

* More plumbing to provide support for Landau-Lifshitz-Gilbert type gyrotropy model

* Fix typo in susceptibility update equation

* Fix typos in Faraday rotation formula in docs

* Merge from master

* Reimplement linearized-LLG updating equations

* Fix typo

* Minor code clarification

* Fix Faraday rotation example

* For Landau-Lifshitz-Gilbert model, ignore the magnitude of the bias vector.

* Fix minor hiccup in docs.

* Support dumping and undumping of gyrotropic susceptibilities

* Doc updates and minor tweaks accompanying last merge

* Translate Faraday rotation tutorial from Python to Scheme

* Fix typo in last change

* Fix missing 2pi factor in gyrotropic LLG susceptibility's sigma parameter

* Minor fixes for gyrotropy documentation

* Add Faraday rotation unit test

* Use absolute tolerance (in degrees) for Faraday rotation unit test

* Add faraday rotation test to python/Makefile.am

* Relax rules on needs_P for gyrotropic media (Bug#1117)

* Remove gyrotropic_susceptibility::needs_P, falling back on parent version

* Set gyrotropic_susceptibility::num_cinternal_notowned_needed as suggest by stevengj (NanoComp#1219)

* Revert accidental code changes.

* Whitespace fixes.

* Whitespace changes.

Co-authored-by: Chong Yidong <cyd@gnu.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants