Implement Bloch periodic boundary conditions
masterWhen simulating waves with angled incidence in a periodic domain, standard periodic boundary conditions will cause discontinuities at the boundaries. To simulate a plane wave that correctly wraps around the boundary with a phase shift, use the bloch_phases argument in fdfd_hz.
To implement this, calculate the phase shift required for the $y$-direction based on the wave vector component $k_y$ and the total length of the domain $L_y$: $\text{phase} = k_y \times L_y$.
# ky is the y-component of the wave vector
# Ly is the total length of the simulation in the y direction
F_Bloch = fdfd_hz(omega, dL, eps_r, npml, bloch_phases=[0, ky * Ly])
# Solve with the Bloch-enabled object
Ex, Ey, Hz = F_Bloch.solve(source_angle)