  This document aims at presenting both theoretical and practical aspects of
the grating2D.pro and grating3D.pro [1] ONELAB [2] models. The 2D model
grating2D.pro applies to so-called mono-dimensional gratings, i.e. structures
having one direction of invariance. Various geometries and materials can be
handled or easily added. The two classical scalar polarization cases, denoted
here E// and H//, are addressed as well as the conical vector case. The output
consists in a full energy balance of the problem computed from the field maps.
The 3D vector model grating3D.pro applies to crossed-gratings. These models are
based on free the open source software Gmsh, GetDP and their interface ONELAB.
  [1] https://gitlab.onelab.info/doc/models/-/wikis/Diffraction-gratings
  [2] https://onelab.info
