stk.cof.LinearVertex

class stk.cof.LinearVertex(id, position, aligner_edge=0, cell=(0, 0, 0))[source]

Bases: _CofVertex

Initialize a _CofVertex.

Parameters:
  • id (int) – The id of the vertex.

  • position (tuple of float) – The position of the vertex.

  • aligner_edge (int, optional) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

  • cell (tuple of int, optional) – The cell of the lattice in which the vertex is found.

Methods

clone

Return a clone.

get_aligner_edge

Return the aligner edge of the vertex.

get_cell

Get the cell of the lattice in which the vertex is found.

get_id

Get the id.

get_position

Get the position.

init_at_center

Initialize a _CofVertex in the middle of vertices.

init_at_shifted_center

Initialize a _CofVertex at the center of vertices.

map_functional_groups_to_edges

Map functional groups to edges.

place_building_block

Place building_block on the Vertex.

with_position

Get a clone at a certain position.

with_scale

Get a clone with a scaled position.

clone()

Return a clone.

Returns:

The clone.

get_aligner_edge()

Return the aligner edge of the vertex.

Returns:

The aligner edge.

Return type:

int

get_cell()

Get the cell of the lattice in which the vertex is found.

Returns:

The cell of the lattice in which the vertex is found.

get_id()

Get the id.

Returns:

The id.

Return type:

int

get_position()

Get the position.

Returns:

The position of the Vertex.

Return type:

ndarray

classmethod init_at_center(id, vertices, aligner_edge=0, cell=(0, 0, 0))

Initialize a _CofVertex in the middle of vertices.

Parameters:
  • id (int) – The id of the initialized vertex.

  • vertices (tuple of Vertex) – The vertices at whose center this one needs to be.

  • aligner_edge (int, optional) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

  • cell (tuple of int, optional) – The cell of the lattice in which the vertex is found.

Returns:

The new vertex.

Return type:

_CofVertex

classmethod init_at_shifted_center(id, vertices, cell_shifts, lattice_constants, aligner_edge=0, cell=(0, 0, 0))

Initialize a _CofVertex at the center of vertices.

The vertices are shifted according to the lattice constants and cell shifts.

Parameters:
  • id (int) – The id of the initialized vertex.

  • vertices (tuple of Vertex) – The vertices at whose center this one needs to be.

  • cell_shifts (tuple of int) – The number of cells shifted in the x, y and z directions.

  • lattice_constants (tuple of numpy.ndarray) – The a, b and c lattice constants.

  • aligner_edge (int, optional) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

  • cell (tuple of int, optional) – The cell of the lattice in which the vertex is found.

Returns:

The new vertex.

Return type:

_CofVertex

map_functional_groups_to_edges(building_block, edges)[source]

Map functional groups to edges.

Each functional group in building_block needs to be assigned to an edge in edges.

Parameters:
  • building_blockBuildingBlock The building block which is needs to have functional groups assigned to edges.

  • edges – The edges to which the vertex is attached.

Returns:

A mapping from the id of a functional group in building_block to the id of the edge in edges it is assigned to.

place_building_block(building_block, edges)[source]

Place building_block on the Vertex.

Parameters:
  • building_block – The building block molecule which is to be placed on the vertex.

  • edges – The edges to which the vertex is attached.

Returns:

The position matrix of building_block after being placed.

with_position(position)

Get a clone at a certain position.

Parameters:

position (ndarray) – The desired position of the clone.

Returns:

The clone.

Return type:

Self

with_scale(scale)

Get a clone with a scaled position.

Parameters:

scale (float | tuple[float, float, float]) – The value by which the position of the Vertex is scaled. Can be a single number if all axes are scaled by the same amount or a tuple of three numbers if each axis is scaled by a different value.

Returns:

The clone.

Return type:

Self