Skip to content

Commit

Permalink
specify default no smoothing for MaterialGrid constructor (#1903)
Browse files Browse the repository at this point in the history
* specify default no subpixel smoothing for

* slightly increase tolerance for single precision of two unit tests
  • Loading branch information
oskooi authored Jan 13, 2022
1 parent accaf4f commit 8f3d7ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/docs/Python_User_Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4414,7 +4414,7 @@ def __init__(self,
medium2,
weights=None,
grid_type='U_DEFAULT',
do_averaging=True,
do_averaging=False,
beta=0,
eta=0.5,
damping=0):
Expand Down
2 changes: 1 addition & 1 deletion python/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def __init__(self,
medium2,
weights=None,
grid_type="U_DEFAULT",
do_averaging=True,
do_averaging=False,
beta=0,
eta=0.5,
damping=0):
Expand Down
4 changes: 2 additions & 2 deletions python/tests/test_adjoint_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def test_adjoint_solver_DFT_fields(self):
adj_scale = (dp[None,:]@adjsol_grad).flatten()
fd_grad = Ez2_perturbed-Ez2_unperturbed
print("Directional derivative -- adjoint solver: {}, FD: {}".format(adj_scale,fd_grad))
tol = 0.04 if mp.is_single_precision() else 0.006
tol = 0.07 if mp.is_single_precision() else 0.006
self.assertClose(adj_scale,fd_grad,epsilon=tol)


Expand Down Expand Up @@ -477,7 +477,7 @@ def test_complex_fields(self):
adj_scale = (dp[None,:]@adjsol_grad).flatten()
fd_grad = Ez2_perturbed-Ez2_unperturbed
print("Directional derivative -- adjoint solver: {}, FD: {}".format(adj_scale,fd_grad))
tol = 0.012 if mp.is_single_precision() else 0.002
tol = 0.018 if mp.is_single_precision() else 0.002
self.assertClose(adj_scale,fd_grad,epsilon=tol)

def test_damping(self):
Expand Down

0 comments on commit 8f3d7ba

Please sign in to comment.