Mesh Data

A mesh consists of three data structures:

  • p (points) is a 2-by-Np matrix of points, where Np is the number of points in the mesh. Each column p(:,k) consists of the x-coordinate of point k in p(1,k), and the y-coordinate of point k in p(2,k).

  • e (edges) is a 7-by-Ne matrix of edges, where Ne is the number of edges in the mesh. An edge is a pair of points in p containing a boundary between subdomains, or containing an outer boundary, as follows:

    • e(1,k) is the index of the first point in edge k.

    • e(2,k) is the index of the second point in edge k.

    • e(3,k) is the parameter value at the first point of edge k. The parameter value is related to arc length along the edge.

    • e(4,k) is the parameter value at the second point of edge k.

    • e(5,k) is the segment number of the geometry containing the edge. The segment number is inherited from the edge segments in the base geometry. You can see geometry segment numbers using the command pdegplot(geom,'edgeLabels','on').

    • e(6,k) is the subdomain number on the left of the edge (subdomain 0 is the exterior of the geometry), where direction along the edge is given by increasing parameter value.

    • e(7,k) is the subdomain number on the right of the edge.

  • t (triangles) is a 4-by-Nt matrix of triangles, where Nt is the number of triangles in the mesh. t(1,k), t(2,k), and t(3,k) contain indices to the three points in p that form triangle k. The points are in counterclockwise order. t(4,k) contains the subdomain number of the triangle.

Generate an initial mesh using the initmesh function. Refine the mesh using the refinemesh function. Improve mesh quality without introducing new points using the jigglemesh function.

Related Examples

Was this topic helpful?