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

Reduce complex tolerance in mode solver #2178

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

momchil-flex
Copy link
Collaborator

Currently, for a waveguide with conductivity than about 1e-8, our mode solver returns k_eff=0. This is due to the complex tolerance set to fp_eps regardless of requested precision.

I propose we reduce the complex tolerance to 1e-10 for both precisions. This is what I get then:

image

Alternative is to set it based on precision. However, first of all this requires some refactor as it is currently a unique constant, and the ModeSpec.precision will need to be passed around. Second, as shown above, keeping it lower than fp_eps even for single precision makes even single-precision simulations accurate for some of the scanned range.

Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 left a comment

Choose a reason for hiding this comment

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

Looks fine, as the frontend is usually with double-precision, so unlikely to confuse lossless to lossy one.

@momchil-flex momchil-flex force-pushed the momchil/complex_tolerance branch from 3d5ab93 to 3d99501 Compare January 21, 2025 12:10
@momchil-flex momchil-flex merged commit 672cb64 into pre/2.8 Jan 21, 2025
15 checks passed
@momchil-flex momchil-flex deleted the momchil/complex_tolerance branch January 21, 2025 12:33
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