back

GMSH Examples: extrusion and structured mesh

A script that generates the above mesh is listed below and can be downloaded here: box3dhole.geo

<sxh c> Lx=3.0; X direction hole dimension Ly=2.0; Y direction hole dimension Lz=10; Length of the box dx=0.5; Wall thickness in X direction dy=0.8; Wall thickness in Y direction Nz=20; Nx=6; Number of X subdivisions of the hole Ny=4; Number of Y subdivisions of the hole Ndw=5; number of layers between inner and outer walls

lst=newp; Point(lst) = {0,0,0}; point 1 lineX[] = Extrude{Lx, 0, 0} { Point{lst}; Layers{Nx}; }; lineY[] = Extrude{0, Ly, 0} { Point{lst}; Layers{Ny}; }; lineX1[] = Extrude{Lx, 0, 0} {Point{lineY[0]}; Layers{Nx};}; lineY1[] = Extrude{0, Ly, 0} {Point{lineX[0]}; Layers{Ny}; }; partS[] = Extrude{0, -dy, 0} { Line{lineX[1]}; Layers{Ndw}; }; partW[] = Extrude{-dx, 0, 0} { Line{lineY[1]}; Layers{Ndw}; }; partN[] = Extrude{0, dy, 0} { Line{lineX1[1]}; Layers{Ndw}; }; partE[] = Extrude{dx, 0, 0} { Line{lineY1[1]}; Layers{Ndw}; }; partSW[] = Extrude{-dx, 0, 0} { Line{partS[3]}; Layers{Ndw};}; partSE[] = Extrude{dx, 0, 0} { Line{partS[2]}; Layers{Ndw}; }; partNW[] = Extrude{-dx, 0, 0} { Line{partN[3]}; Layers{Ndw};}; partNE[] = Extrude{dx, 0, 0} { Line{partN[2]}; Layers{Ndw};}; allParts[] = {partS[1], partW[1], partE[1], partN[1], partSW[1], partSE[1], partNW[1], partNE[1]}; Transfinite Surface {allParts[]}; Recombine Surface {allParts[]}; zdir[] = Extrude{0, 0, Lz} { Surface{allParts[]}; Layers{Nz}; Recombine;}; </sxh> back

  • en/projects/meshtools/gmsh/extrusions.txt
  • Last modified: 2017/10/02 15:54
  • (external edit)