Advanced Computational Electromagnetics for Metasurfaces