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.

geomcsg<br />

TABLE 1-57: GEOMETRY MODEL OR DRAW STRUCTURE<br />

FIELD 1D 2D 3D DESCRIPTION<br />

f.name ♦ Cell array of names (ignored by<br />

geomcsg)<br />

c.objs ♦ ♦ Cell array of curve objects.<br />

c.name ♦ ♦ Cell array of names (ignored by<br />

geomcsg)<br />

p.objs ♦ ♦ ♦ Cell array of point objects.<br />

p.name ♦ ♦ ♦ Cell array of names (ignored by<br />

geomcsg)<br />

Examples<br />

3D Geometries<br />

Perform a solid operation on two intersecting cylinders:<br />

s1=cylinder3(2,2,[0.5 0.5 -1],[0 0 1]);<br />

s2=cylinder3(1,1,[0.5 0.5 -0.5],[0 0 1]);<br />

[g,st,stx]=geomcsg({s1,s2},'out',{'g','st','stx'},...<br />

'ns',{'Cyl1','Cyl2'},'sf','Cyl1-Cyl2');<br />

To easily create solid objects, use the overloaded operators +, *, and -, instead of<br />

calling geomcsg:<br />

s=s1-s2;<br />

geomplot(s,'facemode','off')<br />

s and g are equivalent, except that g is a geom3 object while s is a solid3 object.<br />

2D Geometries<br />

Create a unit circle solid object and a unit square solid object:<br />

c1 = circ2;<br />

sq1 = square2;<br />

g = geomcsg({c1 sq1},{},'ns',{'a' 'b'},'sf','a-b');<br />

Using object arithmetic for solid objects, the same result can be obtained by typing.<br />

g = c1-sq1;<br />

You can plot the geometry object by<br />

geomplot(g,'sublabel','on','edgelabel','on')<br />

or just<br />

geomplot(g)<br />

You can obtain the number of subdomains and edge segment by just typing g or by<br />

explicitly getting the object properties.<br />

209

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

Saved successfully!

Ooh no, something went wrong!