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.

elepspec<br />

Examples<br />

Given a single-geometry fem structure with an xmesh field, extract elements and<br />

add an additional pattern that can be used by other elements and update the xmesh.<br />

elstr = fem.xmesh.getElements;<br />

clear elem;<br />

for i=1:length(elstr)<br />

elem{i} = eval(elstr(i));<br />

if strcmp(elem{i}.elem,'elepspec')<br />

iepspec = i;<br />

end<br />

end<br />

elstr = fem.xmesh.getInitElements;<br />

clear eleminit;<br />

for i=1:length(elstr)<br />

eleminit{i} = eval(elstr(i));<br />

end<br />

newptrn = length(elem{iepspec}.geom{1}.ep)+1;<br />

elem{iepspec}.geom{1}.ep{newptrn} = {'s(1)' {{'0.5'}}};<br />

fem.elem = elem;<br />

fem.eleminit = eleminit;<br />

Here, additional elements using the constraint pattern with index newptrn can be<br />

added to the fem.elem field.<br />

fem.xmesh = meshextend(fem,'standard','off');<br />

See Also<br />

elempty, elgpspec, elshape, elpconstr, elcconstr<br />

73

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

Saved successfully!

Ooh no, something went wrong!