38. lepm.build.build_hexagonal

Description here

38.1. Example Usage

38.2. Overview

38.3. Classes and Functions

lepm.build.build_hexagonal.add_PV(ind, want, xypts, LVUC, PV, NL, KL, BL, PVx, PVy, PVxydict, msg='', check=False)[source]
Parameters:

ind :

want :

xypts :

LVUC :

PV :

NL :

KL :

PVx :

PVy :

PVxydict :

msg :

check :

lepm.build.build_hexagonal.build_accordionhex(lp)[source]

Build hexagonal-like lattice, replacing each bond with a zigzag set of bonds

Parameters:

lp : dict

lattice parameters dictionary

Returns:

xy, NL, KL, BL, PVx, PVy, PVxydict, LVUC, BBox, LL, LV, UC, lattice_exten, lp :

lepm.build.build_hexagonal.build_frame1dhex(lp)[source]

Generate the boundary of a hexagonal lattice, with no bulk.

Parameters:lp :
lepm.build.build_hexagonal.build_hexagonal(lp)[source]

Create a hexagonal lattice using lattice parameters lp. Note that either ‘delta’ (a float, opening angle in radians) or ‘delta_lattice’ (a string, angle in units of pi) must be in lp

Parameters:lp :
lepm.build.build_hexagonal.build_hexjunction(lp)[source]

Create a Y junction of gyros, with accordionized bonds going in and out

Parameters:lp :
lepm.build.build_hexagonal.build_hexmeanfield(lp)[source]
Parameters:lp :
lepm.build.build_hexagonal.build_hexmeanfield3gyro(lp)[source]
Parameters:lp :
lepm.build.build_hexagonal.generate_flattened_honeycomb_lattice(lp)[source]

Generates hexagonal lattice with two different bond lengths on the sides and top of each hexagon. The ratio between the long and the short one is given by aratio, and the long one is length unity. (returns points, connectivity, name). This is the first step in making the Cairo lattice.

Parameters:

lp : dict

lattice parameters with key, value pairs: shape : string or dict with keys ‘description’:string and ‘polygon’:polygon array

Global shape of the mesh, in form ‘square’, ‘hexagon’, etc or as a dictionary with keys shape[‘description’] = the string to name the custom polygon, and shape[‘polygon’] = 2d numpy array

NH : int

Number of pts along horizontal. If shape=’hexagon’, this is the width (in cells) of the bottom side (a)

NV : int

Number of pts along vertical, or 2x the number of rows of lattice

aratio : float

ratio between long and short lines, with long one of length unity.

delta : float

Deformation angle for the lattice in degrees (for undeformed hexagonal lattice, this is 0.66666*np.pi)

phi : float

Shear angle for the lattice in radians, must be less than pi/2 (for undeformed hexagonal lattice, this is 0.000)

eta : float

randomization of the lattice (a scaling of random jitter in units of lattice spacing)

rot : float

angle in units of pi to rotate the lattice vectors and unit cell

periodicBC : bool

Whether to apply periodic boundaries to the network

check : bool

Whether to plot output at intermediate steps

Returns:

xy : matrix of dimension nx2

Equilibrium lattice positions

NL : matrix of dimension n x (max number of neighbors)

Each row corresponds to a gyroscope. The entries tell the numbers of the neighboring gyroscopes

KL : matrix of dimension n x (max number of neighbors)

Correponds to Ni matrix. 1 corresponds to a true connection while 0 signifies that there is not a connection

BL : array of dimension #bonds x 2

Each row is a bond and contains indices of connected points

lattice_exten : string

description of the lattice, complete with parameters for properly saving the lattice files

LV : 3 x 2 float array

Lattice vectors for the kagome lattice with input twist angle

UC : 6 x 2 float array

(extended) unit cell vectors

PVxydict : dict

dictionary of periodic bonds (keys) to periodic vectors (values) If key = (i,j) and val = np.array([ 5.0,2.0]), then particle i sees particle j at xy[j]+val –> transforms into: ijth element of PVx is the x-component of the vector taking NL[i,j] to its image as seen by particle i

PVx : NP x NN float array

ijth element of PVx is the x-component of the vector taking NL[i,j] to its image as seen by particle i If NL and KL are remade, PVx will not be ordered properly: use dict instead

PVy : NP x NN float array

ijth element of PVy is the y-component of the vector taking NL[i,j] to its image as seen by particle i If NL and KL are remade, PVy will not be ordered properly: use dict instead

LVUC : NP x 3 array

Lattice vectors and (extended) unit cell vectors defining relative position of each point, as integer multiples of LV[0] and LV[1], and UC[LVUC[i,2]] For instance, xy[0,:] = LV[0]*LVUC[0,0] + LV[1]*LVUC[0,1] + UC[LVUC[0,2]]

lepm.build.build_hexagonal.generate_honeycomb_lattice(lp)[source]

Generates hexagonal lattice (points, connectivity, name).

Parameters:

lp : dict

lattice parameters dictionary, with keys:

shape : string or dict with keys ‘description’:string and ‘polygon’:polygon array

Global shape of the mesh, in form ‘square’, ‘hexagon’, etc or as a dictionary with keys shape[‘description’] = the string to name the custom polygon, and shape[‘polygon’] = 2d numpy array

NH : int

Number of pts along horizontal. If shape=’hexagon’, this is the width (in cells) of the bottom side (a)

