FUNCTION REFERENCE

initmesh

Generate a 2-D triangular mesh from a decomposed geometry matrix in legacy [p,e,t] form.

Generate a 2-D triangular mesh from a decomposed geometry matrix in legacy [p,e,t] form.

Syntax

[p,e,t] = initmesh(g); [p,e,t] = initmesh(g, 'Hmax', hmax, 'Hgrad', hgrad, 'Jiggle', mode, 'MesherVersion', ver)

Meshes the 2-D decomposed geometry matrix g (columns are edges: type 1 circle arc, 2 line, 4 ellipse arc, as produced by decsg) using MatRust's deterministic 2-D constrained Delaunay mesher. Returns node coordinates p (2-by-np), boundary and interface edges e (7-by-ne: start/end node IDs, start/end edge parameters in [0,1], 1-based geometry edge ID, left/right subdomain labels), and triangles t (4-by-nt: three counter-clockwise 1-based vertex IDs and 1-based subdomain label). When Hmax is omitted or Inf, it defaults to the geometry bounding-box diagonal divided by 10.

Example

R1=[3;4;0;1;1;0;0;0;1;1]; g=decsg(R1); [p,e,t]=initmesh(g,'Hmax',0.5); size(p,1)==2 && size(e,1)==7 && size(t,1)==4

Differences from MATLAB: uses MatRust's deterministic mesher, so mesh vertices and triangle counts differ from MATLAB's initmesh; Hgrad, Jiggle, JiggleIter, MesherVersion, Box, and Init are accepted and ignored; function-handle geometry descriptions are not supported.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.