-
Notifications
You must be signed in to change notification settings - Fork 64
Implement automatic structure extrusion for boundary waveports #2793
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 2 comments
f844379
to
8fcbe0b
Compare
afc9622
to
6ecc0eb
Compare
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/components/simulation.pyLines 5712-5720 5712 length = obj.frame.length
5713 if direction == "+":
5714 span_inds[axis][1] += length - 1
5715 else:
! 5716 span_inds[axis][0] -= length - 1
5717 else:
5718 axis = obj.size.index(0.0)
5719
5720 box_bounds = [ |
a469ec2
to
f1007a7
Compare
67a0ba1
to
102b073
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, a couple of comments + let's add an example where a waveguide assembly contains a geometry which is a union of two disjoint objects (something like GeometryGroup(geometries=[box_left, box_right])
, like a differential strip
7e11342
to
0d3abc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looking like a good feature, just a couple of minor style comments.
66fe302
to
c01d9fa
Compare
c01d9fa
to
156ae24
Compare
This PR adds automatic extrusion of structures intersecting waveports that are placed on boundaries.
Key changes:
This improves simulation accuracy when waveports are located on structure boundaries and simplifies user workflow.
Greptile Summary
Updated On: 2025-09-04 15:39:10 UTC
This PR implements automatic structure extrusion for waveports positioned on simulation boundaries. The main functionality adds a new
extrude_structures
boolean field to theWavePort
class that, when set toTrue
, triggers automatic extension of intersecting structures to ensure mode sources, internal absorbers, and PEC frames are fully contained within the material geometry.The core implementation resides in the
TerminalComponentModeler
class with the addition of a new_extrude_port_structures
method that performs the geometric operations. This method identifies structures intersecting the waveport plane and creates extendedPolySlab
geometries that stretch from the port location to cover all necessary simulation components. The extrusion logic handles complex geometries with holes usingClipOperation
and integrates seamlessly into the existing simulation pipeline.This feature addresses a common simulation accuracy issue where waveports placed directly on structure boundaries might not provide adequate material coverage for electromagnetic field calculations. By automating the extrusion process, the PR simplifies user workflow while ensuring proper containment of all port-related simulation elements.
Important Files Changed
Changed Files
Confidence score: 3/5
_extrude_port_structures
methodSequence Diagram