FUNCTION REFERENCE
generateMesh
Generate a 2-D triangular finite-element mesh for a PDE model.
Generate a 2-D triangular finite-element mesh for a PDE model.
Syntax
mesh = generateMesh(model); mesh = generateMesh(model, 'Hmax', hmax, 'Hmin', hmin, 'Hgrad', hgrad, 'GeometricOrder', 'quadratic'|'linear')Meshes model.Geometry using constrained Delaunay triangulation and quality refinement, stores the resulting pde.FEMesh value object in model.Mesh, and returns it. GeometricOrder defaults to 'quadratic' (6-node triangles with midside nodes for edges (1,2), (2,3), (3,1) projected onto curved boundaries); 'linear' produces 3-node counter-clockwise triangles. Hgrad defaults to 1.5 (must satisfy 1 < Hgrad < 2). When omitted, Hmax defaults to the geometry bounding-box diagonal divided by 10, and Hmin defaults to Hmax / 4 (both must be positive with Hmin <= Hmax). Raises an error if model has no geometry.
Example
R1=[3;4;-1;1;1;-1;-1;-1;1;1]; dl=decsg(R1); m=createpde(); geometryFromEdges(m,dl); mesh=generateMesh(m,'Hmax',0.5,'GeometricOrder','linear'); size(mesh.Elements,1)Differences from MATLAB: 2-D triangular meshes only; default Hmax is bounding-box diagonal / 10 and default Hmin is Hmax / 4; Hedge, Hface, Hvertex, and 3-D tetrahedral meshes are not supported.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.