Structures

Structures used by GridProtocol to layout 1 & 2D simulations.

class PyLongQt.Structures.Fiber

A 1D row/column of nodes in a Grid

__getitem__(self: PyLongQt._PyLongQt.Structures.Fiber, index: int) → PyLongQt._PyLongQt.Structures.Node

Get a node by index

__iter__(self: PyLongQt._PyLongQt.Structures.Fiber) → iterator

Iterate over nodes

updateVm(self: PyLongQt._PyLongQt.Structures.Fiber, arg0: float) → None

Update voltages for all nodes. Calls Cell.updateVm()

class PyLongQt.Structures.Grid

A 2D plane of nodes, which provides the layout for 1 and 2 dimentional simulations

__getitem__(*args, **kwargs)

Overloaded function.

  1. __getitem__(self: PyLongQt._PyLongQt.Structures.Grid, arg0: Tuple[int, int]) -> PyLongQt._PyLongQt.Structures.Node

Retrieve node by its (row, column)

  1. __getitem__(self: PyLongQt._PyLongQt.Structures.Grid, arg0: List[Tuple[int, int]]) -> List[PyLongQt._PyLongQt.Structures.Node]

Retrieve nodes by thier [(row, column),…]

__iter__(self: PyLongQt._PyLongQt.Structures.Grid) → iterator

Iterate over nodes

addColumn(self: PyLongQt._PyLongQt.Structures.Grid) → None

Add a single column of cells

addColumns(self: PyLongQt._PyLongQt.Structures.Grid, num: int) → None
Add multiple columns of cells
num

the number of rows to add

addRow(self: PyLongQt._PyLongQt.Structures.Grid) → None

Add a single row of cells

addRows(self: PyLongQt._PyLongQt.Structures.Grid, num: int) → None
Add multiple rows of cells
num

the number of rows to add

columnCount(self: PyLongQt._PyLongQt.Structures.Grid) → int

The number of columns

property dx

The length of each node in the grid

property dy

The width of each cell in the grid

findNode(self: PyLongQt._PyLongQt.Structures.Grid, node: PyLongQt._PyLongQt.Structures.Node) → Tuple[int, int]
Find a node’s location in the grid
node

The node object to locate

getColumn(self: PyLongQt._PyLongQt.Structures.Grid, index: int) → PyLongQt._PyLongQt.Structures.Fiber
Retrieve a column of nodes by thier index
index

The location of the column

getRow(self: PyLongQt._PyLongQt.Structures.Grid, index: int) → PyLongQt._PyLongQt.Structures.Fiber
Retrieve a row of nodes by thier index
index

The location of the row

removeColumn(self: PyLongQt._PyLongQt.Structures.Grid, index: int) → None
Remove one column of cells
index

the location of the column to remove

removeColumns(self: PyLongQt._PyLongQt.Structures.Grid, num: int, index: int) → None
Remove multiple columns of cells
num

the number of columns including index to be removed

index

the location of the first column to remove

removeRow(self: PyLongQt._PyLongQt.Structures.Grid, index: int) → None
Remove one row of cells
index

the location of the row to remove

removeRows(self: PyLongQt._PyLongQt.Structures.Grid, num: int, index: int) → None
Remove multiple rows of cells
num

the number of rows including index to be removed

index

the location of the first row to remove

reset(self: PyLongQt._PyLongQt.Structures.Grid) → None

Reset the grid to original state

rowCount(self: PyLongQt._PyLongQt.Structures.Grid) → int

The number of rows

property shape

The shape of the grid (rows, columns)

simpleGrid()

Returns a simplified representation of the grid. Each node is replaced by a number to make visualization easier. A lookup table between the cell’s types and the number used in the simplified grid is also returned.

property size
class PyLongQt.Structures.Node

The wrapper for a single cell in a multi-dimensional simulation

property cell

Get or set the cell contained in the node

cellOptions(self: PyLongQt._PyLongQt.Structures.Node) → List[str]
property column
getConductivity(self: PyLongQt._PyLongQt.Structures.Node, side: PyLongQt._PyLongQt.Side) → float
Get the conductivity of a side
side

The side to get

resetConductivity(*args, **kwargs)

Overloaded function.

  1. resetConductivity(self: PyLongQt._PyLongQt.Structures.Node) -> None

Reset the conductivity of every side

  1. resetConductivity(self: PyLongQt._PyLongQt.Structures.Node, side: PyLongQt._PyLongQt.Side) -> None

Reset the conductivity of a side
side

The side to reset (if left as the default option all sides will be reset)

property row
setCellByName(self: PyLongQt._PyLongQt.Structures.Node, cellName: str) → bool
Set the cell using its name rather than a cell model object
name

The name of the cell model

setConductivityDirect(self: PyLongQt._PyLongQt.Structures.Node, side: PyLongQt._PyLongQt.Side, value: float) → None
Set the conductivity (what are the units) of a side to a value directly
side

The side to set

value

The conductivity value to set

setResistivity(self: PyLongQt._PyLongQt.Structures.Node, side: PyLongQt._PyLongQt.Side, percentage: float = 100) → None
Set the resistivity of the node
side

The side to set

percentage

The percentage to change the resistivity