-
Notifications
You must be signed in to change notification settings - Fork 44
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
Field projection monitor intersects structures outside of the simulation domain and still causes error #1902
Comments
@QimingFlex could you take this? |
Will work on it shortly. |
In theory, a 2-D simulation represents an infinitely extended system along the 0-dim. Currently in Tidy3D, if we ensure that both the monitor and geometry sizes along the 0-dim are set to |
Thanks @QimingFlex . I think it's a good idea but has some practical complications. First issue is it will break some backward compatibility. Users who set an arbitrary value for length in 2D simulation will error if we implement this. More importantly it might not work in some cases. For example if user creates a box using the from_bounds method, they can not directly set the size to td.inf. For PolySlab I don't know if it's possible to set the min and max to td.inf either. |
Thanks @tomflexcompute ! I was also puzzled by |
Yeah @QimingFlex in many cases we have to sacrifice defining things "rigorously" for the convenience of the user. In this particular case, and in general, only structures defined withing the simulation domain matter, for convenience things that lie outside of it can be whatever and we still handle it well. For example, think again of the grating coupler example where a user may be able to easily switch between a 2D and a 3D simulation. It is very convenient to be able to use the same structures and just change the size of the simulation domain, and everything just works. Thus for this issue we should just fix the validator to maybe first take the intersection of the field projection monitor with the simulation domain, before doing the homogeneous medium check. |
Thanks @momchil-flex. The grating coupler is a good example of such implementation. The validator basically checks if the monitor intersects with any structures, and won't raise an error if the monitor size along the 0-dim is larger than the structure. I think we can ignore the size along the 0-dimn for that intersection check. |
Field projection monitors such as
FieldProjectionAngleMonitor
can not intersect any structures whose medium is not background. Currently the validator seems to check outside of the simulation domain as well. For example, in a 2D simulation, I can have a cylinder of length 2 in the direction where the simulation domain has 0 size. Then if I have a 3D field projection monitor that intersects the cylinder at z=0.5, it will cause an error.I think this error should be avoided since there is no intersection in the simulation domain and thus the result should still be correct.
The text was updated successfully, but these errors were encountered: