Copy
Copy a mesh between edges, boundaries, domains, or between different meshing sequences.
Syntax
model.component(<ctag>).mesh(<tag>).create(<ftag>,"Copy");
model.component(<ctag>).mesh(<tag>).feature(<ftag>).selection(property);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).create(<ftag1>,maptype);
Description
Use model.component(<ctag>).mesh(<tag>).create(<ftag>,"Copy") to copy a mesh between meshing sequences. Any meshing sequence can be used as the source of the operation, whereas the destination sequence cannot contain an imported mesh. The dimension of the source sequence must be less than or equal to the dimension of the destination sequence.
The following properties are available (for 1D meshes, only the mesh property is available):
auto | singlecopy | arraycopy
all, 1, 2, or 3 (in 3D)
2 in 2D, 3 in 3D
Specifies the dimension for the operation. all means that the entire mesh should be copied.
on | off
on | off
Use the properties source and destination to specify the geometric entities of the source and destination (except when the dimension is set to copy the entire geometry). The copymethod property determines which type of copy is used: single copy (all-to-one), array copy (one-to-one), or automatic detection. The value auto lets the software choose between single copy (all-to-one), array copy (one-to-one), or a mixture of the two.
Example
The following example shows how to use the Copy feature with a modified geometry from an imported mesh:
Code for Use with Java
Model model = ModelUtil.create("Model");
model.component().create("comp1");
GeomSequence geom1 = model.component("comp1").geom().create("geom1", 2);
geom1.create("c1", "Circle");
MeshSequence mesh1 = model.component("comp1").mesh().create("mesh1", "geom1");
mesh1.run();
 
model.component().create("comp2");
GeomSequence geom2 = model.component("comp2").geom().create("geom2", 2);
GeomFeature imp1 = geom2.create("imp1", "Import");
imp1.set("type", "mesh");
imp1.set("mesh", "mesh1");
GeomFeature r1 = geom2.create("r1", "Rectangle");
r1.set("size", new String[]{"3", "3"});
r1.set("base", "center");
 
MeshSequence mesh2 = model.component("comp2").mesh().create("mesh2", "geom2");
MeshFeature copy1 = mesh2.create("copy1", "Copy");
copy1.set("mesh", "mesh1");
copy1.set("dimension", 2);
copy1.selection("source").set(1);
copy1.selection("destination").set(2);
mesh2.run();
Code for Use with MATLAB
model = ModelUtil.create('Model');
model.component.create('comp1');
geom1 = model.component('comp1').geom.create('geom1', 2);
geom1.create('c1', 'Circle');
mesh1 = model.component('comp1').mesh.create('mesh1', 'geom1');
mesh1.run;
 
model.component.create('comp2');
geom2 = model.component('comp2').geom.create('geom2', 2);
imp1 = geom2.create('imp1', 'Import');
imp1.set('type', 'mesh');
imp1.set('mesh', 'mesh1');
r1 = geom2.create('r1', 'Rectangle');
r1.set('size', {'3', '3'});
r1.set('base', 'center');
 
mesh2 = model.component('comp2').mesh.create('mesh2', 'geom2');
copy1 = mesh2.create('copy1', 'Copy');
copy1.set('mesh', 'mesh1');
copy1.set('dimension', 2);
copy1.selection('source').set(1);
copy1.selection('destination').set(2);
mesh2.run;
See Also
CopyEdge, CopyFace, CopyDomain