Merge "wing.stl";



// Mesh.CharacteristicLengthFromPoints = 0;
// Mesh.CharacteristicLengthExtendFromBoundary = 1;
// Mesh.CharacteristicLengthFromCurvature = 0;

// Mesh.CharacteristicLengthFromPoints = 0;
// Mesh.CharacteristicLengthExtendFromBoundary = 1;
// Mesh.CharacteristicLengthFromCurvature = 0;

lc = 10;
Mesh.CharacteristicLengthMin = lc/100;
Mesh.CharacteristicLengthMax = lc;

Point(1) = {-50, -50, -50, lc};
Point(2) = {-50, -50,  50, lc};
Point(3) = {-50,  50, -50, lc};
Point(4) = {-50,  50,  50, lc};

Line(11) = {1,3};
Line(12) = {3,4};
Line(13) = {4,2};
Line(14) = {2,1};
Line Loop(15) = {11,12,13,14};
Plane Surface(101) = {15};
Extrude {100,0,0} { Surface{101};}


// boundary layer mesh
// http://comments.gmane.org/gmane.comp.cad.gmsh.general/1222
// http://onelab.info/pipermail/gmsh/2010/005266.html
// http://gmsh.info/doc/texinfo/gmsh.html#Structured-grids

h = 0.05;
num[] = Extrude {
   // Surface{1}; Layers{ { 4,2 }, { h,2*h } };
   Surface{1}; Layers{ 6,0.1 };
   Recombine;
   // QuadTriAddVerts;
   // ScaleLastLayer;
};


//Delete {
//  Volume{1};
//}



Surface Loop(1000) = {2}; 							// wing surface
Surface Loop(1001) = {num[0]}; 						// BL outside
Surface Loop(1002) = {101,-110,-114,-118,-122,-123}; 	// box

//Volume(1000) = {1000};	// inside
Volume(1001) = {1002,1001}; // outside

// Physical Surface("Wing")     = {1};
// Physical Surface("Farfield") = {101,110,114,118,122,123};



Mesh.Algorithm3D = 4;


