MSH2Mgmsh [MSH]
— Function File: [mesh] = MSH2Mgmsh(geometry,scalefactor,refine)

Constructs an unstructured 2D mesh making use of the free software gmsh. Gives as output the PDE-tool like mesh structure.

Input:

  • geometry: name of the ".geo" file describing the 2D geometry. Required by gmsh to start the meshing operation.
  • scalefactor: every length in the geometry file will be multiplied by this number. If the geometry is allready scaled, set it to 1.
  • refine: gmsh clscale factor. The smaller this number, the bigger the number of elements in the mesh.
For more information refer to gmsh manual, or gmsh site:

http://www.geuz.org/gmsh/

Output: mesh basic structure, composed of the following fields

  • p: matrix with size 2 times number of mesh point.
    • 1st row: x-coordinates of the points.
    • 2nd row: y-coordinates of the points.
  • e: matrix with size 7 times number of mesh border edges.
    • 1st row: p-matrix column number of the first edge-vertex.
    • 2nd row: p-matrix column number of the second edge-vertex.
    • 3rd row: not initialized, only for compatibility with standard PDE-tool like mesh.
    • 4th row: not initialized, only for compatibility with standard PDE-tool like mesh.
    • 5th row: number of the geometrical border upon which the referred mesh edge is lying on.
    • 6th row: number of the region to the right of the referred mesh edge.
    • 7th row: number of the region to the left of the referred mesh edge.
  • t:
    • 1st row: p-matrix column number of the first trg-vertex.
    • 2nd row: p-matrix column number of the second trg-vertex.
    • 3rd row: p-matrix column number of the third trg-vertex.
    • 4th row: number of the region upon which the referred trg is lying on.