Exm3
# Mesh example: Meshing in 2D
Shows structured meshing in 2D.
**Define geometry**
**Define points**
**Add splines**
The first four curves are structured curves, i.e the number of nodes
along the curves is pre-determined. Parameter elOnCurve states how many
elements are placed along the curve. Parameters elDistribType and
elDistribVal are optional parameters that specify how elements are
distributed.
- "bump" means elements are bunched up at the ends or the middle of the
curve. In this case elDistribVal is smaller than 1, so elements crowd
at the edges.
- "progression" means each element along the curve is larger/smaller
than the previous one. A larger elDistribVal makes the elements larger
at the end of the curves.
g.spline([0,1], el_on_curve=10, el_distrib_type="bump", el_distrib_val=0.2)
g.spline([1,2], el_on_curve=20, el_distrib_type="progression", el_distrib_val=1.1)
g.spline([2,3], el_on_curve=10, el_distrib_type="bump", el_distrib_val=0.2)
g.spline([0,3], el_on_curve=20, el_distrib_type="progression", el_distrib_val=1.1) #Change order of points to reverse progression distribution
g.spline([2, 4, 1])
**Add surfaces**
A structured surface must contain 4 curves that have the parameter
'elOnCurve' defined. The number of elements on two opposite curves must
be the same (In this case, curves 0 & 2 and 1 & 3).
**Create mesh**
mesh = cfm.GmshMesh(g)
mesh.el_type = 3 # quad
mesh.dofs_per_node = 1
mesh.el_size_factor = 0.01
coords, edof, dofs, bdofs, elementmarkers = mesh.create()
Info : GMSH -> Python-module
**Visualise mesh**
***Draw geometry***
**Draw mesh**