Scheme. Maxwell's curl equations on a staggered Yee grid, leapfrog in time, cΔt = 0.5·min(Δx,Δy) (2D stability limit 1/√(1/Δx²+1/Δy²)).
Polarisations. TM: Ez, Hx, Hy (E out of plane, s). TE: Hz, Ex, Ey (E in plane, p). The map shows the out-of-plane component.
Boundaries. Berenger split-field PML (cubic grading, R = 10⁻⁶) in x, and in y either PML (open) or periodic (infinite array, normal incidence).
Materials. Complex index n + iκ at λ₀ → εr = n² − κ², σ = ωε₀·2nκ (κ < n). Metals are perfect conductors. No dispersion.
Spectra. A Gaussian pulse covering λmin–λmax is run twice: a reference without the device and a run with it. Running DFTs of E and H on the R and T monitor lines give the Poynting flux P(ω) = ½Re∫E×H*·x̂ dy, so T = PT/Pinc, R = (Pinc − PR)/Pinc, A = 1 − R − T. Each run stops when the field has decayed.
Accuracy. Keep ≥ 10–15 cells per wavelength inside the densest material at the shortest wavelength of interest.