Skip to content

Commit

Permalink
cast mode solver jacobians to real to avoid div by 0 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerflex committed Feb 23, 2023
1 parent 9e228df commit 7926cec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Progressbars always set to 100% when webapi functions are finished.
- Faster handling of `Geometry.intersects` and `Geometry.inside` by taking into account geometry bounds.
- Numpy divide by zero warning in mode solver fixed by initializing jacobians as real instead of complex.


## [1.9.0rc2] - 2023-2-17
Expand Down
4 changes: 2 additions & 2 deletions tidy3d/plugins/mode/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def compute_modes(
mu_tensor[dim, dim, :] = 1.0

# Get Jacobian of all coordinate transformations. Initialize as identity (same as mu so far)
jac_e = np.copy(mu_tensor)
jac_h = np.copy(mu_tensor)
jac_e = np.real(np.copy(mu_tensor))
jac_h = np.real(np.copy(mu_tensor))

if bend_radius is not None:
new_coords, jac_e, jac_h = radial_transform(new_coords, bend_radius, bend_axis)
Expand Down

0 comments on commit 7926cec

Please sign in to comment.