nm = 1.;
lambda0    = 700*nm;
n_hol  = 1;
n_sup  = 1;
n_sub  = 1;
paramaille     = 10;
paramaille_pml = 10;
paramaille_hol = 10;
lc_sup     = lambda0/(paramaille*n_sup);
lc_sup_pml = lambda0/(paramaille_pml*n_sup);
lc_sub     = lambda0/(paramaille*n_sub);
lc_sub_pml = lambda0/(paramaille_pml*n_sub);
lc_hol     = lambda0/(paramaille_hol*n_hol);

period_x = 300*nm;
period_y = 300*nm;
h_sup    = 400*nm;
h_hol    = 150*nm;
h_sub    = 200*nm;
PML_bot  = 500*nm;
PML_top  = 500*nm;
d_hol    = 100*nm;

Point(1) = {-period_x/2,-period_y/2, -h_sub, lc_sub};
Point(2) = {-period_x/2, period_y/2, -h_sub, lc_sub};
Point(3) = {-period_x/2, period_y/2, h_hol+h_sup, lc_sup};
Point(4) = {-period_x/2,-period_y/2, h_hol+h_sup, lc_sup};

Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};


Line Loop(29) = {4, 1, 2, 3};
Plane Surface(30) = {29};


Extrude {period_x, 0, 0} {
                            Surface{30}; Layers{1};
                         }
                         
Delete {
  Volume{1};
  Surface{47,51,43,39};
  Line{37,38,42,46};
}
Line(40) = {1, 6};
Line(41) = {4, 5};

Line Loop(53) = {40, -32, -41, 4};
Ruled Surface(54) = {53};

Extrude {0, period_y, 0} {
                             Surface{54}; Layers{1};
                          }
