The Yee scheme staggers electric and magnetic fields in space and time. Each curl is evaluated at the position of the field it updates.
A staggered grid
On a uniform Cartesian grid, one common indexing convention is:
Component
Position in grid units
Time
Ex
(i+21,j,k)
nΔt
Ey
(i,j+21,k)
nΔt
Ez
(i,j,k+21)
nΔt
Hx
(i,j+21,k+21)
(n+21)Δt
Hy
(i+21,j,k+21)
(n+21)Δt
Hz
(i+21,j+21,k)
(n+21)Δt
Electric components lie along cell edges; magnetic components lie at face centers. Translating the entire lattice gives equivalent conventions. BeamZ uses component-specific Yee supports; arrays for different components need not have identical shapes.
Staggering makes a centered derivative local. For example,
Both samples are half a cell from the evaluation point. In smooth media this derivative has second-order spatial accuracy. The staggered construction originates in Yee’s 1966 paper.
From derivatives to updates
Let ∇h× denote the discrete curl. Centering the time derivatives in the two evolution equations, first in a lossless medium, gives
Evaluate coefficients at the component being updated. Advance H and its corrections, then E and its corrections. For scalar nondispersive materials, this leapfrog requires no global linear solve.
A complete two dimensional example
For fields invariant along z, the TMz system contains Ez,Hx,Hy. Choose Ez at (i,j), Hx at (i,j+1/2), and Hy at (i+1/2,j). For a source-free, lossless interior:
The subscripts on εz,μx,μy identify the field supports. Even an isotropic material may have different effective coefficients on these supports at an interface. The complementary TEz system contains Hz,Ex,Ey; neither reduced system describes arbitrary three dimensional polarization coupling.
Conductivity
Center the Ohmic term at the midpoint using (En+1+En)/2. Rearranging gives
Setting σ=0 recovers the lossless update. BeamZ precomputes these decay and curl coefficients. CPML introduces additional derivative corrections, described on the CPML page.
Stability and resolution
For the standard explicit Yee scheme with positive scalar, nondispersive materials on a uniform grid, the Courant limit is
Δt≤vmaxΔx−2+Δy−2+Δz−21.
Omit invariant directions in one or two dimensions. With equal spacing h in d dimensions, Δt≤h/(vmaxd). Use the fastest material wave speed in the domain, not the slower speed in a high-index core. A Courant factor below one provides margin.
Stability does not guarantee accuracy: numerical phase velocity depends on wavelength and direction. Resolve the shortest material wavelength and refine until the measured quantity converges. Interfaces can reduce convergence order.
BeamZ also supports rectilinear graded grids. There the derivatives use local edge or center distances and the solver computes a corresponding stability bound; replacing all those distances by an average spacing is incorrect.