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

fix off-by-one bug in dimensions of fixed-resolution MaterialGrid for adjoint-solver functions #1769

Merged
merged 5 commits into from
Sep 29, 2021

Conversation

oskooi
Copy link
Collaborator

@oskooi oskooi commented Sep 27, 2021

Fixes several instances of a bug involving the dimensions of a MaterialGrid with fixed resolution. This bug was originally reported in #1760.

Also, the resolution used in the unit test test_adjoint_solver.py is slightly increased in order to reduce the hard-coded tolerances used to compare values.

python/adjoint/basis.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@smartalecH smartalecH left a comment

Choose a reason for hiding this comment

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

LGTM.

@codecov-commenter
Copy link

Codecov Report

Merging #1769 (5f8edc6) into master (21e9c35) will increase coverage by 0.02%.
The diff coverage is 55.55%.

@@            Coverage Diff             @@
##           master    #1769      +/-   ##
==========================================
+ Coverage   74.39%   74.41%   +0.02%     
==========================================
  Files          13       13              
  Lines        4581     4581              
==========================================
+ Hits         3408     3409       +1     
+ Misses       1173     1172       -1     
Impacted Files Coverage Δ
python/adjoint/basis.py 15.70% <0.00%> (ø)
python/adjoint/filters.py 49.69% <71.42%> (ø)
python/adjoint/filter_source.py 86.76% <0.00%> (+1.47%) ⬆️

@stevengj stevengj merged commit d41b0a4 into NanoComp:master Sep 29, 2021
@oskooi oskooi deleted the matgrid_offbyone branch September 29, 2021 02:02
@smartalecH smartalecH mentioned this pull request Oct 1, 2021
4 tasks
mawc2019 pushed a commit to mawc2019/meep that referenced this pull request Nov 3, 2021
… adjoint-solver functions (NanoComp#1769)

* fix off by one bug in MaterialGrid dimensions of adjoint solver functions

* adjust tols

* formatting fixes

* add 1 after dividing by 2

* change design_shape to design_region_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants