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

Lower the tolerance in unit tests of adjoint gradient of eigenmode monitor involving an eigenmode source without dispersion #2324

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

oskooi
Copy link
Collaborator

@oskooi oskooi commented Nov 28, 2022

As demonstrated in #2307, the errors in the adjoint gradient for an objective function of an eigenmode monitor tend to be larger at the non-center frequencies of a pulsed source compared to its center frequency due to the current limitation of the EigenModeSource which uses the mode profile at only the center frequency. Until #2315 provides a permanent fix to this problem, this PR modifies several of the tests in test_adjoint_solver.py involving an eigenmode source and the calculation of the adjoint gradient at a single frequency (the center frequency of the pulsed source) by lowering the tolerance (relative to the value used for the multifrequency adjoint-gradient calculation) used to validate the result against the finite-difference approximation. In effect, this enforces a tighter tolerance on the "correct" result for the gradient.

Separately (but related to this PR), several type hints are added and corrected.

@stevengj stevengj merged commit 7adcc84 into NanoComp:master Dec 1, 2022
@oskooi oskooi deleted the adjsol_test_mode_disp branch December 1, 2022 21:26
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.

2 participants