Calculation of bending losses in dielectric waveguides using eigenmode expansion and perfectly matched layers