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.

meshintegrate<br />

Purpose<br />

meshintegrate<br />

Integrate over arbitrary cross-section.<br />

Syntax<br />

Description<br />

I = meshintegrate(p,t,d)<br />

I = meshintegrate(p,d)<br />

I = meshintegrate(p)<br />

I = meshintegrate(p,t,d) computes the integral I over the mesh given by p and<br />

t, with values (for each point) in d. d is of size 1-by-np, where np is the number of<br />

points in p (=size(p,2)). The elements are considered to be linear.<br />

Examples Line integral in 2D:<br />

I = meshintegrate(p,d) assumes t=[1,2,3,... (np-1) ; 2,3,4,... np],<br />

(where np=size(p,2)), i.e., that the mesh is a line and that the points in p are<br />

sorted.<br />

I = meshintegrate(p) calls meshintegrate(p(1,:), p(2,:)).<br />

This function is useful for computing integrals along cross-sections plotted with<br />

postcrossplot, in which case p, t and d are extracted from the output when the<br />

property outtype is set to postdata.<br />

% Just set up a problem:<br />

clear fem<br />

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

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

fem.shape = 2; fem.equ.c = 1; fem.equ.f = 1; fem.bnd.h = 1;<br />

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

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

% Make a cross-section plot, with output being a postdata<br />

% structure<br />

pd = postcrossplot(fem,1,[0 1;0 1],'lindata','u',...<br />

'npoints',100,'outtype','postdata');<br />

% Call meshintegrate:<br />

I = meshintegrate(pd.p);<br />

Line integral in 3D:<br />

% Just set up a problem:<br />

clear fem, fem.geom = block3;<br />

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

fem.shape = 2;<br />

fem.equ.c = 1; fem.equ.f = 1;<br />

fem.bnd.h = {1 1 0 0 1 1};<br />

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

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

275

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

Saved successfully!

Ooh no, something went wrong!