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:

    1. 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:

    1. xLen: [double], the length of the periodicity in direction in SI unit.
    2. yLen: [double], the length of the periodicity in the other direction in SI unit.
    3. 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 by angle. See the following figure: coordinate system

GetReciprocalLattice()
  • Arguments: None

  • Outputs: ((, ), (, )). Two tuples of the reciprocal lattices in SI unit.

OptSetLatticeTruncation(truncation)
  • Arguments:

    1. 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:

    1. 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.
    2. 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.
    3. angle: the rotated angle with respect to the positive direction in a counterclockwise manner, in degree.
    4. (centerx, centery): [double tuple], the centers of the rectangle pattern in and direction, respectively, in SI unit.
    5. (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:

    1. 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.
    2. 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.
    3. (centerx, centery): [double tuple], the centers of the circle pattern in and direction, respectively, in SI unit.
    4. radius: [double], the radius of the circle pattern in SI unit.
  • Output: None

SetLayerPatternEllipse(layer name, material name, (centerx, centery), angle, (a, b))
  • Arguments:

    1. 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.
    2. 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.
    3. angle: the rotated angle with respect to the positive direction in a counterclockwise manner, in degree.
    4. {centerx, centery}: [double table], the centers of the ellipse pattern in and direction, respectively, in SI unit.
    5. (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:

    1. 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.
    2. 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.
    3. (centerx, centery): [double tuple], the centers of the polygon pattern in and direction, respectively, in SI unit.
    4. angle: the rotated angle with respect to the positive direction in a counterclockwise manner, in degree.
    5. ( (v1_x, v2_x), ..., (vn_x, vn_y) ): [nested double tuples], coordinates of the vertices relative to the center in SI unit.
  • Output: None