Skip to content

Commit

Permalink
For Bug#1117 (#1219)
Browse files Browse the repository at this point in the history
* 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 (#1219)

* Revert accidental code changes.

* Whitespace fixes.

* Whitespace changes.

Co-authored-by: Chong Yidong <[email protected]>
  • Loading branch information
seewhydee and Chong Yidong authored May 19, 2020
1 parent 22a4915 commit 65b69ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/meepgeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,7 @@ static bool susceptibility_equiv(const susceptibility *o0, const susceptibility
if (!vector3_equal(o0->bias, o->bias)) return 0;
if (o0->frequency != o->frequency) return 0;
if (o0->gamma != o->gamma) return 0;
if (o0->alpha != o->alpha) return 0;
if (o0->noise_amp != o->noise_amp) return 0;
if (o0->drude != o->drude) return 0;
if (o0->saturated_gyrotropy != o->saturated_gyrotropy) return 0;
Expand Down
5 changes: 3 additions & 2 deletions src/susceptibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,9 @@ void gyrotropic_susceptibility::subtract_P(field_type ft,

int gyrotropic_susceptibility::num_cinternal_notowned_needed(component c,
void *P_internal_data) const {
gyrotropy_data *d = (gyrotropy_data *)P_internal_data;
return d->P[c][0][0] ? 3 : 0;
(void)c;
(void)P_internal_data;
return 0;
}

realnum *gyrotropic_susceptibility::cinternal_notowned_ptr(int inotowned, component c, int cmp,
Expand Down

0 comments on commit 65b69ef

Please sign in to comment.