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.

elempty<br />

If the ind field is not present in an element structure for an element which accepts<br />

a domain grouping, it is defaulted as if all domains belong to group one. Other fields<br />

can usually be specified either per domain group or using one entry valid for all<br />

groups, whether explicitly specified or defaulted as one single group. Note that this<br />

behavior is not explicitly documented for each element type.<br />

Cautionary<br />

Examples<br />

Adding element syntax contributions bypasses all high-level syntax checks, which<br />

can result in unintelligible error messages or even unexpected termination of a<br />

scripting session.<br />

Create a simple model (Poisson’s equation on unit circle) and extract the element<br />

syntax created by meshextend.<br />

clear fem;<br />

fem.geom = circ2;<br />

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

fem.shape = 2;<br />

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

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

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

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

clear elem;<br />

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

elem{i} = eval(elstr(i));<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 />

The element syntax can be studied, modified and then fed back into the fem.elem<br />

and fem.eleminit fields. An additional call to meshextend with property<br />

'standard' set to 'off' updates the fem.xmesh field before solving.<br />

fem.elem = elem;<br />

fem.eleminit = eleminit;<br />

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

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

postsurf(fem,'u');<br />

An elempty element can be used to force a domain group split, which can be<br />

necessary in some cases where subdomain variables are accessed on boundaries. To<br />

the element syntax created above, the following can be added to split the boundary<br />

into two domain groups.<br />

70 | CHAPTER 1: COMMAND REFERENCE

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

Saved successfully!

Ooh no, something went wrong!