21.01.2015 Views

COMSOL Multiphysics™

COMSOL Multiphysics™

COMSOL Multiphysics™

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

flcontour2mesh<br />

Purpose<br />

flcontour2mesh<br />

Create boundary mesh from contour data.<br />

Syntax<br />

Description<br />

m = flcontour2mesh(c)<br />

m = flcontour2mesh(c) creates a boundary mesh m with fields m.p and m.e from<br />

the contour data c. The contour matrix c is a two-row matrix of contour lines. Each<br />

contiguous drawing segment contains the value of the contour, the number of (x,y)<br />

drawing pairs, and the pairs themselves. The segments are appended end-to-end as<br />

c = [level1 x1 x2 x3 ... level2 x2 x2 x3 ...;<br />

pairs1 y1 y2 y3 ... pairs2 y2 y2 y3 ...]<br />

The contour matrix format is used by the <strong>COMSOL</strong> Script or MATLAB function<br />

contourc.<br />

By using the contour matrix format, you can convert geometry data defined by a<br />

point set, to a <strong>COMSOL</strong> Multiphysics geometry object. Firstly, define a contour<br />

matrix c corresponding to your point set and use flcontour2mesh to convert the<br />

contour matrix c to a 2D boundary mesh m. Then, use flmesh2spline to convert<br />

the mesh object m to a curve2 object.<br />

Examples<br />

Create a mesh from contour data.<br />

[x,y] = meshgrid(linspace(-3,3,50));<br />

z = (x.^2+y.^2).*exp(-x.^2-y.^2)+cos(y)+sin(x);<br />

figure<br />

c = contour(z);<br />

m = flcontour2mesh(c);<br />

figure<br />

meshplot(m);<br />

See Also<br />

contourc, flmesh2spline, flim2curve<br />

179

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!