Skip to content

Boundaries

A simulation has to end somewhere. What happens at the edge of the grid decides whether the domain behaves like a small piece of open space, a repeating structure or a closed box. Each pair of edges (left/right and top/bottom) can be set separately under Simulation.

The convolutional PML: a graded lossy layer around the physical domain

The default. The domain is surrounded by a perfectly matched layer, so light leaving the domain disappears as if space continued forever.

A plain lossy layer does not work: the sudden change in material reflects light at its surface. A perfectly matched layer is built so that its wave impedance matches free space at every angle and frequency, in the continuous equations at least. PhotonLab uses the convolutional form (CPML, Roden and Gedney, 2000) with the complex-frequency-shifted stretching that also absorbs slowly varying fields.

Its details, in case you want to compare with your own code:

  • thickness: one sixteenth of the grid, between 10 and 20 cells;
  • loss grading σ(d) = σmax · (d/T)4, with σmax = 1.2 × 0.8 · (m + 1) / (η Δx);
  • αmax = 0.05, decreasing linearly into the layer; κ = 1;
  • the magnetic nodes sit half a cell deeper than the electric ones, and their coefficients are evaluated there.

On a 160-cell test grid, reflections from this layer are 87 dB below the incident pulse (see Validation). In the app the layer is drawn hatched. Fields inside it are not physical: do not place probes or sources there.

The left edge continues at the right edge (or the top at the bottom). The domain becomes one period of an infinite repeating structure: a grating, a photonic crystal slab, or simply an infinitely wide plane wave without edge diffraction. Periodic edges have no absorbing layer.

The field is held at zero on the edge. In TM that makes the edge a perfect electric conductor; in TE it makes it a perfect magnetic conductor. Use mirrors on all four sides to build a closed cavity: with no losses inside, its energy stays constant, and the probe spectrum shows the cavity’s resonances.