Skip to content

Commit 791072b

Browse files
committed
Fix bug when symmetry + non-symmetric boundary conditions are defined
1 parent cfff229 commit 791072b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tidy3d/components/grid/grid_spec.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,19 @@ def make_coords(
9090
)
9191

9292
# incorporate symmetries
93+
n_pml = list(num_pml_layers)
9394
if symmetry[axis] != 0:
9495
# Offset to center if symmetry present
9596
center = structures[0].geometry.center[axis]
9697
center_ind = np.argmin(np.abs(center - bound_coords))
9798
bound_coords += center - bound_coords[center_ind]
9899
bound_coords = bound_coords[bound_coords >= center]
99100
bound_coords = np.append(2 * center - bound_coords[:0:-1], bound_coords)
101+
# Apply PMLs on the - side as they are defined on the + side
102+
n_pml[0] = n_pml[1]
100103

101104
# Add PML layers in using dl on edges
102-
bound_coords = self._add_pml_to_bounds(num_pml_layers, bound_coords)
105+
bound_coords = self._add_pml_to_bounds(n_pml, bound_coords)
103106
return bound_coords
104107

105108
@abstractmethod

0 commit comments

Comments
 (0)