Bragg grating
2D FDTD of a sidewall-corrugated Bragg grating, PSFDTD against Meep
A 500 nm guide with 50 nm sidewall corrugations on both sides, 300 nm period, 100 periods, in a 2D effective-index model, over 1450–1650 nm.
Setup
220 nm silicon strip (n = 3.476) fully clad in SiO₂ (n = 1.444), both non-dispersive, 500 nm wide access guides, TE0 launched by a mode source, 1500–1600 nm from one Gaussian-pulse run. Both solvers read the same polygon list and port planes from bench/devices.py, use a uniform grid of the same step with sub-pixel smoothing, and report TE0 mode-overlap power at each output divided by the forward TE0 power at a monitor just after the source.
Two-dimensional top view, Hz polarisation, core index 2.848 (the slab's TE effective index), domain 36 × 3.5 µm plus PML.

Spectrum
Stop band
Wavelength and depth of the transmission minimum and the peak TE0 reflection at each grid. The spectrum is sampled every 0.5 nm; the corrugation is 50 nm deep, i.e. 1.25 to 10 cells on these grids, so the stop band position is a direct test of how each solver smooths sub-cell features.
| Solver | Cells per µm | λ of minimum T (nm) | Minimum T | Peak R |
|---|---|---|---|---|
| PSFDTD | 25 | 1535.1 | 0.4877 | 0.5108 |
| PSFDTD | 50 | 1529.7 | 0.4590 | 0.5396 |
| PSFDTD | 100 | 1528.3 | 0.5019 | 0.4967 |
| PSFDTD | 200 | 1527.3 | 0.5500 | 0.4485 |
| Meep | 25 | 1539.1 | 0.3353 | 0.5587 |
| Meep | 50 | 1529.7 | 0.5332 | 0.4457 |
Runtime
| Solver | Cells per µm | Grid | Stepped cells (M) | Steps | Time stepping | Mcells·steps/s |
|---|---|---|---|---|---|---|
| PSFDTD | 25 | 932×120×1 | 0.11 | 89537 | 8.4 s | 1198 |
| PSFDTD | 50 | 1832×207×1 | 0.38 | 178563 | 6.1 s | 11140 |
| PSFDTD | 100 | 3632×382×1 | 1.39 | 357125 | 15.8 s | 31392 |
| PSFDTD | 200 | 7232×732×1 | 5.29 | 714250 | 154 s | 24587 |
| Meep | 25 | 950×138×1 | 0.13 | 125000 | 138 s ⁎ | 120 ⁎ |
| Meep | 50 | 1900×275×1 | 0.52 | 250000 | 25.1 min ⁎ | 87 ⁎ |
PSFDTD: NVIDIA RTX 4090 (single precision); its grid column includes the PML cells. Meep 1.33.0: one core of an AMD Ryzen 9 9950X under WSL2 (the conda build has no MPI), double precision; in 3D it uses the z mirror plane, so it steps half the grid shown. Times are time stepping only, without mesh generation, mode solving or post-processing. The Meep runs themselves shared the machine with other jobs, so their wall times are not used: each Meep time is the stepping rate of that case measured alone on an idle machine (300 steps, all monitors active) multiplied by the run's step count. Rows marked ⁎ have no idle-machine rate and show the contended wall time, which overstates Meep's cost.
Reproduce
# device specs
python bench/devices.py bench/work/specs
# PSFDTD (Windows, GPU): device, cells per µm
python bench/run_psfdtd.py bench/work/specs/bragg.json 40 bench/work/psfdtd/bragg_res40 --field
# Meep (WSL, micromamba env with pymeep)
bash bench/meep.sh bragg 25