/* -------------------------------------------------------------------
   File "mStrip.geo"

   This file is the geometrical description used by GMSH to produce
   the file "mStrip.msh".
   ------------------------------------------------------------------- */

/* 
   Definition of some parameters for geometrical dimensions, i.e.
   hd (height of 'Diel1'), td (thickness of dielectric 'Diel1')
   wge (width of grounded electrode 'Elec0'), tge (thickness of 'Elec0')
   wve (width of charged electrode 'ElecV'),  tve (thickness of 'ElecV')
   xBox (width of the air box) and yBox (height of the air box) 
*/
cm = 1.e-02;

/* ********************************************************** */
/* ********************************************************** */
/* ********************************************************** */
/* chamber quartz wall */
hd = 15.*cm ; td = 1.5*cm ; red = 25.*cm; 
rid = red - td;

/* +V electrode (1) */
wve = 35.5*cm; tve = 9.85*cm ; 
epve = 3.*cm; hbve = 7.625*cm;
rcv = tve / 2. ;

/* Grounded electrode */
wge = 37.0*cm; tge = 16.1*cm ; rtge = 3.35*cm; 
epge = 3.*cm; hhge = 4.375*cm;
rcg = tge / 6. ;
retraitge = wge - wve;
rhge = wge - rcg - retraitge;
rbge = (rhge + red) / 2.;

/* +V electrode (2) */
rbve = rhge;
rhve = rbge;

/* curvature radius of all electrodes */
rcurv = td / 4.;

/* profondeur des gorges */
pg = 1.5*cm;

/* epaisseur alu */
epalu = 0.3*cm;

/* External volume */
xBox = (wge + wve)/2. * 4.5 ;  yBox = hd / 2. * 20. ;

/* Definition of parameters for local mesh dimensions */

s = 1. ;
p0 = hd / 10. * s ;
pGE = wge/2. / 10. * s ;  pCE = wve/2. / 10. * s ;
pmiddle = (pCE + pGE) / 2. * 10.;
pGEcorner = wge/2. / 100. * s ;  pCEcorner = wve/2. / 50. * s ;
pxBox = xBox / 10. * s ;  pyBox = yBox / 8. * s ;

/* ********************************************************** */
/* ********************************************************** */
/* ********************************************************** */
/* Definition of gemetrical points */

/* external box */
Point(1) = { 0              , -yBox        , 0, pyBox} ;
Point(2) = { xBox           , -yBox        , 0, pyBox} ;
Point(3) = { xBox           ,  0.          , 0, pyBox} ;
Point(4) = { xBox           ,  yBox        , 0, pyBox} ;
Point(5) = { 0              ,  yBox        , 0, pyBox} ;
Point(6) = { 0              ,  hbve + epve , 0, pCE} ;
Point(7) = { 0              ,  hbve        , 0, pGEcorner} ;
Point(8) = { 0              ,  0.          , 0, pGEcorner} ;
Point(9) = { 0              , -hhge        , 0, pGEcorner} ;
Point(10) = { 0             , -hhge - epge , 0, pGEcorner} ;

/* grounded electrode (1) */
Point(11) = { rbge          , -hhge - tge  , 0, pGEcorner} ;
Point(12) = { wge - rcg     , -hhge - tge  , 0, pGEcorner} ;
Point(13) = { wge - rcg     , -hhge - tge + rcg , 0, pGEcorner} ;
Point(14) = { wge           , -hhge - tge + rcg , 0, pGEcorner} ;
Point(15) = { wge           , -hhge - rcg  , 0, pGEcorner} ;
Point(16) = { wge - rcg     , -hhge - rcg  , 0, pGEcorner} ;
Point(17) = { wge - rcg     , -hhge        , 0, pGEcorner} ;
Point(18) = { rhge          , -hhge        , 0, pGEcorner} ;
Point(19) = { red + rcurv   , -hhge        , 0, pGEcorner} ;
Point(20) = { red + rcurv   , -hhge - rcurv, 0, pGEcorner} ;
Point(21) = { red           , -hhge - rcurv, 0, pGEcorner} ;
Point(22) = { red           , -hhge - pg   , 0, pGEcorner} ;
Point(23) = { red - td      , -hhge - pg   , 0, pGEcorner} ;
Point(24) = { red - td      , -hhge - rcurv, 0, pGEcorner} ;
Point(25) = { red - td - rcurv , -hhge - rcurv , 0, pGEcorner} ;
Point(26) = { red - td - rcurv , -hhge     , 0, pGEcorner} ;
Point(27) = { (red +rtge)/2., -hhge        , 0, pGEcorner} ;
Point(28) = { rtge + rcurv  , -hhge        , 0, pGEcorner} ;
Point(29) = { rtge + rcurv  , -hhge - rcurv, 0, pGEcorner} ;
Point(30) = { rtge          , -hhge - rcurv, 0, pGEcorner} ;
Point(31) = { rtge          , -hhge - epge , 0, pGEcorner} ;

/* chamber wall external middle point */
Point(32) = { red           ,  0   , 0, pGEcorner} ;

/* +V electode (1/3) */
Point(33) = { red           , hbve + rcurv, 0, pGEcorner} ;
Point(34) = { red           , hbve + pg   , 0, pGEcorner} ;
Point(35) = { red - td      , hbve + pg   , 0, pGEcorner} ;
Point(36) = { red - td      , hbve + rcurv, 0, pGEcorner} ;

/* chamber wall internal middle point */
Point(37) = { red - td      ,  0   , 0, pGEcorner} ;

