Modal analysis of stacked gratings using B-splines basis