-
Notifications
You must be signed in to change notification settings - Fork 633
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
Damping #1804
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1804 +/- ##
=======================================
Coverage 73.90% 73.91%
=======================================
Files 17 17
Lines 4913 4914 +1
=======================================
+ Hits 3631 3632 +1
Misses 1282 1282
|
(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; | ||
} |
There was a problem hiding this comment.
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
.)
Could you also add documentation the PR? Just document it in the same place where |
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
* 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>
Closes #1788. Fake conductivity to penalize non-binarized structure.