Skip to content

Commit

Permalink
Set minimum PML layers to 6
Browse files Browse the repository at this point in the history
  • Loading branch information
momchil-flex committed Nov 12, 2024
1 parent 9a35483 commit 8c69033
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- `CustomMedium` design regions require far less data when performing inverse design by reducing adjoint field monitor size for dims with one pixel.
- Calling `.values` on `DataArray` no longer raises a `DeprecationWarning` during automatic differentiation
- Calling `.values` on `DataArray` no longer raises a `DeprecationWarning` during automatic differentiation.
- Minimum number of PML layers set to 6.

### Fixed
- Regression in local field projection leading to incorrect results for `far_field_approx=True`.
Expand Down
16 changes: 11 additions & 5 deletions tidy3d/components/boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ class PMLParams(AbsorberParams):
class AbsorberSpec(BoundaryEdge):
"""Specifies the generic absorber properties along a single dimension."""

num_layers: pd.NonNegativeInt = pd.Field(
num_layers: int = pd.Field(
...,
title="Number of Layers",
description="Number of layers of standard PML.",
gt=5,
)
parameters: AbsorberParams = pd.Field(
...,
Expand Down Expand Up @@ -376,10 +377,11 @@ class PML(AbsorberSpec):
"""

num_layers: pd.NonNegativeInt = pd.Field(
num_layers: int = pd.Field(
12,
title="Number of Layers",
description="Number of layers of standard PML.",
gt=5,
)

parameters: PMLParams = pd.Field(
Expand Down Expand Up @@ -413,8 +415,11 @@ class StablePML(AbsorberSpec):
* `Introduction to perfectly matched layer (PML) tutorial <https://www.flexcompute.com/fdtd101/Lecture-6-Introduction-to-perfectly-matched-layer/>`__
"""

num_layers: pd.NonNegativeInt = pd.Field(
40, title="Number of Layers", description="Number of layers of 'stable' PML."
num_layers: int = pd.Field(
40,
title="Number of Layers",
description="Number of layers of 'stable' PML.",
gt=5,
)

parameters: PMLParams = pd.Field(
Expand Down Expand Up @@ -463,10 +468,11 @@ class Absorber(AbsorberSpec):
* `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_
"""

num_layers: pd.NonNegativeInt = pd.Field(
num_layers: int = pd.Field(
40,
title="Number of Layers",
description="Number of layers of absorber to add to + and - boundaries.",
gt=5,
)

parameters: AbsorberParams = pd.Field(
Expand Down

0 comments on commit 8c69033

Please sign in to comment.