As of 2025R1, the RCWA solver in Ansys Lumerical FDTD™ supports repeated layers for efficient simulations of large periodic structures such as volume holographic gratings. When layer repetition is enabled, the solver exploits periodic properties of the layers internally, enabling fast simulations. This page describes the process of setting up layer repetitions and its current limitations. For a detailed example on the application of the layer repetition functionality, see the volume holographic grating example.
Layer Repetition
When the layer repetition function is enabled, the solver will repeat a defined geometric entity, either a fixed number of times, or automatically calculated based on thickness. Both integer and non-integer multiples of layer repetition is allowed. In the case of a non-integer multiple, the layer will be sliced appropriately. The unit cell of repetition can be any geometric object with arbitrary definition of refractive index grading, allowing you to define a large range of periodic structures based on your simulation needs.
In addition, non-repeating layers can be defined surrounding the repeated section, and multiple repeating patterns can be defined as needed by your simulation.
A diagram is shown below illustrating the repetition of a single graded index layer, repeated N+0.5 times, and with two non-repeating layers on the top and bottom of the structure. Colors in the layer represent the refractive index of the material.
Setup and Properties
The following instructions are applicable to 2025 R2 and newer. Before setting up layer repetition, you must first create geometric objects for simulation. All geometric objects support repetition.
To set up layer repetition, consider the figures below. The first figure shows a 3-layer structure that is to be set up for repetition, the second figure shows the layer repetition settings window.
To set up layer repetition:
- In the “Interfaces” Tab of the RCWA Simulation Object, select “interface reference positions.” Layer repetition is not available for the “absolute reference positions” mode.
- Use the “Add” button to add geometric objects to enable them in the simulation. See the Knowledge Base article on RCWA Simulation Object for more information on the interface.
- Select the type of layer repetition. The meaning of each type can be found in the RCWA Simulation Object Knowledge Base article. The selected type will apply to all layers. When an option other than “none” is selected, an additional window appears at the bottom, where layer repetition can be configured.
- Enter the start and end index of desired interfaces to be repeated. The index is the listed number found on the left-most column of the interface table above. All layers between the calculated positions of those indexes will be repeated, in the direction specified from the start to the end
Example: In the screenshot above, everything between interface index 1 (min of rectangle 1) and interface index 3 (min of rectangle 3) will be repeated. This includes the whole of rectangle 2, even though it is further down on the table. For more information on caveats while setting up the table, see the section below. - Set repetition parameter (either multiple or thickness) in the table depending on the repetition type, the other parameter is automatically calculated. If 0 is used for thickness or multiple, that repetition will be ignored.
- Check for errors in the tables. Erroneous inputs are marked by a red outline on the corresponding cell, with an explanation of the error displayed if the mouse is hovered over the cell.
Layer repetition settings have now been applied to the structure, and you can proceed with simulation.
Note: Viewport will not show this repetition visually, see the section below on simulation and display thicknesses for more information
Script Access
The layer repetition options can be accessed via script similarly to other options in the interface menu.
To add interfaces to be enabled in the simulation, a cell array, each element as an entry to the table, should be used. For more information, see the RCWA Simulation Object page.
To access the layer repetition options, the setnamed command can be used to set the layer repetition type, positions, multiple, and thickness. In general, the repetition type should first be set, then the positions, and finally either multiple or thickness depending on the type.
When setting the type, either “multiple” or “thickness” should be picked according to your needs.
Example
setnamed("RCWA","layer repetition","multiple"); # set the layer repetition mode to multiple
When setting the repetition positions, a N×1 matrix should be used for each of the columns. The number of rows, N, represents the number of rows you wish to enter in the table. Extra columns are ignored. If a new row is created from either the start interface or end interface attributes, the row will not be displayed in the GUI window until the both start and end attributes are assigned.
Example
#Set a 2-row repetition. The first repetition is from index 1 to 2, and second one from index 3 to 4.
setnamed("RCWA","layer repetition start interface",[1;3]); #Before assigning the end interface, the layer repetition table will only display one row.
setnamed("RCWA","layer repetition end interface",[2;4]);
When setting the thickness or multiple, a N row column vector should be used. Each row in the vector represents the corresponding thickness or multiple for the repetition. If the thickness vector has more rows than the columns, the extra rows are ignored.
Example
#Set the first repetition above to have a multiple of 2, and the second repetition to have a multiple of 5.
setnamed("RCWA","layer repetition multiple",[2;5]);
While the repetition mode is set to thickness or multiple, setting the other option, for example, setting the thickness when the mode is selected as multiple, will not result in any immediate changes. However, this option will be applied automatically to the table when the mode is changed.
Example
setnamed("RCWA","layer repetition","multiple"); #Set mode to multiple
setnamed("RCWA","layer repetition start interface",[1;3]); #Set positions
setnamed("RCWA","layer repetition end interface",[2;4]);
setnamed("RCWA","layer repetition multiple",[2;5]); #Set the multiples
#Now, attempt to set the thickness for each repetition
#This line is currently ignored, as the mode is set to multiple
setnamed("RCWA","layer repetition thickness",[2e-6;4e-6]);
#However, the above command persists when the mode is changed
setnamed("RCWA","layer repetition","thickness");
#The thickness setting in the new table will be in accordance to the thickness set earlier.
?getnamed("RCWA","layer repetition thickness")
Layer Repetition Rules and Caveats
The following rules and caveats apply when setting up layer repetition:
- When a decimal value is set the number of multiples to repeat, layers will be truncated according to the value. The truncation occurs in the direction of repetition, which is specified by the start and end interfaces in the layer repetition settings table.
- Overlapping ranges are not allowed. If repetition is set up in a way such that the ranges would overlap, a red highlight in the cell will indicate an error.
- When the start position is the same as the end position, that repetition will be ignored.
- When the “Move up”, “Move down,” and “Sort” functions are used, the start interface index and the end interface index in the repetition table does not change, therefore, the repeated layers may change if you move around the interface indices.
Simulation and Display Thicknesses
When repetition is turned on, the simulation is conducted in a different domain than what is displayed in the view port and the object properties. While the simulation is conducted for the entirety of the repeated structure, the view port and the object properties will only display graphics and values corresponding to the single geometric object defined to be repeated.
To differentiate these two domains, the term “simulation z-span” and “simulation z-max” is used. Note that while the term “z” is used, the simulation span always refers to the axis of repetition and propagation, see example below.
Example
Consider a rectangular structure with a length of 1 μm in x, 2 μm in y, and 0.5 μm in z, repeated 10 times. The RCWA simulation domain is made to be bounding exactly the rectangle.
The simulation and display thicknesses are as follows:
| Axis of Propagation | Simulation Spans | Display Spans |
| z |
x: 1 μm y: 2 μm z: 5 μm |
x: 1 μm y: 2 μm z: 0.5 μm |
| x |
x:10 μm y: 2 μm z: 0.5 μm |
x: 1 μm y: 2 μm z: 0.5 μm |
| y |
x: 10 μm y: 2 μm z: 0.5 μm |
x: 1 μm y: 2 μm z: 0.5 μm |
The simulation thickness of the RCWA object can be found under the geometry tab, if the repetition mode is set to an option other than “none”. This property can also be obtained from script using the getnamed command.
Note: Attempting to get “simulation z span” and “simulation z max” while layer repetition is set to “none” will give erroneous values.
Current Limitations
When repetition is turned on, i.e., when the layer repetition option set to anything except for “none”, the following features are not supported and will result in an error:
- RCWA field monitors.
- Reporting of refractive index from RCWA object.
- Non-orthogonal lattice vectors – if “lattice angle” is set to anything except for 90 degrees.
- LI factorization functionality in the RCWA object.
See Also
RCWA Solver - Simulation Object, Application Gallery - Volume Holographic Grating