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.

postcrossplot<br />

postcrossplot(fem,2,6,'surfdata','ux','cont','on',...<br />

'surfedgestyle','k','refine',1,...<br />

'solnum',[1,4,7,11])<br />

Plot along a line intersecting the geometry:<br />

linpts = [-1 1;-1 1;0 1];<br />

postcrossplot(fem,1,linpts,'lindata','u','npoints',100)<br />

Same but with time extrusion:<br />

postcrossplot(fem,1,linpts,'surfdata','u','npoints',100,...<br />

'camlight','on')<br />

Plot along some connected edges:<br />

postcrossplot(fem,1,[4 5 8 11],'lindata','t1x')<br />

% Compare this with the postplot call<br />

postplot(fem,'lindata','t1x','edl',[4 5 8 11],'linbar','on',...<br />

'geom','off')<br />

Point plot on n points in geometry:<br />

n = 30;<br />

pts = [linspace(-1,1,n);linspace(0,1,n);linspace(0,1,n)];<br />

postcrossplot(fem,0,pts,'pointdata','u')<br />

2D Examples<br />

Time-dependent problem (Heat equation)<br />

clear fem<br />

fem.geom = geomcsg({rect2});<br />

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

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

fem.bnd.h = 1;<br />

fem.shape = 2;<br />

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

fem.sol = femtime(fem,'tlist',0:0.01:0.1);<br />

Plot solution along the diagonal for all time-steps:<br />

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

Plot solution at time step 4 in several parallel cross-sections:<br />

postcrossplot(fem,1,[0 1;1 0],'lindata','u*x','solnum',4,...<br />

'spacing',5,'lincolor','r')<br />

Plot along three boundaries for the first five time steps:<br />

postcrossplot(fem,1,[1 2 3],'lindata','ux','cont','on',...<br />

'solnum',1:5)<br />

Same but with time-extrusion:<br />

331

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

Saved successfully!

Ooh no, something went wrong!