[Gmsh] Adaptive mesh with Box

luos at msu.edu luos at msu.edu
Sat May 28 01:55:46 CEST 2011


Dear All,

I am new with gmsh.   I have been trying to generate a mesh on a cubic domain with  refined meshes
in two smaller boxes inside this cube.  I tried to use Field Box.  It didn't work.   The following is my code.
Could anyone please tell how to fix this problem? 

xmin=-300; xmax=-xmin;
ymin=-300; ymax=-ymin;
zmin=-300; zmax=-zmin;

x1min=-50; x1max=-x1min;
y1min=-50; y1max=-y1min;
z1min=-50; z1max=-z1min;

H=30; h=5; 

// Cube
Point(1)={xmin,ymin,zmin,H};
Point(2)={xmax,ymin,zmin,H};
Point(3)={xmax,ymax,zmin,H};
Point(4)={xmin,ymax,zmin,H};
Point(5)={xmin,ymin,zmax,H};
Point(6)={xmax,ymin,zmax,H};
Point(7)={xmax,ymax,zmax,H};
Point(8)={xmin,ymax,zmax,H};  
Line(1)={1,2};
Line(2)={2,3};
Line(3)={3,4};
Line(4)={4,1};
Line(5)={1,5};
Line(6)={2,6};
Line(7)={3,7};
Line(8)={4,8};
Line(9)={5,6};
Line(10)={6,7};
Line(11)={7,8};
Line(12)={8,5}; 
Line Loop(1)={1,2,3,4};
Line Loop(2)={9,10,11,12};
Line Loop(3)={4,5,-12,-8};
Line Loop(4)={2,7,-10,-6};
Line Loop(5)={1,6,-9,-5};
Line Loop(6)={-3,7,11,-8}; 
Plane Surface(1)={1};
Plane Surface(2)={2};
Plane Surface(3)={3};
Plane Surface(4)={4};
Plane Surface(5)={5};
Plane Surface(6)={6}; 
Surface Loop(1)={1,4,2,3,5,6};
Volume(1)={1};

// Box 1
sx1=0; sy1=0; sz1=100;
Field[1]=Box;
Field[1].XMin =x1min+sx1; 
Field[1].XMax =x1max+sx1;
Field[1].YMin =y1min+sy1;
Field[1].YMax =y1max+sy1;
Field[1].ZMin =z1min+sz1;
Field[1].ZMax =z1max+sz1;
Field[1].VIn  =h;
Field[1].VOut =H; 

// Box 2
sx2=0; sy2=0; sz2=-100;
Field[2]=Box;
Field[2].XMin =x1min+sx2; 
Field[2].XMax =x1max+sx2;
Field[2].YMin =y1min+sy2;
Field[2].YMax =y1max+sy2;
Field[2].ZMin =z1min+sz2;
Field[2].ZMax =z1max+sz2;
Field[2].VIn  =h;
Field[2].VOut =H;   
Background Field = 2; 

Thank you  very much.
ST
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20110527/5ea9b8c7/attachment.html>