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

Damping #1804

Merged
merged 8 commits into from
Oct 28, 2021
Merged

Damping #1804

merged 8 commits into from
Oct 28, 2021

Conversation

mochen4
Copy link
Collaborator

@mochen4 mochen4 commented Oct 27, 2021

Closes #1788. Fake conductivity to penalize non-binarized structure.

@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2021

Codecov Report

Merging #1804 (f056880) into master (849bf3d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1804   +/-   ##
=======================================
  Coverage   73.90%   73.91%           
=======================================
  Files          17       17           
  Lines        4913     4914    +1     
=======================================
+ Hits         3631     3632    +1     
  Misses       1282     1282           
Impacted Files Coverage Δ
python/geom.py 94.16% <100.00%> (+0.01%) ⬆️

@smartalecH
Copy link
Collaborator

smartalecH commented Oct 27, 2021

(You should add "Closes #1788" to the start of your PR so it links and closes when merged.)

src/meepgeom.cpp Outdated
if (get_cnd(c, &((material_type) geometry.items[i].material)->medium_1) ||
get_cnd(c, &((material_type) geometry.items[i].material)->medium_2) ||
(((material_type) geometry.items[i].material)->damping != 0)) return true;
}
Copy link
Collaborator

@stevengj stevengj Oct 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also check this for the extra_materials code below, so you should probably factor it out into a function:

static bool has_conductivity(const material_type &md, meep::component c) {
    medium_struct *mm;
    if (is_medium(md, &mm) && get_cnd(c, mm)) return true;
    if (md->which_subclass == material_data::MATERIAL_GRID &&
        (get_cnd(c, &md->medium_1) || get_cnd(c, &md->medium_2) ||
          md->damping != 0)) return true;
    return false;
}

and then just call this.

(And you'll also want to call it for the default_material.)

@stevengj
Copy link
Collaborator

Could you also add documentation the PR? Just document it in the same place where beta and eta are documented.

python/geom.py Outdated Show resolved Hide resolved
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
@stevengj stevengj merged commit cab86aa into NanoComp:master Oct 28, 2021
mawc2019 pushed a commit to mawc2019/meep that referenced this pull request Nov 3, 2021
* fake conductivity term

* has cond

* fix

* rerun check

* revision & documentation

* rerun check

* rerun check

* Update python/geom.py

Co-authored-by: Steven G. Johnson <stevenj@mit.edu>

Co-authored-by: Mo Chen <mochen@Mos-MacBook-Pro.local>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
@mochen4 mochen4 deleted the damping branch January 5, 2022 00:09
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.

absorption penalty for intermediate material-grid pixels
4 participants