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

Allow MeshOverrideStructure to unshadow structures in overlapping region #2181

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

weiliangjin2021
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 commented Jan 17, 2025

Related to @lucas-flexcompute 's comment on #2113

When we automatically add mesh override structure that has the same geometry as regular structure, we don't want it to shadow physical structures if the physical structure sets a smaller grid size.

With shadow=False, we drop the logic for checking if the override structure is covered or covering other structures.

@weiliangjin2021
Copy link
Collaborator Author

weiliangjin2021 commented Jan 17, 2025

Here is an example:
image

There is a high-index box in the simulation domain. When we add a mesh override structure of larger grid size and of the same geometry, previous behavior is that this larger grid size is applied because it completely covers the physical structure, as illustrated in the middle figure.

Now with shadow=False, the smallest grid size is applied in this region (rightmost figure).

Copy link
Collaborator

@lucas-flexcompute lucas-flexcompute 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 in general, but just for me to understand: Does the shadow==False setting only take effect when the previous structure is completely inside the override, or does it work for partial intersections too? The documentation in the field description seems to imply intersections are supported, but the docs in the test function says otherwise.

@weiliangjin2021
Copy link
Collaborator Author

Looks good in general, but just for me to understand: Does the shadow==False setting only take effect when the previous structure is completely inside the override, or does it work for partial intersections too? The documentation in the field description seems to imply intersections are supported, but the docs in the test function says otherwise.

For partial intersection, it's already smaller grid size takes effect.

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, but just wondering what is the use case exactly? In your example, it is basically going to be a case where I don't really know or want to think about whether the physical structure has high or low index? So I use the override structure to set a minimum step, but if it needs to be even lower than that I allow it?

@lucas-flexcompute
Copy link
Collaborator

I think the original use case is in RF simulations. We will use layer refinement to set the grid and those are implemented through override structures. Because they are created automatically, I asked Weiliang what would happen in partial and integral intersections. (I ended up sorting my layer refinements by size, so it wouldn't be a problem anyway, but applying the smallest grid step regardless of sorting makes sense for users from other tools, doesn't it?)

@momchil-flex
Copy link
Collaborator

Yeah, it's just that in the example above, one could just remove the OverrideStructure, but I see the value of not having to manually think about it in some general cases.

@weiliangjin2021
Copy link
Collaborator Author

In your example, it is basically going to be a case where I don't really know or want to think about whether the physical structure has high or low index? So I use the override structure to set a minimum step, but if it needs to be even lower than that I allow it?

That's right. Let's say you have a layered structure, and you want to make sure that there are at least 5 grid points to resolve the layer thickness. The layer consist of many physical structures, so you don't really know grid size from min_steps_per_wvl until you processed all the structures where structure overlapping is figured out You might have a very high-index material but it can be entirely covered by other structures so it doesn't appear in the final structure. So it's hard to know if your MeshOverrideStructure is decreasing grid size, or the other way.

@weiliangjin2021 weiliangjin2021 merged commit 92b8a87 into pre/2.8 Jan 20, 2025
15 checks passed
@weiliangjin2021 weiliangjin2021 deleted the weiliang/override branch January 20, 2025 17:51
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.

3 participants