Skip to content

Commit b531357

Browse files
fix pec frame lengths
1 parent 73629f2 commit b531357

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tidy3d/components/simulation.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5646,16 +5646,12 @@ def _make_pec_frame(self, obj: Union[ModeSource, InternalAbsorber]) -> Structure
56465646
if isinstance(obj, ModeSource):
56475647
axis = obj.injection_axis
56485648
length = obj.frame.length
5649+
if direction == "+":
5650+
span_inds[axis][1] += length - 1
5651+
else:
5652+
span_inds[axis][0] -= length - 1
56495653
else:
56505654
axis = obj.size.index(0.0)
5651-
length = 1
5652-
5653-
if direction == "+":
5654-
span_inds[axis][1] += length - 1
5655-
span_inds[axis][0] -= 1
5656-
else:
5657-
span_inds[axis][1] += 1
5658-
span_inds[axis][0] -= length - 1
56595655

56605656
box_bounds = [
56615657
[

0 commit comments

Comments
 (0)