Recent advances in nanotechnology of optical components allows for manufacturing of aperiodical structures patterned on a subwavelength scale that have macroscopic dimension of several hundreds or thousands wavelengths. A typical example is the so-called Cavity resonator integrated grating filter (CRIGF) that uses a resonant excitation of a waveguide mode by a dielectric grating, which is put in a box consisting of two Bragg guided wave mirrors, in order to obtain a narrow-band spectral filtering that is characterized by extraordinary large angular tolerances, i.e., almost flat spectral dispersion curves. These filers present a true challenge to computational electromagnetism, because of their large dimensions and fine pattering, but also because of their resonant nature. We have developed three different computational techniques to tackle CRIGFs, based on three independent rigorous electromagnetic theories: the Fourier modal method (FMM, also known as Rigorous coupled wave theory), the Finite element method (FEM), and the Discrete Dipole Approximation (DDA). In the case of two-dimensional structures (invariant in one direction), composed of three classical gratings, the middle one used for the resonance filtering, and the two adjacent ones serving as Bragg mirrors, the three methods provide numerical results that are almost identical, despite the fact that one of the method works in the Fourier space, while the other two — in the real space. Both FMM and FEM require adding perfectly matched or/and absorbing layers for quite different reasons, for FMM they are necessary in order to eliminate the coupling between the horizontal periodical supercells that exist due to the discrete Fourier representation, while FEM introduces them in order to limit the structure dimensions in the vertical direction. Because of the explicit three-dimensional formulation of DDA, even for structures invariant in one direction, this method uses a three-dimensional model by limiting the “invariant” dimension to several tens of wavelengths, which increases the computation time compared to the other methods for two-dimensional geometry. However, the DDA proves to be quite suitable to model three-dimensional structures, being the only existing rigorous electromagnetic method capable for this.