Skip to content
Snippets Groups Projects
Select Git revision
  • a3221785cab590b387209068b407cbd5e61faf80
  • master default protected
  • dof-renumbering
  • gdemesy-master-patch-30528
  • eval-space-time
  • oscillating_multiharm
  • MH_movement
  • axisqu
  • write_vtu_and_ensight_formats
  • movingband
  • CP_1972_add_vtu_file_writing
  • mortar
  • fast_freq_sweep_Resolution
  • applyresolvent_again
  • marteaua-master-patch-54323
  • patch-1
  • binde-master-patch-08072
  • binde-master-patch-52461
  • BCGSL
  • resolvent
  • TreeElementsOf
  • getdp_3_5_0
  • getdp_3_4_0
  • getdp_3_3_0
  • getdp_3_2_0
  • getdp_3_1_0
  • getdp_3_0_4
  • getdp_3_0_3
  • getdp_3_0_2
  • getdp_3_0_1
  • getdp_3_0_0
  • onelab_mobile_2.1.0
  • getdp_2_11_3 protected
  • getdp_2_11_2 protected
  • getdp_2_11_1 protected
  • getdp_2_11_0 protected
  • getdp_2_10_0 protected
  • getdp_2_9_2 protected
  • getdp_2_9_1 protected
  • getdp_2_9_0 protected
  • getdp_2_8_0 protected
41 results

F_Misc.cpp

Blame
  • t1.geo 5.94 KiB
    // -----------------------------------------------------------------------------
    //
    //  Gmsh GEO tutorial 1
    //
    //  Geometry basics, elementary entities, physical groups
    //
    // -----------------------------------------------------------------------------
    
    // The simplest construction in Gmsh's scripting language is the
    // `affectation'. The following command defines a new variable `lc':
    
    lc = 1e-2;
    
    // This variable can then be used in the definition of Gmsh's simplest
    // `elementary entity', a `Point'. A Point is uniquely identified by a tag (a
    // strictly positive integer; here `1') and defined by a list of four numbers:
    // three coordinates (X, Y and Z) and the target mesh size (lc) close to the
    // point:
    
    Point(1) = {0, 0, 0, lc};
    
    // The distribution of the mesh element sizes will then be obtained by
    // interpolation of these mesh sizes throughout the geometry. Another method to
    // specify mesh sizes is to use general mesh size Fields (see `t10.geo'). A
    // particular case is the use of a background mesh (see `t7.geo').
    
    // If no target mesh size of provided, a default uniform coarse size will be
    // used for the model, based on the overall model size.
    
    // We can then define some additional points. All points should have different
    // tags:
    
    Point(2) = {.1, 0,  0, lc};
    Point(3) = {.1, .3, 0, lc};
    Point(4) = {0,  .3, 0, lc};
    
    // Curves are Gmsh's second type of elementary entities, and, amongst curves,
    // straight lines are the simplest. A straight line is identified by a tag and
    // is defined by a list of two point tags. In the commands below, for example,
    // the line 1 starts at point 1 and ends at point 2.
    //
    // Note that curve tags are separate from point tags - hence we can reuse tag
    // `1' for our first curve. And as a general rule, elementary entity tags in
    // Gmsh have to be unique per geometrical dimension.
    
    Line(1) = {1, 2};
    Line(2) = {3, 2};
    Line(3) = {3, 4};
    Line(4) = {4, 1};
    
    // The third elementary entity is the surface. In order to define a simple
    // rectangular surface from the four curves defined above, a curve loop has
    // first to be defined. A curve loop is also identified by a tag (unique amongst
    // curve loops) and defined by an ordered list of connected curves, a sign being
    // associated with each curve (depending on the orientation of the curve to form
    // a loop):
    
    Curve Loop(1) = {4, 1, -2, 3};
    
    // We can then define the surface as a list of curve loops (only one here,
    // representing the external contour, since there are no holes--see `t4.geo' for
    // an example of a surface with a hole):
    
    Plane Surface(1) = {1};
    
    // At this level, Gmsh knows everything to display the rectangular surface 1 and
    // to mesh it. An optional step is needed if we want to group elementary
    // geometrical entities into more meaningful groups, e.g. to define some
    // mathematical ("domain", "boundary"), functional ("left wing", "fuselage") or
    // material ("steel", "carbon") properties.