MSH2Mstructmesh [MSH]
— Function File: [mesh] = MSH2Mstructmesh(x,y,region,sides,string)

Constructs a structured triangular 2D mesh on a rectangular domain, and returns a PDEtool-like mesh structure.

Input:

  • x: vector representing the 1D meshing of the side parallel to x axis.
  • y: vector representing the 1D meshing of the side parallel to y axis.
  • region: number assigned to the meshed region.
  • sides: row vector containing the four numbers assigned to the geometrical edges.
  • string: (optional) orientation of the diagonal edge of the structured mesh. Values: "right", "left", "random". Default is "right".

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.