Skip to content

Commit 5c96f7a

Browse files
Singularity correction at PEC and lossy metal edges
1 parent f494751 commit 5c96f7a

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- `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.
1818
- Added material type `PMCMedium` for perfect magnetic conductor.
1919
- `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.
20+
- Enable singularity correction at PEC and lossy metal edges.
2021

2122
### Changed
2223
- Switched to an analytical gradient calculation for spatially-varying pole-residue models (`CustomPoleResidue`).

tests/test_components/test_simulation.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,27 @@ def test_conformal_dt():
23852385
assert sim_heuristic.dt == dt
23862386

23872387

2388+
def test_edge_correction():
2389+
"""make sure edge correction can be enabled for PEC and lossy meal."""
2390+
sim = td.Simulation(
2391+
size=(2.0, 2.0, 2.0),
2392+
run_time=1e-12,
2393+
structures=[],
2394+
grid_spec=td.GridSpec.uniform(dl=0.1),
2395+
subpixel=td.SubpixelSpec(
2396+
pec=td.PECConformal(edge_singularity_correction=False),
2397+
lossy_metal=td.SurfaceImpedance(edge_singularity_correction=False),
2398+
),
2399+
)
2400+
2401+
sim = sim.updated_copy(
2402+
subpixel=td.SubpixelSpec(
2403+
pec=td.PECConformal(edge_singularity_correction=True),
2404+
lossy_metal=td.SurfaceImpedance(edge_singularity_correction=True),
2405+
)
2406+
)
2407+
2408+
23882409
def test_sim_volumetric_structures(tmp_path):
23892410
"""Test volumetric equivalent of 2D materials."""
23902411
sigma = 0.45

tidy3d/components/subpixel_spec.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ class PECConformal(AbstractSubpixelAveragingMethod):
120120
ge=0,
121121
)
122122

123+
edge_singularity_correction: bool = pd.Field(
124+
False,
125+
title="Apply Singularity Model At Metal Edges",
126+
description="Apply field correction model at metallic edges where field singularity occurs. "
127+
"The edges should be straight, and aligned with the primal grids; and the wedge angle is either "
128+
"0 or 90 degree.",
129+
)
130+
123131
@cached_property
124132
def courant_ratio(self) -> float:
125133
"""The scaling ratio applied to Courant number so that the courant number

0 commit comments

Comments
 (0)