Skip to content

Commit

Permalink
fix for 2D PEC
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwat-sh authored and momchil-flex committed Nov 22, 2023
1 parent be8d5e7 commit 192c547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `SimulationData.mnt_data_from_file()` method to load only a single monitor data object from a simulation data `.hdf5` file.
- `_hash_self` to base model, uses `hashlib` to hash a Tidy3D component the same way every session.
- `ComponentModeler.plot_sim_eps()` method to plot the simulation permittivity and ports.
- Support for 2D PEC materials.

### Changed
- Indent for the json string of Tidy3D models has been changed to `None` when used internally; kept as `indent=4` for writing to `json` and `yaml` files.
Expand All @@ -30,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Restrict to `matplotlib` >= 3.5, avoiding bug in plotting `CustomMedium`.
- Fixes `ComponentModeler` batch file being different in different sessions by use of deterministic hash function for computing batch filename.
- Can pass `kwargs` to `ComponentModeler.plot_sim()` to use in `Simulation.plot()`.
- Fixed a couple bugs in the handling of 2D PEC materials.


## [2.5.0rc2] - 2023-10-30

Expand Down
6 changes: 5 additions & 1 deletion tidy3d/components/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,11 @@ def get_neighboring_media(
# get neighboring media and grid sizes
(neighbors, dls) = get_neighboring_media(geometry, axis, background_structures)

new_bounds = (center - dls[0] / 2, center + dls[1] / 2)
if not structure.medium.is_pec:
new_bounds = (center - dls[0] / 2, center + dls[1] / 2)
else:
new_bounds = (center, center)

new_geometry = set_bounds(structure.geometry, bounds=new_bounds, axis=axis)

new_medium = structure.medium.volumetric_equivalent(
Expand Down

0 comments on commit 192c547

Please sign in to comment.