Skip to content

Warn when mode solver pml covers a significant portion of the mode plane #2320

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

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

caseyflex
Copy link
Contributor

@caseyflex caseyflex commented Mar 14, 2025

Partially addresses this issue:

#2277

Adds a warning when the PML covers a significant portion of the mode plane, and makes it easy to get the mode PML thickness (e.g. for GUI plotting).

Doesn't change the mode PML behavior, API, or plotting.

@caseyflex caseyflex marked this pull request as ready for review March 17, 2025 09:16
@caseyflex caseyflex requested a review from yaugenst-flex March 17, 2025 09:16
@caseyflex caseyflex linked an issue Mar 17, 2025 that may be closed by this pull request
@caseyflex caseyflex requested a review from e-g-melo March 17, 2025 09:20
@caseyflex
Copy link
Contributor Author

@momchil-flex fyi. You mentioned changing the plotting for mode monitors and mode sources to show the mode pml. I didn't include this here because I wasn't sure about it -- it would clutter the plotting, and maybe it's not that critical most of the time? But we could consider including that or unifying the plotting between the ModeSolver and the mode objects in FDTD simulations (currently ModeSolver shows the pml while FDTD mode objects do not). It would be easy to include in this PR if we decide to make that plotting change.

@caseyflex caseyflex force-pushed the casey/pmlwarning branch 2 times, most recently from cea0bf4 to 3446b3c Compare March 18, 2025 13:55
Copy link
Collaborator

@yaugenst-flex yaugenst-flex left a comment

Choose a reason for hiding this comment

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

Thanks @caseyflex looks good to me! We really need a config though for these globals... 😄

@caseyflex
Copy link
Contributor Author

@e-g-melo can we merge this?

Copy link
Collaborator

@e-g-melo e-g-melo left a comment

Choose a reason for hiding this comment

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

Hi @caseyflex! Thanks for this work!

I am ok with the changes to plotting.

After trying it, I suggest reducing that threshold to 50% of the mode plane.

@momchil-flex
Copy link
Collaborator

Sorry, one thing this is making me think about is that e.g. in RF CPW simulations, the mesh could be much much finer around the waveguide than at the outer edges of the mode plane. So while the physical area of the PML may appear large, there is no problem because the majority of the grid cells are outside of PML. I feel like generally checking on the grid points level rather than physical area might be better?

@e-g-melo e-g-melo closed this Apr 3, 2025
@caseyflex caseyflex reopened this Apr 3, 2025
@caseyflex
Copy link
Contributor Author

@momchil-flex I reworked it so the warning is now based on num_cells (although the area functions are still available if needed)

Copy link
Collaborator

@momchil-flex momchil-flex left a comment

Choose a reason for hiding this comment

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

Looks good!

@caseyflex caseyflex merged commit 6c2e2c6 into develop Apr 4, 2025
18 checks passed
@caseyflex caseyflex deleted the casey/pmlwarning branch April 4, 2025 15:57
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.

5 participants