Include "eshelby_sphere2.phy";

Mesh.ElementOrder = 1;
// Rayon de la sphère
R1 = 1;
asp = 0.5;
R2 = asp*R1;
// Taille de la boîte (côté)
L = 60.0;
// Taille des éléments près de la sphère
h1 = R2/6;
h1b = R2/6;
// Taille des éléments près de la frontière
h2 = L/6;
eps = 1e-6;

// Génération de la sphère
Point(1) = {0.0, 0.0, 0.0, h1};
Point(2) = {R1, 0.0, 0.0, h1};
Point(3) = {0.0, R1, 0.0, h1};
Point(4) = {0.0, 0.0, R2, h1};
Point(22) = {R1+eps, 0.0, 0.0, h1};
Point(33) = {0.0, R1+eps, 0.0, h1};
Point(44) = {0.0, 0.0, R2+eps, h1};
Circle (1) = {2, 1, 3};
Ellipse (2) = {3, 1, 1, 4};
Ellipse (3) = {4, 1, 1, 2};
Line(4) = {1, 2};
Line(5) = {1, 3};
Line(6) = {1, 4};
Line Loop(7) = {4, 1, -5};
Plane Surface(8) = {7};
Line Loop(9) = {5, 2, -6};
Plane Surface(10) = {9};
Line Loop(11) = {6, 3, -4};
Plane Surface(12) = {11};
Line Loop(13) = {1, 2, 3};
Ruled Surface(14) = {13};
Circle (111) = {22, 1, 33};
Ellipse (222) = {33, 1, 1, 44};
Ellipse (333) = {44, 1, 1, 22};
Line Loop(113) = {111, 222, 333};
Ruled Surface(114) = {113};

Point(5) = {.5*L, 0.0, 0.0, h2};
Point(6) = {.5*L, .5*L, 0.0, h2};
Point(7) = {0.0, .5*L, 0.0, h2};
Point(8) = {0.0, 0.0, .5*L, h2};
Point(9) = {.5*L, 0.0, .5*L, h2};
Point(10) = {.5*L, .5*L, .5*L, h2};
Point(11) = {0.0, .5*L, .5*L, h2};
Line(15) = {33, 7};
Line(16) = {7, 6};
Line(17) = {6, 5};
Line(18) = {5, 22};
Line Loop(19) = {15, 16, 17, 18, 111};
Plane Surface(20) = {19};
Line(21) = {5, 9};
Line(22) = {9, 8};
Line(23) = {8, 44};
Line Loop(24) = {-18, 21, 22, 23, 333};
Plane Surface(25) = {24};
Line(26) = {8, 11};
Line(27) = {11, 7};
Line Loop(29) = {-23, 26, 27, -15, 222};
Plane Surface(30) = {29};
Line(31) = {6, 10};
Line(32) = {10, 9};
Line Loop(33) = {-17, 31, 32, -21};
Plane Surface(34) = {33};
Line(35) = {10, 11};
Line Loop(36) = {-16, -27, -35, -31};
Plane Surface(37) = {36};
Line Loop(38) = {-22, -32, 35, -26};
Plane Surface(39) = {38};
Surface Loop(40) = {8, 10, 12, 14};
Volume(41) = {40};
Surface Loop(42) = {114, 25, 20, 34, 37, 30, 39};
Volume(43) = {42};

Physical Volume(1000) = {41};
Physical Volume(1001) = {43};
Physical Surface(2000) = {30}; // Coupe yOz
Physical Surface(2001) = {25}; // Coupe zOx
Physical Surface(2002) = {20};  // Coupe xOy
Physical Surface(2003) = {34};     // Bord yOz
Physical Surface(2004) = {37};     // Bord zOx
Physical Surface(2005) = {39};     // Bord xOy
Physical Surface(2006) = {8};
Physical Surface(2007) = {10};
Physical Surface(2008) = {12};
Physical Surface(2009) = {14};
Physical Surface(2010) = {114};
Physical Surface(2011) = {114, 25, 20, 34, 37, 30, 39};
Physical Surface(2012) = {8, 10, 12, 14};
