[Gmsh] 2D: Manual mesh refinement

benjamin benjamin.bercovici at gmail.com
Tue Jul 8 17:57:13 CEST 2014


Dear all,

I wrote a .geo file that describes a 2D electrostatic confinement device 
(see the attached document for the .geo file and the resulting mesh). 
The geometry is comprised of a circular wall and several electrodes, 
whose cross sections are circular. The electrodes are asymmetrically 
distributed so that particles can exit the device through the asymmetry.

I would like to refine the (2D) mesh along the exit path of the 
particles (i.e in the region that is highlighted on the screenshot). I 
read the documentation of gmsh, but I could not find a (simple) solution 
to my problem.

How would you do that? I was thinking of creating a set of points in the 
region of interest so that the mesh can connect with them and get 
refined, but this idea may be to naive.

Best regards,

Benjamin Bercovici

ps: you can call "gmsh -2 iec.geo" to generate the mesh, or "gmsh 
iec.geo" and then click "Mesh->2D ".
-------------- next part --------------

//Hiiper's chamber radius
cr=0.3;

//IEC radius and wire radius
ir=0.1;
rw=0.002;

//Chamber center
Point(1)={0,0,0,1};
//Asymetry half aperture
alpha=Pi/4;
//Position of the first wire
theta_0=Pi/2-alpha;
//Number of IEC grids
ng=8;
//IEC grids angular spacing
A=-(2*theta_0+Pi)/(ng-1);

//Outer walls
Point(2)={0,-cr,0,1};
Point(3)={cr,0,0,1};
Point(4)={0,cr,0,1};
Point(5)={-cr,0,0,1};

Circle(1)={2,1,3};
Circle(2)={3,1,4};
Circle(3)={4,1,5};
Circle(4)={5,1,2};
Line Loop(5)={1:4};

// "Physical" Chamber wall
Physical Line(1)={1:4}; 	

//IEC

For num In {0:ng-1}
Point(6+4*num)={ir*Cos(theta_0+A*num),ir*Sin(theta_0+A*num),0,1};
Point(7+4*num)={ir*Cos(theta_0+A*num),ir*Sin(theta_0+A*num),0,1}+{rw*Cos(Pi/4),rw*Sin(Pi/4),0,0};
Point(8+4*num)={ir*Cos(theta_0+A*num),ir*Sin(theta_0+A*num),0,1}+{-rw*Cos(Pi/4),rw*Sin(Pi/4),0,0};
Point(9+4*num)={ir*Cos(theta_0+A*num),ir*Sin(theta_0+A*num),0,1}+{0,-rw,0,0};
Circle(6+4*num)={7+4*num,6+4*num,8+4*num};
Circle(7+4*num)={8+4*num,6+4*num,9+4*num};
Circle(8+4*num)={9+4*num,6+4*num,7+4*num};
Line Loop(9+4*num)={6+4*num,7+4*num,8+4*num};
storeloop[num]=9+4*num;
storeline[3*num]=6+4*num;
storeline[3*num+1]=7+4*num;
storeline[3*num+2]=8+4*num;

EndFor

//"Physical" IEC
Physical Line (2)={storeline[{0:3*ng-3+2}]};

//Surface. First number: outer boundary. Last number: inner boundaries

Plane Surface(1) = {5,storeloop[{0:ng-1}]};
Physical Surface(1) = {1};

Mesh.Algorithm = 8;
Mesh.RecombineAll = 1;
Mesh.CharacteristicLengthFactor = 0.5;
Mesh.SubdivisionAlgorithm = 1;
Mesh.Smoothing = 20;
Show "*";

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iec.png
Type: image/png
Size: 24417 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20140708/54334af3/attachment.png>