Array
Create a block-shaped (3D), rectangular (2D, 3D), or linear array of geometry objects.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"Array");
model.component(<ctag>).geom(<tag>).feature(<ftag>).selection(property);
model.component(<ctag>).geom(<tag>).feature(<ftag>).set(property,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getType(property);
model.component(<ctag>).geom(<tag>).feature(<ftag>).setAttribute(attribute,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getAttribute(attribute);
Description
Use model.component(<ctag>).geom(<tag>).create(<ftag>,"Array") to create an array of geometry objects.
Use model.component(<ctag>).geom(<tag>).feature(<ftag>).selection("input") to select the objects to array. The default selection is empty.
The following properties are available:L
on | off
linear | rectangular | three-dimensional
rectangular or three-dimensional
Specify the type of array for sdim 2 and 3. For sdim=2, use rectangular or linear. For sdim=3, use three-dimensional or linear.
{1,1} or {1,1,1}
Specify array size. Used when type is rectangular or three-dimensional.
on | off
Tag of index attribute. Used if indexattr is on and the space dimension is 1 or type is linear.
Tags of index attributes. Used if indexattr is on and type is rectangular (sdim=2) or three-dimensional (sdim=3).
on | off
all | obj | dom | bnd | edg | pnt | off
Show selections, if selresult is on, in physics, materials, and so on; in part instances; or in 3D from a plane geometry. obj is not available in a component’s geometry. dom, bnd, and edg are not available in all features.
none | custom | integer between 1 and the number of colors in the current theme
The color to use. Active when color is set to custom.
1D and when type is linear: A linear (oblique) array with size or linearsize copies of the input objects is constructed. The displacement between two consecutive copies is given by the vector displ. The names of the output objects are ftag(i), where ftag is the tag of the feature, and i is a 1-based index. If there are more than one input object, the output objects are named ftag(i,in), where in is a 1-based index corresponding to the input objects.
2D: If type is rectangular, a rectangular array with fullsize[0]-by-fullsize[1] copies of the input object is constructed. The x- and y-displacements are displ[0] and displ[1], respectively. The names of the output objects are ftag(i1,i2), where ftag is the name of the feature, and i1 and i2 are 1-based indices. If there are more than one input object, the output objects are named ftag(i1,i2,in), where in is a 1-based index corresponding to the input objects.
3D: If type is three-dimensional, a three-dimensional (block shaped) array with fullsize[0]-by-fullsize[1]-by-fullsize[2] copies of the input object is constructed. The x-, y-, and z-displacements are displ[0], displ[1], and displ[2], respectively. The names of the output objects are ftag(i1,i2,i3), where ftag is the name of the feature, and i1, i2, and i3 are 1-based indices. If there are more than one input object, the output objects are named ftag(i1,i2,i3,in), where in is a 1-based index corresponding to the input objects.
The input object is deleted and an identical object is constructed as a part of the array.
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
Additional properties are available with the Design Module, see Array.
The following attributes are available:
Table 3-28: Valid attributes
on | off | inherit
Designate the resulting objects as construction geometry. Use inherit to set the construction geometry attribute only if all input objects are construction geometry.
Compatibility
In COMSOL Multiphysics 5.2, the selresult property replaced the createselection property. createselection is still supported for backward compatibility.
model.geom(<tag>).create(<ftag>,"arrayr") constructs an Array feature
Example
The following sequence creates a block with four equally-sized holes:
Code for Use with Java
Model model = ModelUtil.create("Model1");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1", 3);
g.create("cyl1","Cylinder");
g.create("arr1","Array");
g.feature("arr1").selection("input").set("cyl1");
g.feature("arr1").set("displ", "4 4 0");
g.feature("arr1").set("size", "2 2 1");
g.create("blk1","Block");
g.feature("blk1").set("size", "10 14 5");
g.feature("blk1").set("pos", "-3 -5 -4");
g.create("dif1","Difference");
g.feature("dif1").selection("input").set("blk1");
g.feature("dif1").selection("input2").set("arr1");
g.run();
Code for Use with MATLAB
model = ModelUtil.create('Model1');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1',3);
g.create('cyl1','Cylinder');
g.create('arr1','Array');
g.feature('arr1').selection('input').set('cyl1');
g.feature('arr1').set('displ', '4 4 0');
g.feature('arr1').set('size', '2 2 1');
g.create('blk1','Block');
g.feature('blk1').set('size', '10 14 5');
g.feature('blk1').set('pos', '-3 -5 -4');
g.create('dif1','Difference');
g.feature('dif1').selection('input').set('blk1');
g.feature('dif1').selection('input2').set('arr1');
g.run;
See Also
Move, Copy