21.01.2015 Views

COMSOL Multiphysics™

COMSOL Multiphysics™

COMSOL Multiphysics™

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

meshrefine<br />

clear fem<br />

fem.geom = square2 + move(square2,0,-1) + move(square2,-1,-1);<br />

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

subplot(2,2,1), meshplot(fem)<br />

fem.mesh = meshrefine(fem,'tri',[1:50;ones(1,50)]);<br />

subplot(2,2,2), meshplot(fem)<br />

fem.mesh = meshrefine(fem,'subdomain',...<br />

[1 2],'rmethod','longest');<br />

subplot(2,2,3), meshplot(fem)<br />

fem.mesh = meshrefine(fem,'subdomain',1);<br />

subplot(2,2,4), meshplot(fem)<br />

Algorithm<br />

The 2D algorithm is described by the steps below:<br />

1 Pick the initial set of elements to be refined.<br />

2 Either divide all edges of the selected elements in half (regular refinement), or<br />

divide the longest edge in half (longest edge refinement).<br />

3 Divide the longest edge of any element that has a divided edge.<br />

4 Repeat step 3 until no further edges are divided.<br />

5 Introduce new points on all divided edges, and replace all divided entries in e by<br />

two new entries.<br />

6 Form the new elements. If all three sides are divided, new elements are formed<br />

by joining the side midpoints. If two sides are divided, the midpoint of the<br />

longest edge is joined with the opposing corner and with the other midpoint. If<br />

only the longest edge is divided, its midpoint is joined with the opposing corner.<br />

Compatibility<br />

To achieve compatibility with FEMLAB 2.3, the geometry input is automatically<br />

converted to a geometry object using the function geomobject. The geometry<br />

input can be any analyzed geometry. See geomobjectfor details.<br />

The output u is obsolete from FEMLAB 2.2. Use asseminit to interpolate the<br />

solution to a new mesh.<br />

See Also<br />

femmesh, geomcsg, meshinit<br />

292 | CHAPTER 1: COMMAND REFERENCE

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

Saved successfully!

Ooh no, something went wrong!