// We include the file containing the numbering of the geometry.
// This is usefull at the end of this file, and used to "synchronise" GMSH and GetDP
Include "param.geo";


// All numbering counterclockwise from bottom-left corner
InnerHalfSide = 1;
InnerDL = 1;
OuterHalfSide = 10;
OuterDL = 10;


/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
//                           Inner cube
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
Point(1) = {-InnerHalfSide, -InnerHalfSide, -InnerHalfSide, InnerDL};
Point(2) = { InnerHalfSide, -InnerHalfSide, -InnerHalfSide, InnerDL};
Point(3) = { InnerHalfSide,  InnerHalfSide, -InnerHalfSide, InnerDL};
Point(4) = {-InnerHalfSide,  InnerHalfSide, -InnerHalfSide, InnerDL};
Point(5) = {-InnerHalfSide, -InnerHalfSide,  InnerHalfSide, InnerDL};
Point(6) = { InnerHalfSide, -InnerHalfSide,  InnerHalfSide, InnerDL};
Point(7) = { InnerHalfSide,  InnerHalfSide,  InnerHalfSide, InnerDL};
Point(8) = {-InnerHalfSide,  InnerHalfSide,  InnerHalfSide, InnerDL};

Line(101) = {1, 2};
Line(102) = {2, 3};
Line(103) = {3, 4};
Line(104) = {4, 1};
Line(105) = {5, 6};
Line(106) = {6, 7};
Line(107) = {7, 8};
Line(108) = {8, 5};
Line(109) = {1, 5};
Line(110) = {2, 6};
Line(111) = {3, 7};
Line(112) = {4, 8};

// Inner cube bottom (-Z) surface with normal towards cube interior
Line Loop(201) = {101, 102, 103, 104}; 	
Plane Surface(301) = {201};

// Inner cube top (+Z) surface with normal towards cube interior
Line Loop(202) = {-105, -108, -107, -106}; 	
Plane Surface(302) = {202};

// Inner cube +X surface with normal towards cube interior
Line Loop(203) = { 106, -111, -102, 110}; 	
Plane Surface(303) = {203};

// Inner cube +Y surface with normal towards cube interior
Line Loop(204) = { 107, -112, -103, 111}; 	
Plane Surface(304) = {204};

// Inner cube -X surface with normal towards cube interior
Line Loop(205) = { 108, -109, -104, 112}; 	
Plane Surface(305) = {205};

// Inner cube -Y surface with normal towards cube interior
Line Loop(206) = { 105, -110, -101, 109}; 	
Plane Surface(306) = {206};



Physical Surface(GammaInner) = {301, 303, 304, 305, 306, 302};

Physical Surface(GammaInnerBottom) = {301};
Physical Surface(GammaInnerTop)    = {302};
Physical Surface(GammaInnerFront)  = {303};
Physical Surface(GammaInnerRight)  = {304};
Physical Surface(GammaInnerBack)   = {305};
Physical Surface(GammaInnerLeft)   = {306};




/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
//                         Outer cube
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
Point(11) = {-OuterHalfSide, -OuterHalfSide, -OuterHalfSide, OuterDL};
Point(12) = { OuterHalfSide, -OuterHalfSide, -OuterHalfSide, OuterDL};
Point(13) = { OuterHalfSide,  OuterHalfSide, -OuterHalfSide, OuterDL};
Point(14) = {-OuterHalfSide,  OuterHalfSide, -OuterHalfSide, OuterDL};
Point(15) = {-OuterHalfSide, -OuterHalfSide,  OuterHalfSide, OuterDL};
Point(16) = { OuterHalfSide, -OuterHalfSide,  OuterHalfSide, OuterDL};
Point(17) = { OuterHalfSide,  OuterHalfSide,  OuterHalfSide, OuterDL};
Point(18) = {-OuterHalfSide,  OuterHalfSide,  OuterHalfSide, OuterDL};

Line(121) = {11, 12};
Line(122) = {12, 13};
Line(123) = {13, 14};
Line(124) = {14, 11};
Line(125) = {15, 16};
Line(126) = {16, 17};
Line(127) = {17, 18};
Line(128) = {18, 15};
Line(129) = {11, 15};
Line(130) = {12, 16};
Line(131) = {13, 17};
Line(132) = {14, 18};

// Outer cube bottom (-Z) surface with normal towards cube exterior
Line Loop(211) = {-121, -124, -123, -122}; 	
Plane Surface(311) = {211};

// Outer cube top (+Z) surface with normal towards cube exterior
Line Loop(212) = {125, 126, 127, 128}; 	
Plane Surface(312) = {212};

// Outer cube +X surface with normal towards cube exterior
Line Loop(213) = { 122, 131, -126, -130}; 	
Plane Surface(313) = {213};

// Outer cube +Y surface with normal towards cube exterior
Line Loop(214) = { 123, 132, -127, -131}; 	
Plane Surface(314) = {214};

// Outer cube -X surface with normal towards cube exterior
Line Loop(215) = { 124, 129, -128, -132}; 	
Plane Surface(315) = {215};

// Outer cube -Y surface with normal towards cube exterior
Line Loop(216) = { 121, 130, -125, -129}; 	
Plane Surface(316) = {216};



Physical Surface(GammaOuter) = {311, 313, 314, 315, 316, 312};

Physical Surface(GammaOuterBottom) = {311};
Physical Surface(GammaOuterTop)    = {312};
Physical Surface(GammaOuterFront)  = {313};
Physical Surface(GammaOuterRight)  = {314};
Physical Surface(GammaOuterBack)   = {315};
Physical Surface(GammaOuterLeft)   = {316};



// Volume Omega
Surface Loop(998) = {301, 303, 304, 305, 306, 302, 311, 313, 314, 315, 316, 312};
Volume(999) = {998};

Physical Volume(Omega) = {999};

/* On my PC, the file must end with a free line to avoid errors which might come from different control characters in UNIX, Mac and Windows! Just to be save, insert one line below this comment!*/

