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.

adaption<br />

fem.bnd.ind = [1 1 2 2 2 2];<br />

fem.solform = 'general';<br />

We refine the elements using the L 2 -norm error estimator, with error minimization<br />

to achieve a factor of 1.3 in each step, and a maximum number of elements of 500.<br />

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

fem.xmesh = meshextend(fem);<br />

fem = adaption(fem,'maxt',500,'eefun','fleel2',...<br />

'tpfun','fltpft','tppar',1.3,'report','on');<br />

errexpr = 'abs(u-(x.^2+y.^2).^(1/3).*cos(2/3*atan2(y,x)))';<br />

errmax = postmax(fem,errexpr)<br />

We test how many refinements we have to use with an uniform element net:<br />

tol = errmax;<br />

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

fem.xmesh = meshextend(fem);<br />

errmax = 1;<br />

i = 0;<br />

while errmax>tol<br />

fem.sol = femstatic(fem);<br />

errmax = postmax(fem,errexpr);<br />

i = i+1;<br />

fprintf(1,'Refinement:%3d, error:%3.10f, using mesh:\n',...<br />

i,errmax);<br />

fem.mesh<br />

if errmax>tol<br />

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

fem.xmesh = meshextend(fem);<br />

end<br />

end<br />

Note that with uniform refinement, you need much more mesh elements to achieve<br />

the same absolute error as with the adaptive method. Also note that the error is<br />

reduced only by a small factor when the number of elements is quadrupled by the<br />

uniform refinement. For a problem with regular solution, you can expect a O(h 2 )<br />

error, but this solution is singular because u ≈ r 1/3 at the origin.<br />

Eigenmodes of a Nonconvex Geometry<br />

Solve the eigenvalue problem<br />

⎧<br />

⎨<br />

⎩<br />

– ∇ ⋅ ∇u<br />

= λu in Ω<br />

u = 0<br />

on ∂Ω<br />

,<br />

25

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

Saved successfully!

Ooh no, something went wrong!