Computational Efficient Solution of Maxwell's Equations for Lamellar Gratings