Skip to content

Commit 74f402e

Browse files
dmarek-flexyaugenst-flex
authored andcommitted
fix bug when inserting snapping points near sim min boundary
1 parent 8a3720d commit 74f402e

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
### Fixed
2121
- Fixed bug in broadband adjoint source creation when forward simulation had a pulse amplitude greater than 1 or a nonzero pulse phase.
2222
- Fixed shaping of `CustomMedium` gradients when permittivity data includes a frequency dimension with multiple entries.
23+
- Bug when generating a grid with snapping points near the simulation boundaries.
2324

2425
### Changed
2526
- Relaxed bounds checking of path integrals during `WavePort` validation.

tests/test_components/test_grid_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_make_coords_with_snapping_points():
8383
# 3) snapping takes no effect if it's too close to interval boundaries
8484
# forming the simulation boundary
8585
coord = gs.grid_x.make_coords(
86-
snapping_points=((0.98, 0, 0),),
86+
snapping_points=((0.98, 0, 0), (-0.98, 0, 0)),
8787
**make_coords_args,
8888
)
8989
assert np.allclose(coord_original, coord)

tidy3d/components/grid/mesher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def insert_snapping_points(
160160
# give priority to the snapping_point and replace
161161
elif d_1 < min_step:
162162
# Don't replace if the boundary is the simulation boundary
163-
if ind == 0:
163+
if ind == 1:
164164
continue
165165
interval_coords[ind - 1] = new_coord
166166
continue

0 commit comments

Comments
 (0)