Importing a GDSII Mask File
ViennaPS provides a convenient feature allowing users to import geometries directly from GDSII mask files. It’s important to note that ViennaPS focuses on handling simple geometry information extracted from GDSII files, without supporting additional data that might be stored within the GDSII format.
To parse a GDSII file using ViennaPS, follow these steps:
-
Create a
ps::GDSGeometry
Object: Initialize aps::GDSGeometry
object, specifying the desired grid spacing, boundary conditions, and additional padding (optional).auto mask = ps::SmartPointer<ps::GDSGeometry<NumericType, D>>::New(); mask->setGridDelta(gridDelta); mask->setBoundaryConditions(boundaryConds); mask->setBoundaryPadding(xPad, yPad);
Replace
gridDelta
,boundaryConds
, andxPad
,yPad
with your preferred values. The geometry is always parsed on a plane normal to the z direction. The values ofxPad
andyPad
are always added to the largest and subtracted from the smallest extension of all geometries in the GDSII file. -
Use
ps::GDSReader
to Parse Geometry: Utilize theps::GDSReader
to parse the GDSII file into the previously createdps::GDSGeometry
object.ps::GDSReader<NumericType, D>(mask, "path/to/your/file.gds").apply();
Replace
"path/to/your/file.gds"
with the actual path to your GDSII file. -
Convert Single Layers to Level Sets: Extract specific layers from the parsed GDSII geometry, convert them into level sets, and add them to your simulation domain. To access a particular layer, provide its GDSII layer number.
// Create new domain auto domain = ps::SmartPointer<ps::Domain<NumericType, D>>::New(); // Convert the layer to a level set and add it to the domain. auto layer = mask->layerToLevelSet(0 /*layer*/, 0 /*base z position*/, 0.5 /*height*/); domain->insertNextLevelSet(layer);
Replace
layerNumber
with the GDSII layer number you wish to access.Layers can also be inverted to be used a mask.
// Create new domain auto domain = ps::SmartPointer<ps::Domain<NumericType, D>>::New(); // Convert the inverted layer to a level set and add it to the domain. auto layer = mask->layerToLevelSet(0 /*layer*/, 0 /*base z position*/, 0.5 /*height*/, true /*invert*/); domain->insertNextLevelSetAsMaterial(layer, ps::Material::Mask); // Create substrate underneath the mask ps::MakePlane<NumericType, D>(domain, 0. /*base z position*/, ps::Material::Si).apply();