SimulationPattern
The SimulationPattern class can be initiated in python script by
from MESH import SimulationPattern s = SimulationPattern()
All of the function provided in base class can be used.
Note
The following functions are added and specific to SimulationPattern
object.
SetNumOfG(nG)
-
Arguments:
- nG: [int], the number of total Fourier components in both directions. Note this nG might not be the true nG used in the simulation.
-
Output: None
GetNumOfG()
-
Arguments: None
-
Output: number of G. If function
InitSimulation
has been called, then this function returns the true nG used in the simulation, otherwise return the user input nG.
SetLattice(xLen, yLen, angle)
-
Arguments:
- xLen: [double], the length of the periodicity in direction in SI unit.
- yLen: [double], the length of the periodicity in the other direction in SI unit.
- angle: the angle between the two lattice axises, in degree.
-
Output: None
-
Note: MESH handles the case when one of the real space lattice is aligned with axis (with length
xLen
), and the other axis should be in the upper plane. The angle between the two axises are specified byangle
. See the following figure:
GetReciprocalLattice()
-
Arguments: None
-
Outputs: ((, ), (, )). Two tuples of the reciprocal lattices in SI unit.
OptSetLatticeTruncation(truncation)
-
Arguments:
- truncation: [string], the truncation method for the reciprocal lattice. Should be one of "Circular" or "Parallelogramic".
-
Output: None
SetLayerPatternRectangle(layer name, material name, (centerx, centery), angle, (widthx, widthy))
-
Arguments:
- layer name: [string], the layer that this rectangle pattern will be embedded. Such layer should already exist in the simulation, otherwise an error message will be printed out.
- material name: [string], the material used as the rectangle pattern. Such material should already exist in the simulation, otherwise an error message will be printed out.
- angle: the rotated angle with respect to the positive direction in a counterclockwise manner, in degree.
- (centerx, centery): [double tuple], the centers of the rectangle pattern in and direction, respectively, in SI unit.
- (widthx, widthy): [double tuple], the widths of the rectangle pattern in and direction, respectively, in SI unit.
-
Output: None
SetLayerPatternCircle(layer name, material name, (centerx, centery), radius)
-
Arguments:
- layer name: [string], the layer that this circle pattern will be embedded. Such layer should already exist in the simulation, otherwise an error message will be printed out.
- material name: [string], the material used as the circle pattern. Such material should already exist in the simulation, otherwise an error message will be printed out.
- (centerx, centery): [double tuple], the centers of the circle pattern in and direction, respectively, in SI unit.
- radius: [double], the radius of the circle pattern in SI unit.
-
Output: None
SetLayerPatternEllipse(layer name, material name, (centerx, centery), angle, (a, b))
-
Arguments:
- layer name: [string], the layer that this ellipse pattern will be embedded. Such layer should already exist in the simulation, otherwise an error message will be printed out.
- material name: [string], the material used as the ellipse pattern. Such material should already exist in the simulation, otherwise an error message will be printed out.
- angle: the rotated angle with respect to the positive direction in a counterclockwise manner, in degree.
- {centerx, centery}: [double table], the centers of the ellipse pattern in and direction, respectively, in SI unit.
- (a, b): [double], the half widths the ellipse pattern in SI unit.
-
Output: None
-
Note: the ellipse with angle is written as:
SetLayerPatternPolygon(layer name, material name, (centerx, centery), angle, ( (v1_x, v2_x), ..., (vn_x, vn_y) ))
-
Arguments:
- layer name: [string], the layer that this polygon pattern will be embedded. Such layer should already exist in the simulation, otherwise an error message will be printed out.
- material name: [string], the material used as the polygon pattern. Such material should already exist in the simulation, otherwise an error message will be printed out.
- (centerx, centery): [double tuple], the centers of the polygon pattern in and direction, respectively, in SI unit.
- angle: the rotated angle with respect to the positive direction in a counterclockwise manner, in degree.
- ( (v1_x, v2_x), ..., (vn_x, vn_y) ): [nested double tuples], coordinates of the vertices relative to the center in SI unit.
-
Output: None