This document aims at presenting both theoretical and practical aspects of
the grating_2D Onelab model (available at
http://onelab.info/wiki/Diffraction_grating). This model applies to so-called
mono-dimensional grating, i.e. structures having one direction of invariance.
Various geometries and materials can be handled or easily added. The two
classical polarization cases, denoted here E// and H//, are addressed. The
output consists in a full energy balance of the problem computed from the field
maps. This model is based on free the GNU softwares Gmsh, GetDP and their
interface Onelab.Comment: arXiv admin note: text overlap with arXiv:1302.103