Applied electromagnetic optics simulations for nanophotonics