Assembly groups allow to build complex structures, such as metalenses for instance, that are made of a large number of copies of similar objects.
[[Note:]] assembly groups have been introduced with the 2024 R1 release.
Elements of an assembly group
An assembly group consists of:
- a prototype
- a list of parameters
- a mapping table
Prototype
The prototype is the single, in-tree, child of the assembly group. It can be a primitive object or a structure group. The assembly group uses this prototype to build the assembly. Therefore, before defining the assembly group, you must first define the prototype.
The prototype (include any variations of it from the mapping table) cannot contain:
- Any 2D geometry
- Any Assembly Group or Layer Builder objects
- Any object that does not have use relative coordinates, such as a primitive shape with “use relative coordinates” unchecked in its “Geometry” tab.
- Any spatially varying material, for example, either non-constant index or an object with a grid attribute name assigned
Parameters
Parameters are stored in a cell array. It corresponds to the list of parameters of the prototype that are used to build the assembly group.
params = {"x", "y", "radius"};
Mapping table
The mapping table is a matrix of (number parameters) x (number of copies) elements, storing the values of parameters for each copy of the prototype.
Creating an assembly group
Ansys Lumerical FDTD™
Assembly groups can be added to the simulation from the “Assembly” button in the “Design” tab.
Ansys Lumerical MODE™
Assembly groups can be added to the simulation from the tool bar, in the "Groups" menu
or using the addassemblygroup - Script command:
addassemblygroup({"name": "assembly_grp"});
Adding the prototype
You can add the prototype to the assembly group either using the user interface, by right-clicking on the object and select "add to group", or by selecting the object and using addtogroup - Script command. Both methods are shown below.
addtogroup("::model::assembly_grp");
Setting parameters and mapping
You can’t set parameters and mappings using the GUI and can only do so using script commands. A simple example to create 4 circles is shown below:
mapping = [0, 2, 0, 1;
0, 0, 2, 1;
1, 0.5, 0.5, 1]*1e-6;
setnamed("assembly_grp", "parameters", params);
setnamed("assembly_grp", "mapping", mapping);
This creates an assembly group made of 4 objects.
In the assembly group property window, the "Info / Error" tab provides some information on the assembly:
- Parameters
- List of parameters
- Number of parameters
- Mapping
- Total number of objects
- Number of unique variations
Note: Rotations and translations are “free variables”. The number of unique variations does not count rotations or translation variables, for example, x or rotation 1.
Here, the assembly is made of 4 objects, but only 2 unique variations (radius of 1um and 0.5um).
Limitations on variations and number of objects
- The assembly group can only handle a maximum of 1024 unique variations. A unique variation is defined by a combination of all variables except for the free variables.
For example, if the parameters arex,y,z, andradius, then the assymble group can have 1024 radius values. However, if the parameters arex,y,z,radius, and z span, the assembly group can only have up to 1024 variations of combinations for radius and z span. - If the assembly contains more than 32000 objects, the structure won't be displayed.
Usage example
The example below creates an assembly group made of 10*10 circles, with random values as their radius.
#Define the dimensions of the grid
N = 10; # Number of elements in the x direction
M = 10; # Number of elements in the y direction
xstep = 1;
ystep = 1;
#Initialize the vectors
A = matrix(N*M, 1);
B = matrix(N*M, 1);
?size(A);
idx = 0;
for (i = 0; i < M; i=i+1) {
for (j = 0; j < N; j=j+1) {
idx = idx + 1;
A(idx) = j * xstep;
B(idx) = i * xstep;
}
}
# Initialize the radius vector
C = matrix(N*M, 1);
#Fill the radius vector with random numbers
for (i = 1; i <= N*M; i=i+1) {
C(i) = (0.15 + 0.3 * rand)/2;
}
#All the matrix dimensions must have the same dimensions AND must be 1D
#the mapping table is a matrix of (n parameters) x (same nb of copies elements)
A = transpose(A);
B = transpose(B);
C = transpose(C);
?size(A);
?size(B);
?size(C);
addassemblygroup({"name": "assembly_grp"});
addcircle;
set("index",2.04+0i);
addtogroup("assembly_grp");
setnamed("assembly_grp", "parameters", {"x", "y", "radius"});
mapping = [A;B;C]*1e-6;
setnamed("assembly_grp", "mapping", mapping);
The script above adds an array like the one shown below.
See also
Structures, Analysis groups, Arrays of objects, addstructuregroup (script command).