pyoptics.fdtd.boundaries¶
Boundary conditions: convolutional PML, PEC walls and periodicity.
The convolutional perfectly matched layer (CPML, Roden and Gedney 2000) stretches the coordinate across the absorbing layer with s(d) = kappa(d) + sigma(d)/(alpha(d) - i*omega), graded polynomially from the inner edge (d = 0) to the outer wall (d = 1). Each spatial derivative inside the layer becomes dF/dx/kappa + psi, with the recursive convolution psi <- b*psi + c*dF/dx. The layer is matched for any medium that extends into it, and its outer wall is a PEC.
Classes
Absorbing layer of the given number of cells on both ends of an axis. |
Functions
Normalize a boundary spec to one entry (PML, "pec" or "periodic") per axis. |
- class pyoptics.fdtd.boundaries.PML(cells=12, order=3, reflection=1e-08, kappa_max=1.0, alpha_max=0.0)[source]¶
Bases:
objectAbsorbing layer of the given number of cells on both ends of an axis.
- Parameters:
- cellsint
Thickness in cells.
- ordernumber
Polynomial grading order m of sigma and kappa.
- reflectionnumber
Theoretical reflection R0 at normal incidence; sets sigma_max = -(m + 1)*ln(R0)/(2*thickness).
- kappa_maxnumber
Maximum real coordinate stretch (>= 1); > 1 helps with evanescent and grazing waves.
- alpha_maxnumber
Complex frequency shift at the inner edge (in units of 1/time, decreasing linearly to 0 at the wall); absorbs low frequencies less and so avoids late-time drift for long runs.