Skip to content

option for PMC boundary in mode solver #2472

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dbochkov-flexcompute
Copy link
Contributor

No description provided.

"""Forward derivative in x."""
Nx, Ny = shape
if Nx == 1:
return sp.csr_matrix((Ny, Ny))
dxf = sp.csr_matrix(sp.diags([-1, 1], [0, 1], shape=(Nx, Nx)))
if not pmc:
if pmc_pos:
dxf[-1, -1] = 0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

So I don't think this is right, this will just impose PEC on the next-to-last grid boundary, right?

To impose PMC, this can be placed in the backward derivatives instead. However, it is still tricky: there it will impose it at the last grid center, not at the last grid boundary. I think it's not possible to impose it at the last boundary without expanding by one pixel, and then doing something like seetting a value of 2 for the derivative, like we do for pmc on the negative side (but there we can do without an extra pixel). I think this might have been the reason I only had it working on the negative side in the first place...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah, this is not quite correct. I believe what I did here is to impose PMC in the middle of the last cell: specifically here by setting this last coefficient to zero we effectively impose the normal derivative of tangential E field to be zero. I did forget to set tangential H to zero there (by setting dxb[-1, -1] = 0.0 and dyb[-1, -1] = 0.0), but somehow it did not matter

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, you are right. I think probably both of those decouple that last dual location from the rest of the simulation, so the only thing is if you don't do both, you might get spurious modes that are purely localized to that location? In fact I see we do both of those for PEC yet we still had to add this to avoid such modes. And we don't do it for the right boundary, because there's no actual field there, but if the PMC right boundary is defined at the last dual location, then will probably be needed at least in the tensorial case where we solve for both E and H?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants