two things to be noted:
1: for periodic simulation, only grating analysis is accurate. even the fields at the periodic boundary happen to be zero, the farfield projection will NOT consider the periodic behavior of the device and thus it is NOT correct. The visualizer with some specified perioids is only for rough check to see diffraciton phenomenon, not for final quantified result.
2: material overlap at the boundary is ok, provided that after meshing it is still periodix discretely.