The diffraction grating problem is modeled by a boundary value problem governed by a Helmholtz equation with transparent boundary conditions. An a posteriori error estimate is derived when the truncation of the nonlocal boundary operators takes place. To overcome the difficulty caused by the fact that the truncated Dirichlet-to-Neumann (DtN) mapping does… (More)