NV : int

Number of pts along vertical, or 2x the number of rows of lattice

delta : float

Deformation angle for the lattice in degrees (for undeformed hexagonal lattice, this is 0.66666*np.pi)

phi : float

Shear angle for the lattice in radians, must be less than pi/2 (for undeformed hexagonal lattice, this is 0.000)

eta : float

randomization of the lattice (a scaling of random jitter in units of lattice spacing)

rot : float

angle in units of pi to rotate the lattice vectors and unit cell

periodicBC : bool

Wether to apply periodic boundaries to the network

check : bool

Wehter to plot output at intermediate steps

Returns:

xy : matrix of dimension nx2

Equilibrium lattice positions

NL : matrix of dimension n x (max number of neighbors)

Each row corresponds to a gyroscope. The entries tell the numbers of the neighboring gyroscopes

KL : matrix of dimension n x (max number of neighbors)

Correponds to Ni matrix. 1 corresponds to a true connection while 0 signifies that there is not a connection

BL : array of dimension #bonds x 2

Each row is a bond and contains indices of connected points

lattice_exten : string

description of the lattice, complete with parameters for properly saving the lattice files

LV : 3 x 2 float array

Lattice vectors for the kagome lattice with input twist angle

UC : 6 x 2 float array

(extended) unit cell vectors

PVxydict : dict

dictionary of periodic bonds (keys) to periodic vectors (values) If key = (i,j) and val = np.array([ 5.0,2.0]), then particle i sees particle j at xy[j]+val –> transforms into: ijth element of PVx is the x-component of the vector taking NL[i,j] to its image as seen by particle i

PVx : NP x NN float array

ijth element of PVx is the x-component of the vector taking NL[i,j] to its image as seen by particle i If NL and KL are remade, PVx will not be ordered properly: use dict instead

PVy : NP x NN float array

ijth element of PVy is the y-component of the vector taking NL[i,j] to its image as seen by particle i If NL and KL are remade, PVy will not be ordered properly: use dict instead

LVUC : NP x 3 array

Lattice vectors and (extended) unit cell vectors defining relative position of each point, as integer multiples of LV[0] and LV[1], and UC[LVUC[i,2]] For instance, xy[0,:] = LV[0]*LVUC[0,0] + LV[1]*LVUC[0,1] + UC[LVUC[0,2]]

lepm.build.build_hexagonal.generate_honeycomb_strip(lp)[source]

Generates hexagonal strip that is only one cell wide in at least one of the dimensions. Note that this also handles creating the honeycomb unitcell.

Parameters:

lp : dict

lattice parameters dictionary, with keys: shape : string

Global shape of the mesh, in form ‘square’, ‘hexagon’, etc or as a dictionary with keys shape[‘description’] = the string to name the custom polygon, and shape[‘polygon’] = 2d numpy array However, since this is a strip, it really only makes sense to use ‘square’

NH : int

Number of pts along horizontal. If shape=’hexagon’, this is the width (in cells) of the bottom side (a)

NV : int

Number of pts along vertical, or 2x the number of rows of lattice

delta : float

Deformation angle for the lattice in degrees (for undeformed hexagonal lattice, this is 0.66666*np.pi)

phi : float

Shear angle for the lattice in radians, must be less than pi/2 (for undeformed hexagonal lattice, this is 0.000)

eta : float

randomization of the lattice (a scaling of random jitter in units of lattice spacing)

rot : float

angle in units of pi to rotate the lattice vectors and unit cell

periodicBC : bool

Wether to apply periodic boundaries to the network

check : bool

Wehter to plot output at intermediate steps

Returns:

xy : matrix of dimension nx2

Equilibrium lattice positions

NL : matrix of dimension n x (max number of neighbors)

Each row corresponds to a gyroscope. The entries tell the numbers of the neighboring gyroscopes

KL : matrix of dimension n x (max number of neighbors)

Correponds to Ni matrix. 1 corresponds to a true connection while 0 signifies that there is not a connection

BL : array of dimension #bonds x 2

Each row is a bond and contains indices of connected points

lattice_exten : string

description of the lattice, complete with parameters for properly saving the lattice files

LV : 3 x 2 float array

Lattice vectors for the kagome lattice with input twist angle

UC : 6 x 2 float array

(extended) unit cell vectors

PVxydict : dict

dictionary of periodic bonds (keys) to periodic vectors (values) If key = (i,j) and val = np.array([ 5.0,2.0]), then particle i sees particle j at xy[j]+val –> transforms into: ijth element of PVx is the x-component of the vector taking NL[i,j] to its image as seen by particle i

PVx : NP x NN float array

ijth element of PVx is the x-component of the vector taking NL[i,j] to its image as seen by particle i If NL and KL are remade, PVx will not be ordered properly: use dict instead

PVy : NP x NN float array

ijth element of PVy is the y-component of the vector taking NL[i,j] to its image as seen by particle i If NL and KL are remade, PVy will not be ordered properly: use dict instead

LVUC : NP x 3 array

Lattice vectors and (extended) unit cell vectors defining relative position of each point, as integer multiples of LV[0] and LV[1], and UC[LVUC[i,2]] For instance, xy[0,:] = LV[0] * LVUC[0,0] + LV[1] * LVUC[0,1] + UC[LVUC[0,2]]