// This code was created by pygmsh v6.0.2.
SetFactory("OpenCASCADE");
Include "parameters.dat";
lc_des = lambda0/(Sqrt[eps_des_re]*parmesh_des);
lc_host = lambda0/(Sqrt[eps_host_re]*parmesh);
lc_pml = lambda0/(Sqrt[eps_host_re]*parmesh_pml);
lc_sph = lambda0/(Sqrt[eps_sph_re]*parmesh_incl);
s145 = news;
Rectangle(s145) = {-hx_des/2, -hy_des/2, -hz_des/2, hx_des, hy_des};
pts_s145[] = PointsOf{Surface{s145};};
Characteristic Length{pts_s145[]} = lc_des;
ex1[] = Extrude {0,0,hz_des} {Surface{s145};};
s146 = news;
Rectangle(s146) = {-hx_box/2, -hy_box/2, -hz_box/2, hx_box, hy_box};
pts_s146[] = PointsOf{Surface{s146};};
Characteristic Length{pts_s146[]} = lc_host;
ex2[] = Extrude {0,0,hz_box} {Surface{s146};};
s147 = news;
Rectangle(s147) = {-h_pml-hx_box/2, -h_pml-hy_box/2, -h_pml-hz_box/2, h_pml, h_pml};
pts_s147[] = PointsOf{Surface{s147};};
Characteristic Length{pts_s147[]} = lc_pml;
ex3[] = Extrude {0,0,h_pml} {Surface{s147};};
s148 = news;
Rectangle(s148) = {-h_pml-hx_box/2, -h_pml-hy_box/2, -hz_box/2, h_pml, h_pml};
pts_s148[] = PointsOf{Surface{s148};};
Characteristic Length{pts_s148[]} = lc_pml;
ex4[] = Extrude {0,0,hz_box} {Surface{s148};};
s149 = news;
Rectangle(s149) = {-h_pml-hx_box/2, -h_pml-hy_box/2, hz_box/2, h_pml, h_pml};
pts_s149[] = PointsOf{Surface{s149};};
Characteristic Length{pts_s149[]} = lc_pml;
ex5[] = Extrude {0,0,h_pml} {Surface{s149};};
s150 = news;
Rectangle(s150) = {hx_box/2, -h_pml-hy_box/2, -h_pml-hz_box/2, h_pml, h_pml};
pts_s150[] = PointsOf{Surface{s150};};
Characteristic Length{pts_s150[]} = lc_pml;
ex6[] = Extrude {0,0,h_pml} {Surface{s150};};
s151 = news;
Rectangle(s151) = {hx_box/2, -h_pml-hy_box/2, -hz_box/2, h_pml, h_pml};
pts_s151[] = PointsOf{Surface{s151};};
Characteristic Length{pts_s151[]} = lc_pml;
ex7[] = Extrude {0,0,hz_box} {Surface{s151};};
s152 = news;
Rectangle(s152) = {hx_box/2, -h_pml-hy_box/2, hz_box/2, h_pml, h_pml};
pts_s152[] = PointsOf{Surface{s152};};
Characteristic Length{pts_s152[]} = lc_pml;
ex8[] = Extrude {0,0,h_pml} {Surface{s152};};
s153 = news;
Rectangle(s153) = {-h_pml-hx_box/2, hy_box/2, -h_pml-hz_box/2, h_pml, h_pml};
pts_s153[] = PointsOf{Surface{s153};};
Characteristic Length{pts_s153[]} = lc_pml;
ex9[] = Extrude {0,0,h_pml} {Surface{s153};};
s154 = news;
Rectangle(s154) = {-h_pml-hx_box/2, hy_box/2, -hz_box/2, h_pml, h_pml};
pts_s154[] = PointsOf{Surface{s154};};
Characteristic Length{pts_s154[]} = lc_pml;
ex10[] = Extrude {0,0,hz_box} {Surface{s154};};
s155 = news;
Rectangle(s155) = {-h_pml-hx_box/2, hy_box/2, hz_box/2, h_pml, h_pml};
pts_s155[] = PointsOf{Surface{s155};};
Characteristic Length{pts_s155[]} = lc_pml;
ex11[] = Extrude {0,0,h_pml} {Surface{s155};};
s156 = news;
Rectangle(s156) = {hx_box/2, hy_box/2, -h_pml-hz_box/2, h_pml, h_pml};
pts_s156[] = PointsOf{Surface{s156};};
Characteristic Length{pts_s156[]} = lc_pml;
ex12[] = Extrude {0,0,h_pml} {Surface{s156};};
s157 = news;
Rectangle(s157) = {hx_box/2, hy_box/2, -hz_box/2, h_pml, h_pml};
pts_s157[] = PointsOf{Surface{s157};};
Characteristic Length{pts_s157[]} = lc_pml;
ex13[] = Extrude {0,0,hz_box} {Surface{s157};};
s158 = news;
Rectangle(s158) = {hx_box/2, hy_box/2, hz_box/2, h_pml, h_pml};
pts_s158[] = PointsOf{Surface{s158};};
Characteristic Length{pts_s158[]} = lc_pml;
ex14[] = Extrude {0,0,h_pml} {Surface{s158};};
s159 = news;
Rectangle(s159) = {-hx_box/2, -h_pml-hy_box/2, -h_pml-hz_box/2, hx_box, h_pml};
pts_s159[] = PointsOf{Surface{s159};};
Characteristic Length{pts_s159[]} = lc_pml;
ex15[] = Extrude {0,0,h_pml} {Surface{s159};};
s160 = news;
Rectangle(s160) = {-hx_box/2, -h_pml-hy_box/2, -hz_box/2, hx_box, h_pml};
pts_s160[] = PointsOf{Surface{s160};};
Characteristic Length{pts_s160[]} = lc_pml;
ex16[] = Extrude {0,0,hz_box} {Surface{s160};};
s161 = news;
Rectangle(s161) = {-hx_box/2, -h_pml-hy_box/2, hz_box/2, hx_box, h_pml};
pts_s161[] = PointsOf{Surface{s161};};
Characteristic Length{pts_s161[]} = lc_pml;
ex17[] = Extrude {0,0,h_pml} {Surface{s161};};
s162 = news;
Rectangle(s162) = {-hx_box/2, hy_box/2, -h_pml-hz_box/2, hx_box, h_pml};
pts_s162[] = PointsOf{Surface{s162};};
Characteristic Length{pts_s162[]} = lc_pml;
ex18[] = Extrude {0,0,h_pml} {Surface{s162};};
s163 = news;
Rectangle(s163) = {-hx_box/2, hy_box/2, -hz_box/2, hx_box, h_pml};
pts_s163[] = PointsOf{Surface{s163};};
Characteristic Length{pts_s163[]} = lc_pml;
ex19[] = Extrude {0,0,hz_box} {Surface{s163};};
s164 = news;
Rectangle(s164) = {-hx_box/2, hy_box/2, hz_box/2, hx_box, h_pml};
pts_s164[] = PointsOf{Surface{s164};};
Characteristic Length{pts_s164[]} = lc_pml;
ex20[] = Extrude {0,0,h_pml} {Surface{s164};};
s165 = news;
Rectangle(s165) = {-h_pml-hx_box/2, -hy_box/2, -h_pml-hz_box/2, h_pml, hy_box};
pts_s165[] = PointsOf{Surface{s165};};
Characteristic Length{pts_s165[]} = lc_pml;
ex21[] = Extrude {0,0,h_pml} {Surface{s165};};
s166 = news;
Rectangle(s166) = {-h_pml-hx_box/2, -hy_box/2, -hz_box/2, h_pml, hy_box};
pts_s166[] = PointsOf{Surface{s166};};
Characteristic Length{pts_s166[]} = lc_pml;
ex22[] = Extrude {0,0,hz_box} {Surface{s166};};
s167 = news;
Rectangle(s167) = {-h_pml-hx_box/2, -hy_box/2, hz_box/2, h_pml, hy_box};
pts_s167[] = PointsOf{Surface{s167};};
Characteristic Length{pts_s167[]} = lc_pml;
ex23[] = Extrude {0,0,h_pml} {Surface{s167};};
s168 = news;
Rectangle(s168) = {hx_box/2, -hy_box/2, -h_pml-hz_box/2, h_pml, hy_box};
pts_s168[] = PointsOf{Surface{s168};};
Characteristic Length{pts_s168[]} = lc_pml;
ex24[] = Extrude {0,0,h_pml} {Surface{s168};};
s169 = news;
Rectangle(s169) = {hx_box/2, -hy_box/2, -hz_box/2, h_pml, hy_box};
pts_s169[] = PointsOf{Surface{s169};};
Characteristic Length{pts_s169[]} = lc_pml;
ex25[] = Extrude {0,0,hz_box} {Surface{s169};};
s170 = news;
Rectangle(s170) = {hx_box/2, -hy_box/2, hz_box/2, h_pml, hy_box};
pts_s170[] = PointsOf{Surface{s170};};
Characteristic Length{pts_s170[]} = lc_pml;
ex26[] = Extrude {0,0,h_pml} {Surface{s170};};
s171 = news;
Rectangle(s171) = {-hx_box/2, -hy_box/2, -h_pml-hz_box/2, hx_box, hy_box};
pts_s171[] = PointsOf{Surface{s171};};
Characteristic Length{pts_s171[]} = lc_pml;
ex27[] = Extrude {0,0,h_pml} {Surface{s171};};
s172 = news;
Rectangle(s172) = {-hx_box/2, -hy_box/2, hz_box/2, hx_box, hy_box};
pts_s172[] = PointsOf{Surface{s172};};
Characteristic Length{pts_s172[]} = lc_pml;
ex28[] = Extrude {0,0,h_pml} {Surface{s172};};
vol10 = newv;
Sphere(vol10) = {x_sph, y_sph, z_sph, R_sph};
pts_vol10[] = PointsOf{Volume{vol10};};
Characteristic Length{pts_vol10[]} = lc_sph;
bo1[] = BooleanDifference{ Volume{ex2[1]}; Delete; } { Volume{vol10};Volume{ex1[1]}; Delete;};
vol11 = newv;
Sphere(vol11) = {x_sph, y_sph, z_sph, R_sph};
pts_vol11[] = PointsOf{Volume{vol11};};
Characteristic Length{pts_vol11[]} = lc_sph;
s173 = news;
Rectangle(s173) = {-hx_des/2, -hy_des/2, -hz_des/2, hx_des, hy_des};
pts_s173[] = PointsOf{Surface{s173};};
Characteristic Length{pts_s173[]} = lc_des;
ex29[] = Extrude {0,0,hz_des} {Surface{s173};};
p5 = newp;
Point(p5) = {0, 0, 0};
Physical Volume(1) = {bo1[]};
Physical Volume(2) = {ex29[1]};
Physical Volume(3) = {vol11};
Physical Volume(4) = {ex3[1], ex5[1], ex6[1], ex8[1], ex9[1], ex11[1], ex12[1], ex14[1]};
Physical Volume(5) = {ex4[1], ex7[1], ex10[1], ex13[1]};
Physical Volume(6) = {ex15[1], ex17[1], ex18[1], ex20[1]};
Physical Volume(7) = {ex21[1], ex23[1], ex24[1], ex26[1]};
Physical Volume(8) = {ex22[1], ex25[1]};
Physical Volume(9) = {ex16[1], ex19[1]};
Physical Volume(10) = {ex27[1], ex28[1]};
Physical Point(11) = {p5};
Coherence;
Coherence;
Coherence;
Mesh.Algorithm=6;
Mesh.Algorithm3D=4;