Different types of variable a available in Lumerical’s scripting:
Strings can be used to define a file name, for instance, or a material.
Numbers can be used to define dimensions, wavelength, etc.
Arrays or matrices can be used, for instance, to define a frequency vector or to store a
Datasets are typically used to store results from monitors.
Matrix datasets contain a data without spatial parameters while rectilinear datasets contain
data with spatial information from a rectilinear grid (such as the FDTD mesh, for instance).
Unstructured spatial datasets can be used to store data with spatial information on
a finite element mesh (for instance, a calculation result from DEVICE) and arbitrary unstructured
datasets can store any kind of data type.
Lastly, structure array and cell array can store any type of data elements.
Note that cell arrays have a defined number of elements.
Lumerical’s scripting includes a set of predefined constants: the number pi, the speed
of light in vacuum, the permittivity and permeability of free space, the Plank constant, the reduced
Plank constant, the logical TRUE and FALSE, and the electron volt.
Remember: the variable names and the constant names are case sensitive: if you type h=1.3,
you will get an error as you are trying to assign a value to a constant.
You do not have to declare the variables before using them.
You can assign a value directly, using the “=” operator.
In the next unit, we will cover how you can initialize variables depending on their type.