The dataset builder button opens a wizard that enables the user to create an unstructured dataset and then (if appropriate) use the data to build structures and doping objects (in CHARGE only). It also generates a script file that can later be used to perform the same task using only the script environment. The dataset builder is powerful tool that facilitates the use of finite-element data imported into Lumerical's optical and electrical solvers.
Geometries and doping profiles can be created using 2D or 3D finite element data imported into the script workspace of FDTD, MODE, or CHARGE. The advantage of using the dataset builder is that the finite-element data can be imported from a variety of supported formats such as HDF5 (.h5), matlab data (.mat), tecplot (.dat), or Lumerical data file (.ldf), before being used to build unstructured datasets (and eventually complex structures and doping profiles).
The following example shows how the dataset builder can be used to create an unstructured dataset and build a structure along with its doping profile using data imported from an HDF5 file. The example is created in CHARGE. However, the work-flow will be identical in FDTD and MODE.
Unstructured dataset and finite-element data
The unstructured dataset is a useful format to store spatial data that is defined on a finite-element grid. A finite-element grid consists of triangles (in 2D) or tetrahedrons (in 3D), more commonly known as elements. The data is stored at the vertices of these elements and usually has a dimension of Nx1 (for unparameterized data), where N is the number of verteices. Three vertex matrices x, y, and z contains the x, y, and z coordinates of all the vertices, respectively, and have same the dimension of Nx1. Unlike rectilinear data where only the spatial data and the x, y, z coordinates are sufficient, in a finite-element grid, an additional matrix is needed to properly describe the spatial data, which is called the connectivity matrix. The connectivity matrix contains information about all the elements and stores the index of the vertices that create each of the elements. The dimension of the connectivity matrix is Mx3 (for 2D triangles) or Mx4 (for 3D tetrahedrons), where M is the number of elements in the finite-element grid. In the following figure, the different elements (triangles) and vertices of a (2D) finite-element space are shown along with the connectivity and vertex matrices.
Apart from the fact that the unstructured dataset holds finite-element data, it behaves similar to the rectilinear datasets used in Lumerical's solvers. The dataset can be parameterized and it can have an arbitrary number of attributes (spatial data) and parameters. For details about the different datasets used in Lumerical's solvers, refer to the Datasets page.
Import finite element data into the workspace
The dataset builder works with the data available in the script workspace. Therefore, the data must be imported into the workspace before the dataset builder is used. In this example, we will import the finite element data from an HDF5 file. However, other file formats can also be used to import the necessary finite element data.
Download the "readh5file.lsf" script file and the "processdata.h5" HDF5 file. Open the script file in CHARGE and run it. The script will read the data and save the variables in the workspace. Note that the script prints the units for doping and dimension in the script prompt. For a detailed discussion on how to read HDF5 files, please refer to the knowledge base page related to reading HDF5 files.
Unit of doping is cm^-3
Unit of dimension is meter
Below is a screenshot of the script workspace after the data has been imported from the HDF5 file.
Build the unstructured dataset
Click on the build button in the CHARGE interface and select the dataset builder . This will open up the dataset builder wizard.
To get started, select the dimension of the finite element data. In this example, we will create a 3D structure, so select the 3D option.
Select the connectivity matrix
Next select the connectivity matrix. The dataset builder wizard will automatically filter out the irrelevant matrices and will show only the matrices that have the proper values (integer) and dimension to be used as a connectivity matrix for 3D finite element data.
Note: Sometimes the imported data may use a '0' based indexing. For such cases, enable the "enforce to 1-based indexing" option to make the data compatible with the 1-based indexing used by Lumerical's solvers.
Select the vertex matrix / vertex table
The next step would be to select the vertex matrix or the vertex table containing the x, y, and z coordinates of the vertices. The wizard will again show only the matrices that have the proper dimension for the vertex matrix or the vertex table based on the selected connectivity matrix. The imported data in this example contains the x, y, z vertex matrices. They can be loaded on to the appropriate coordinates by using the arrow buttons. Once all the matrices are loaded, the wizard will show the x, y, z extent in the visualization window at the bottom.
Once the vertex matrices are selected, the wizard will give the option to select the unit of the geometric data, change the orientation of the geometry by switching the coordinates, and mirror the geometry along any direction.
We will select the unit to be meter as our imported data is in meter (recall the information provided by the script). Note that for the "meter" selection, the scaling factor is 1e0 since in CHARGE (and also in the optical solvers), dimension is expressed in meter (SI unit). The user also has the option to select a custom scaling factor for their geometric data by selecting the custom scaling option from the drop down menu.
Once the unit has been selected, the visualization window will show the proper dimension of the geometry in micron which is the default dimension for length in the CAD environment.
Note: Please note that the default unit for length in the CAD environment is micron. The user has the option to change this unit from the "Setting" tab. However, the dimension data saved by CHARGE and the unit for length that is used for all calculations in the script environment is in meter (SI unit).
Often, the values (attributes) in an unstructured dataset are saved as functions of some parameters such a bias voltage, temperature, etc. The next step in the dataset builder wizard is to select the parameters for the dataset being built. If no parameters are selected then the dataset builder assigns an empty parameter to the dataset for visualization purpose. Since the data in this example has no parameters, we select the "use default parameter" option. To learn more about parameters, check the Datasets page.
The next step is to select the attributes. Based on the selection of the vertex matrix and the parameters, the dataset builder wizard will again filter the matrices in the script workspace and only the matrices that have the proper dimension will be viewed in the window. The user has the ability to select more than one attribute for a single unstructured dataset. In our imported HDF5 file, we have only one attribute which is the doping profile of the structure, N. We will select this matrix as our attribute in this step.
Save unstructured dataset
Finally, the unstructured dataset is ready to be created. To do this, simply choose a name for the dataset and click "Finish."
Visualize the unstructured dataset
Once the dataset is created, it can be viewed in the visualization window. To do this, right click on the dataset in the script workspace and click "Visualize."
Build structures and doping objects
In the final page of the dataset builder wizard, there are options to create structures and doping profiles based on the unstructured dataset. To use this feature, enable the check boxes for "Create structure" and/or "Create doping import" (CHARGE only) and then click "Next."
If the "Create structure" option is enabled, the wizard moves to a new window where the structure can be named and a material can be assigned to it. For our structure, we choose the name "silicon" and the material "Si (Silicon)" from the drop down menu. Please note that the window also provides the option to override the default mesh order for the structure. In FDTD (and MODE), this window is different and has different fields to set the material properties appropriate for the corresponding solvers. A screenshot of the same window in FDTD is also shown below.
Create import doping (in CHARGE only)
If the "Create doping import" option is enabled, the wizard opens up a new window asking for the following inputs, i) the attributes that will be used to create the import doping objects, ii) the names of the import doping objects, iii) the units of doping in the used data, and iv) the doping types (n or p type). In this example, we have imported n-type doping values and the unit of the doping is cm^-3 (recall the information provided by the script). So we will choose the unit to be cm^-3 and the doping type to be "n." Please note that there is a scaling factor of 1e6 when we choose the unit to be cm^-3. This is because CHARGE uses a unit of m^-3 (SI unit) while creating the import doping objects.
The final window of the dataset builder also provides the option to create a script file that can perform the same tasks as the wizard using the choices made at different steps. This feature is very useful in automating the whole process of building datasets and creating structures and doping objects when generating complex structures from a large number of imported data. The script file script_out.lsf was created using the dataset builder and it can be used to perform all the tasks described in the preceding steps.
Test the created structure and doping profile
In order to check whether the structure has been created properly and the doping has been applied to the structure accurately, we can add a simulation region to the CAD environment to encompass the structure. In order to ensure that the entire simulation region has a material in it, we can create a background oxide that covers both the structure and the Device region. We will use the mesh override option to ensure that the oxide only fills the empty spaces and do not occupy the space where the (silicon) structure is present. Once the oxide and the Device region are in place, calculate the mesh only and right click on Device region to visualize the grid. The doping (N) plot will show whether the doping has been applied to the structure accurately.
In the attached "DSB_test.ldev" file, the background oxide and Device region has already been created. In order to see the resulting structure and doping, download and open the file along with the script_out.lsf script file. Open the CHARGE file and run the script. Once all the structures are generated, calculate the mesh, and visualize the grid from the Device region
The following commands can also be used to create an unstructured dataset in the script environment and create structures and import doping objects. These are the key command used in the script generated by the dataset builder.