-
Notifications
You must be signed in to change notification settings - Fork 48
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
Homogeneous medium validators with custom medium #1373
Comments
I think the warning approach might make the most sense to me, in the sense that it's the least restrictive and also fastest. |
In fact looking at the solver, TFSF where the source surface crosses a custom medium would straight up not work, or the results may be wrong, even if the custom medium is uniform on those surfaces. We should just validate that out. For plane wave, diffraction monitor, we could just warn if in custom medium. |
What about checking if custom medium is uniform, if not, warn that it should be uniform on the plane?
@momchil-flex could you explain a bit more why it doesn't work even for a uniform custom medium? |
If we actually do the check, we should error if it's not uniform, not warn. But I wonder if the check may be expensive for e.g. a large plane, e.g. a large-area metalens?
Actually I don't remember anymore what I saw when I first commented this. Perhaps I was thinking that the custom medium is ignored in the auxiliary simulation - but now that I look again, I can't really tell. Maybe best to try... |
I mean we only check if the entire custom medium is uniform, but not the intersecting plane. This should be cheap as we don't compute the intersection? And if it's nonuniform, it's still possible that the medium is uniform on the plane, so we just warn. |
Is there a cheap way to check this? I guess something like |
It will take at least O(N), N being the number of array size. Will this be too slow? |
That's true, I forgot amin/amax is not sorting but just O(N). I think this is fine then. |
We have a validator that is meant to validate that a diffraction monitor is in a homogeneous medium. However, what it actually does is compute the list of mediums that the plane intersects, and make sure that there's only one element in that list. This does not work for custom medium, which is a single medium which may nevertheless still be inhomogeneous physically. This same issue applies to the validator for plane wave/gaussian beam sources, as well as, in some sense, to the [TFSF validator](def _validate_tfsf_structure_intersections) about structure intersections. I am not sure what's a good way to fix this:
The text was updated successfully, but these errors were encountered: