



Include "waveguide2D.dat";

// Defining points of the geometry
p[] += newp; Point(newp) = {0,0,0,res};             //p[0]
p[] += newp; Point(newp) = {L/2 - Lx/2,0,0,res};	//p[1]
p[] += newp; Point(newp) = {L/2 - Lx/2,Ly,0,res};	//p[2]
p[] += newp; Point(newp) = {L/2 + Lx/2,Ly,0,res};	//p[3]
p[] += newp; Point(newp) = {L/2 + Lx/2,0,0,res};	//p[4]
p[] += newp ; Point(newp) = { L, 0, 0, res} ;		//p[5]
p[] += newp ; Point(newp) = { L, W, 0, res} ;		//p[6]
p[] += newp ; Point(newp) = { 0, W, 0, res} ;		//p[7]

// Defining lines of the geometry

l[] += newl ; Line(newl) = {p[0], p[1]} ;	//l[0]
l[] += newl ; Line(newl) = {p[1], p[2]} ;	//l[1]
l[] += newl ; Line(newl) = {p[2], p[3]} ;	//l[2]
l[] += newl ; Line(newl) = {p[3], p[4]} ;	//l[3]
l[] += newl ; Line(newl) = {p[4], p[5]} ;	//l[4]
l[] += newl ; Line(newl) = {p[5], p[6]} ;	//l[5]
l[] += newl ; Line(newl) = {p[6], p[7]} ;	//l[6]
l[] += newl ; Line(newl) = {p[7], p[0]} ;	//l[7]
l[] += newl ; Line(newl) = {p[1], p[4]} ;   //l[8]

// Defining line loops

ll[] += newll ; Line Loop(newll) = {l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7]};   //ll[0] Air
ll[] += newll ; Line Loop(newll) = {-l[1],-l[2],-l[3],l[8]};					//ll[1] Dieletric

// Defining surfaces
s[] += news ; Plane Surface(news) = {ll[0]};
s[] += news ; Plane Surface(news) = {ll[1]};

//Defining physical tag

Physical Line(BND_PEC) 	  = {l[0],l[4],l[6]};
Physical Line(BND_PORT_1) = {l[7]};
Physical Line(BND_PORT_2) = {l[5]};
Physical Surface(DOM_AIR) = {s[0]};
Physical Surface(DOM_DIEL)= {s[1]};