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.

elcontact<br />

Cautionary<br />

The elcontact element is only implemented for boundaries. That is, no edge-edge,<br />

edge-boundary or similar contact can be detected and evaluated.<br />

The computation of complete Jacobians rely on the availability of spatial derivatives<br />

of the mapped expression with respect to local coordinate directions. These local<br />

derivatives cannot be calculated for all variables, a notable example being any global<br />

spatial derivatives. Therefore, for expressions like map(uTx) some Jacobian<br />

contributions will be missing.<br />

Examples<br />

Evaluate and display the distance from a hard surface to the closest point of a<br />

cylinder lying on its side on the surface.<br />

clear fem;<br />

fem.geom = ...<br />

rect2(2,0.2,'pos',[-1,-0.2])+circ2(0.8,'pos',[0,0.8]);<br />

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

fem.sshape = 2;<br />

clear el;<br />

el.elem = 'elcontact';<br />

el.g = {'1'};<br />

el.opname = {'map'};<br />

el.gapname = {'gap'};<br />

el.visname = {'vis'};<br />

el.method = 'ball';<br />

el.checkdist = '1';<br />

el.srcframe = {'xy'};<br />

el.srcn = {{'nx','ny'}};<br />

el.dstx = {{'x','y'}};<br />

el.dstn = {{'nx','ny'}};<br />

clear src11<br />

src11.ind = {{'3','4'}};<br />

src11.src = {{'1'}};<br />

el.geomdim{1} = {{},src11};<br />

fem.elem = {el};<br />

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

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

postcrossplot(fem,1,[6 8],'lindata','if(vis,gap,0)',...<br />

'linxdata','if(vis,map(x),sign(x))');<br />

% compare with the theoretical value<br />

hold on;<br />

x=-1:0.05:1;<br />

plot(x,sqrt(x.^2+0.8^2)-0.8,'ro');<br />

56 | CHAPTER 1: COMMAND REFERENCE

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

Saved successfully!

Ooh no, something went wrong!