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.

meshinit<br />

The properties xscale, yscale, and zscale specify scalar factors in each axis<br />

direction that the geometry is scaled by before meshing. The resulting mesh is then<br />

scaled back to fit the original geometry. The values of other properties correspond<br />

to the scaled geometry. By default, no scaling is done.<br />

Examples<br />

3D Example<br />

Create a 3D mesh of a cylinder.<br />

clear fem<br />

fem.geom=cylinder3;<br />

fem.mesh=meshinit(fem);<br />

meshplot(fem)<br />

2D Example<br />

Make a simple mesh of a unit square.<br />

clear fem<br />

fem.geom = geomcsg({square2(0,1,1)});<br />

fem.mesh = meshinit(fem);<br />

meshplot(fem), axis equal<br />

Make the mesh finer than the default.<br />

fem.mesh = meshinit(fem,'hmax',0.02);<br />

meshplot(fem), axis equal<br />

Now, make the mesh denser only near the edge segment to the left.<br />

fem.mesh = meshinit(fem,'hmaxedg',[1; 0.02]);<br />

meshplot(fem), axis equal<br />

1D Example<br />

Create a mesh on the interval [0,1] that is finer near the point 0 and grows towards<br />

1.<br />

fem.geom = geomcsg({solid1([0 1])});<br />

fem.mesh = meshinit(fem,'hmax',0.1,'hmaxvtx',[1; 0.001]);<br />

meshplot(fem)<br />

2D Example Dealing with Interactive Meshing<br />

Create a boundary mesh of a geometry<br />

clear fem;<br />

fem.geom = rect2+circ2;<br />

fem.mesh = meshinit(fem,'subdomain','none');<br />

meshplot(fem)<br />

Mesh subdomain 2 using the boundary mesh as starting mesh<br />

fem.mesh = meshinit(fem,'subdomain',2,'meshstart',fem.mesh);<br />

273

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

Saved successfully!

Ooh no, something went wrong!