Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Simulation.precision` option allows to select `"double"` precision for very high-accuracy results. Note that this is very rarely needed, and doubles the simulation computational weight and correpsondingly FlexCredit cost.
- Added material type `PMCMedium` for perfect magnetic conductor.
- `ModeSimulation.plot()` method that plots the mode simulation plane by default, or the containing FDTD simulation if any of ``x``, ``y``, or ``z`` is passed.
- Enable singularity correction at PEC and lossy metal edges.

### Changed
- Switched to an analytical gradient calculation for spatially-varying pole-residue models (`CustomPoleResidue`).
Expand Down
21 changes: 21 additions & 0 deletions tests/test_components/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2385,6 +2385,27 @@ def test_conformal_dt():
assert sim_heuristic.dt == dt


def test_edge_correction():
"""make sure edge correction can be enabled for PEC and lossy meal."""
sim = td.Simulation(
size=(2.0, 2.0, 2.0),
run_time=1e-12,
structures=[],
grid_spec=td.GridSpec.uniform(dl=0.1),
subpixel=td.SubpixelSpec(
pec=td.PECConformal(edge_singularity_correction=False),
lossy_metal=td.SurfaceImpedance(edge_singularity_correction=False),
),
)

sim = sim.updated_copy(
subpixel=td.SubpixelSpec(
pec=td.PECConformal(edge_singularity_correction=True),
lossy_metal=td.SurfaceImpedance(edge_singularity_correction=True),
)
)


def test_sim_volumetric_structures(tmp_path):
"""Test volumetric equivalent of 2D materials."""
sigma = 0.45
Expand Down
8 changes: 8 additions & 0 deletions tidy3d/components/subpixel_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ class PECConformal(AbstractSubpixelAveragingMethod):
ge=0,
)

edge_singularity_correction: bool = pd.Field(
False,
title="Apply Singularity Model At Metal Edges",
description="Apply field correction model at metallic edges where field singularity occurs. "
"The edges should be straight, and aligned with the primal grids; and the wedge angle is either "
"0 or 90 degree.",
)

@cached_property
def courant_ratio(self) -> float:
"""The scaling ratio applied to Courant number so that the courant number
Expand Down
Loading