Mesh Data as [p,e,t] Triples
Partial Differential Equation
Toolbox™ uses meshes with triangular elements for 2-D geometries and meshes
with tetrahedral elements for 3-D geometries. Earlier versions of Partial Differential Equation
Toolbox use meshes in the form of a [p,e,t] triple. The
matrices p, e, and t represent the
points (nodes), elements, and triangles or tetrahedra of a mesh, respectively. Later
versions of the toolbox support the [p,e,t] meshes for compatibility
reasons.
Note
New features might not be compatible with the legacy workflow. For description of the mesh data in the recommended workflow, see Mesh Data.
The mesh data for a 2-D mesh has these components:
p(points, the mesh nodes) is a2-by-Npmatrix of nodes, whereNpis the number of nodes in the mesh. Each columnp(:,k)consists of the x-coordinate of pointkinp(1,k)and the y-coordinate of pointkinp(2,k).e(edges) is a7-by-Nematrix of edges, whereNeis the number of edges in the mesh. The mesh edges ineand the edges of the geometry have a one-to-one correspondence. Theematrix represents the discrete edges of the geometry in the same manner as thetmatrix represents the discrete faces. Each column in theematrix represents one edge.e(1,k)is the index of the first point in mesh edgek.e(2,k)is the index of the second point in mesh edgek.e(3,k)is the parameter value at the first point of edgek. The parameter value is related to the arc length along the geometric edge.e(4,k)is the parameter value at the second point of edgek.e(5,k)is the ID of the geometric edge containing the mesh edge. You can see edge IDs by using the commandpdegplot(geom,'EdgeLabels','on').e(6,k)is the subdomain number on the left side of the edge. The direction along the edge is given by increasing parameter values. The subdomain0is the exterior of the geometry.e(7,k)is the subdomain number on the right side of the edge.
t(triangles) is a4-by-Ntmatrix of triangles or a7-by-Ntmatrix of triangles, depending on whether you callgenerateMeshwith theGeometricOrdername-value pair set to'quadratic'or'linear', respectively.initmeshcreates only'linear'elements, which have size4-by-Nt.Ntis the number of triangles in the mesh. Each column oftcontains the indices of the points inpthat form the triangle. The exception is the last entry in the column, which is the subdomain number. Triangle points are ordered as shown.

The mesh data for a 3-D mesh has these components:
p(points, the mesh nodes) is a3-by-Npmatrix of nodes, whereNpis the number of nodes in the mesh. Each columnp(:,k)consists of the x-coordinate of pointkinp(1,k), the y-coordinate of pointkinp(2,k), and the z-coordinate of pointkinp(3,k).eis an object that associates the mesh faces with the geometry boundaries. Partial Differential Equation Toolbox functions use this association when converting the boundary conditions, which you set on geometry boundaries, to the mesh boundary faces.t(tetrahedra) is either an 11-by-Ntmatrix of tetrahedra or a 5-by-Ntmatrix of tetrahedra, depending on whether you callgenerateMeshwith theGeometricOrdername-value pair set to'quadratic'or'linear', respectively.Ntis the number of tetrahedra in the mesh. Each column oftcontains the indices of the points inpthat form the tetrahedron. The exception is the last element in the column, which is the subdomain number. Tetrahedron points are ordered as shown.

You can create a [p,e,t] mesh by using one of these approaches:
Use the
initmeshfunction to create a 2-D[p,e,t]mesh.Use the
generateMeshfunction to create a 2-D or 3-D mesh as aFEMeshobject. Then use themeshToPetfunction to convert the mesh to a[p,e,t]mesh.