/* +V electode (2/3) */
Point(38) = { red - td - rcurv , hbve + rcurv, 0, pGEcorner} ;
Point(39) = { red - td - rcurv , hbve        , 0, pGEcorner} ;
Point(40) = { (red - td)/2.    , hbve        , 0, pGEcorner} ;
Point(41) = { red + rcurv      , hbve        , 0, pGEcorner} ;
Point(42) = { red + rcurv      , hbve + rcurv, 0, pGEcorner} ;
Point(43) = { rbve             , hbve        , 0, pGEcorner} ;
Point(44) = { rbve             , hbve + rcv  , 0, pGEcorner} ;
Point(45) = { rbve + rcv       , hbve + rcv  , 0, pGEcorner} ;
Point(46) = { rbve             , hbve+ 2.*rcv, 0, pGEcorner} ;
Point(47) = { rhve             , hbve+ epve  , 0, pGEcorner} ;

/* grounded electrode (2) */
Point(48) = { rbge          , -hhge - epge  , 0, pGEcorner} ;
Point(49) = { rhge          , -hhge - epalu , 0, pGEcorner} ;
Point(50) = { wge - rcg     , -hhge - epalu , 0, pGEcorner} ;
Point(51) = { wge - epalu   , -hhge - rcg  , 0, pGEcorner} ;
Point(52) = { wge - epalu   , -hhge - tge + rcg , 0, pGEcorner} ;
Point(53) = { wge - rcg     , -hhge - tge + epalu , 0, pGEcorner} ;
Point(54) = { rbge          , -hhge - tge + epalu , 0, pGEcorner} ;

/* +V electode (3/3) */
Point(55) = { rbve                , hbve + epalu     , 0, pGEcorner} ;
Point(56) = { rbve + rcv - epalu  , hbve + rcv       , 0, pGEcorner} ;
Point(57) = { rbve             , hbve+ 2.*rcv - epalu, 0, pGEcorner} ;

/* grounded valve */
Point(58) = { 1.5*rtge         , -hhge - epge     , 0, pGEcorner};
Point(59) = { 1.5*rtge         , -hhge - 1.5*epge , 0, pGEcorner};
Point(60) = { 0.               , -hhge - 1.5*epge , 0, pGEcorner};

/* Additional points for meshing characteristic length */
Point(61) = { 0             , -hhge - 2.*epge , 0, pGEcorner} ;
Point(62) = { 0             , -hhge - 4.*epge , 0, pGEcorner} ;
Point(63) = { 0             , -hhge - 6.*epge , 0, pGEcorner} ;


/* ********************************************************** */
/* ********************************************************** */
/* ********************************************************** */
/* Definition of gemetrical lines */

Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,5};
Line(5) = {5,6};
Line(7) = {7,8};
Line(8) = {8,9};
Line(9) = {9,10};
Line(10) = {60,61,63,1};

Line(11) = {60,59};
Line(12) = {59,58};
Line(13) = {58,48};
Line(14) = {48,49};
Line(15) = {49,50};
Circle(16) = {50,16,51};
Line(17) = {51,52};
Circle(18) = {52,13,53};
Line(19) = {53,54};
Line(20) = {54,11};
Line(21) = {11,12};
Circle(22) = {12,13,14};
Line(23) = {14,15};
Circle(24) = {15,16,17};
Line(25) = {17,18};
Line(26) = {18,19};
Circle(27) = {19,20,21};
Line(28) = {21,22};
Line(29) = {22,23};
Line(30) = {23,24};
Circle(31) = {24,25,26};
Line(32) = {26,27};
Line(33) = {27,28};
Circle(34) = {28,29,30};
Line(35) = {30,31};
Line(36) = {31,10};

Line(37) = {21,32};
Line(38) = {32,33};
Line(39) = {36,37};
Line(40) = {37,24};

Line(41) = {6,47};
Line(42) = {47,55};
Circle(43) = {55,44,56};
Circle(44) = {56,44,57};
Line(45) = {57,46};
Circle(46) = {46,44,45};
Circle(47) = {45,44,43};
Line(48) = {43,41};
Circle(49) = {41,42,33};
Line(50) = {33,34};
Line(51) = {34,35};
Line(52) = {35,36};
Circle(53) = {36,38,39};
Line(54) = {39,40};
Line(55) = {40,7};


/* ********************************************************** */
/* ********************************************************** */
/* ********************************************************** */
/* Definition of geometrical surfaces */

/* external vacuum */
Line Loop(30) = {1,2,3,4,5,41,42,43,44,45,46,47,48,49,-38,-37,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,10};
Plane Surface(31) = {30};

/* quartz wall */
Line Loop(32) = {37,38,50,51,52,39,40,-30,-29,-28};
Plane Surface(33) = {32};

/* internal vacuum */
Line Loop(34) = {7,8,9,-36,-35,-34,-33,-32,-31,-40,-39,53,54,55};
Plane Surface(35) = {34};

/* ********************************************************** */
/* ********************************************************** */
/* ********************************************************** */
/* Definition of Physical entities (surfaces, lines). The Physical
   entities tell GMSH the elements and their associated region numbers
   to save in the file 'mStrip.msh'. For example, the Region 
   111 is made of elements of surface 13, while the Region 121 is 
   made of elements of lines 9, 10 and 11 */

Physical Surface (101) = {31} ;   /* External Vacuum */
Physical Surface (102) = {33} ;   /* Quartz */
Physical Surface (103) = {35} ;   /* Internal Vacuum */


Physical Line (120) = {11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36} ;  /* Ground */
Physical Line (121) = {41,42,43,44,45,46,47,48,49,50,51,52,53,54,55} ; /* Elctrode V */
Physical Line (130) = {1,2,3,4} ;   /* SurfInf */