GetDP 1.2: Gmsh examples

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# C. Gmsh examples

Gmsh is a three-dimensional finite element mesh generator with simple CAD and post-processing capabilities that can be used as a graphical front-end for GetDP. Gmsh can be downloaded from http://www.geuz.org/gmsh/.

This appendix reproduces verbatim the input files needed by Gmsh to produce the mesh files ``mStrip.msh'` and ``Core.msh'` used in the examples of 6. Complete examples.

    /* -------------------------------------------------------------------
       File "mStrip.geo"

       This file is the geometrical description used by GMSH to produce
       the file "mStrip.msh".
       ------------------------------------------------------------------- */

    /* Definition of some parameters for geometrical dimensions, i.e.
       h (height of 'Diel1'), w (width of 'Line'), t (thickness of 'Line')
       xBox (width of the air box) and yBox (height of the air box) */

    h = 1.e-3 ; w = 4.72e-3 ;  t = 0.035e-3 ;
    xBox = w/2. * 6. ;  yBox = h * 12. ;

    /* Definition of parameters for local mesh dimensions */

    s = 1. ;
    p0 = h / 10. * s ;
    pLine0 = w/2. / 10. * s ;  pLine1 = w/2. / 50. * s ;
    pxBox = xBox / 10. * s ;  pyBox = yBox / 8. * s ;

    /* Definition of gemetrical points */

    Point(1) = { 0   , 0, 0, p0} ;
    Point(2) = { xBox, 0, 0, pxBox} ;
    Point(3) = { xBox, h, 0, pxBox} ;
    Point(4) = { 0   , h, 0, pLine0} ;
    Point(5) = { w/2., h, 0, pLine1} ;
    Point(6) = { 0   , h+t, 0, pLine0} ;
    Point(7) = { w/2., h+t, 0, pLine1} ;
    Point(8) = { 0   , yBox, 0, pyBox} ;
    Point(9) = { xBox, yBox, 0, pyBox} ;

    /* Definition of gemetrical lines */

    Line(1) = {1,2};   Line(2) = {2,3};  Line(3) = {3,9};
    Line(4) = {9,8};   Line(5) = {8,6};  Line(7) = {4,1};
    Line(8) = {5,3};   Line(9) = {4,5};  Line(10) = {6,7};
    Line(11) = {5,7};

    /* Definition of geometrical surfaces */

    Line Loop(12) = {8,-2,-1,-7,9};   Plane Surface(13) = {12};
    Line Loop(14) = {10,-11,8,3,4,5}; Plane Surface(15) = {14};

    /* Definition of Physical entities (surfaces, lines). The Physical
       entities tell GMSH the elements and their associated region numbers
       to save in the file 'mStrip.msh'. For example, the Region
       111 is made of elements of surface 13, while the Region 121 is
       made of elements of lines 9, 10 and 11 */

    Physical Surface (101) = {15} ;   /* Air */
    Physical Surface (111) = {13} ;   /* Diel1 */

    Physical Line (120) = {1} ;       /* Ground */
    Physical Line (121) = {9,10,11} ; /* Line */
    Physical Line (130) = {2,3,4} ;   /* SurfInf */

    /* -------------------------------------------------------------------
       File "Core.geo"

       This file is the geometrical description used by GMSH to produce
       the file "Core.msh".
       ------------------------------------------------------------------- */

    dxCore =  50.e-3; dyCore = 100.e-3;
    xInd   =  75.e-3; dxInd  =  25.e-3; dyInd  =  50.e-3;
    rInt   = 200.e-3; rExt   = 250.e-3;

    s       =  1.;
    p0      = 12.e-3 *s;
    pCorex  =  4.e-3 *s; pCorey0 =  8.e-3 *s; pCorey  =  4.e-3 *s;
    pIndx   =  5.e-3 *s; pIndy   =  5.e-3 *s;
    pInt    = 12.5e-3*s; pExt    = 12.5e-3*s;

    Point(1) = {0,0,0,p0};
    Point(2) = {dxCore,0,0,pCorex};
    Point(3) = {dxCore,dyCore,0,pCorey};
    Point(4) = {0,dyCore,0,pCorey0};
    Point(5) = {xInd,0,0,pIndx};
    Point(6) = {xInd+dxInd,0,0,pIndx};
    Point(7) = {xInd+dxInd,dyInd,0,pIndy};
    Point(8) = {xInd,dyInd,0,pIndy};
    Point(9) = {rInt,0,0,pInt};
    Point(10) = {rExt,0,0,pExt};
    Point(11) = {0,rInt,0,pInt};
    Point(12) = {0,rExt,0,pExt};

    Line(1) = {1,2};  Line(2) = {2,5};   Line(3) = {5,6};
    Line(4) = {6,9};  Line(5) = {9,10};  Line(6) = {1,4};
    Line(7) = {4,11}; Line(8) = {11,12}; Line(9) = {2,3};
    Line(10) = {3,4}; Line(11) = {6,7};  Line(12) = {7,8};
    Line(13) = {8,5};

    Circle(14) = {9,1,11};  Circle(15) = {10,1,12};

    Line Loop(16) = {-6,1,9,10};                 Plane Surface(17) = {16};
    Line Loop(18) = {11,12,13,3};                Plane Surface(19) = {18};
    Line Loop(20) = {7,-14,-4,11,12,13,-2,9,10}; Plane Surface(21) = {20};
    Line Loop(22) = {8,-15,-5,14};               Plane Surface(23) = {22};

    Physical Surface(101) = {21};  /* Air */
    Physical Surface(102) = {17};  /* Core */
    Physical Surface(103) = {19};  /* Ind */
    Physical Surface(111) = {23};  /* AirInf */

    Physical Line(1000) = {1,2};       /* Cut */
    Physical Line(1001) = {2};         /* CutAir */
    Physical Line(202)  = {9,10};      /* SkinCore */
    Physical Line(203)  = {11,12,13};  /* SkinInd */
    Physical Line(1100) = {1,2,3,4,5}; /* SurfaceGh0 */
    Physical Line(1101) = {6,7,8};     /* SurfaceGe0 */
    Physical Line(1102) = {15};        /* SurfaceGInf */

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

Back to geuz.org/getdp