[Gmsh] 3D structured mesh in a box

Oluwaseun Sharomi oluwaseun.sharomi at usask.ca
Sat Oct 27 01:33:39 CEST 2012


Hello,

I am trying to generate a 3D structured mesh and my code is given below.

Point(1) = {0, 0, 0, 1e+022};
Point(2) = {2, 0, 0, 1e+022};
Point(3) = {0, 0.7, 0, 1e+022};
Point(4) = {2, 0.7, 0, 1e+022};
Line(1) = {1,2};
Line(2) = {2,4};
Line(3) = {4,3};
Line(4) = {3,1};
Line Loop(5) = {1,2,3,4};
Plane Surface(5) = {5};
Transfinite Line{1} = 21 Using Progression 1;
Transfinite Line{2} = 8 Using Progression 1;
Transfinite Line{3} = 21  Using Progression 1;
Transfinite Line{4} = 8 Using Progression 1;
Extrude {0,0,0.3} { Surface{5}; Layers{3}; Recombine;}
Transfinite Surface{5};

While there are 21 points in Line(1), the points are not equally spaced. 
I expected

0 0.1 0.2 0.3 0.4 0.5

but i keep getting

0 0.09999999 0.199999999 0.2999999999 0.3999999999 0.499999999999

What can i do to have equally spaced values.

Sharomi