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);
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:
Table 3-27: Valid Properties
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.
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.
If size is a scalar, a linear (oblique) array with size 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 size is an array of length 2, a rectangular array with size[0]-by-size[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 size is an array of length 3, a three-dimensional (block shaped) array with size[0]-by-size[1]-by-size[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.
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