Index

LightLattices.AbstractCellType
abstract type AbstractCell{D, T} <: AbstractNodeCollection{D, T}

Abstract unordered collection of nodes in D-dimensional space. Type T is used to represent coordinates.

source
LightLattices.AbstractLatticeType
abstract type AbstractLattice{D, T, PB} <: AbstractNodeCollection{D, T}

The supertype for Lattices in D-dimensional space. Type T is used to represent coordinates. The boundary conditions can be either periodic (PB=true) or free (PB=false).

source
LightLattices.HomogeneousCellType
struct HomogeneousCell{D, T, L<:Union{Nothing, Symbol}} <: AbstractCell{D, T}
  • cell_vectors::Array{StaticArrays.SVector{D, T}, 1} where {D, T}

    Coordinates of nodes.

  • label::Union{Nothing, Symbol}

    Label of the cell.

Unodered homogeneous collection of nodes in D-dimensional space.

source
LightLattices.InhomogeneousCellType
struct InhomogeneousCell{D, T, N, L<:Union{Nothing, Symbol}, T′} <: AbstractCell{D, T}
  • cell_vectors::RecursiveArrayTools.ArrayPartition{T′, Tuple{Vararg{Array{StaticArrays.SVector{D, T}, 1}, N}}} where {D, T, N, T′}

    Coordinates of nodes.

  • group_sizes::Tuple{Vararg{Int64, N}} where N

    Sizes of the homogeneous groups inside inhomogeneous cell.

  • label::Union{Nothing, Symbol}

    Label of the cell.

Unordered inhomogeneous collection of nodes in D-dimensional space. This type allows one to partition the nodes of the cell into several groups. Different groups of nodes may correspond to the different classes of physical objects occupying these nodes.

source
LightLattices.RegularLatticeType
struct RegularLattice{D, T, PB, CT, L<:Union{Nothing, Symbol}} <: AbstractLattice{D, T, PB}
  • lattice_dims::Tuple{Vararg{Int64, D}} where D

    The number of basis cells along each of the basis directions.

  • primitive_vecs::StaticArrays.SMatrix{D, D} where D

    Coordinates of the primitive vectors of the underlying Bravais lattice. primitive_vecs[:, i] gives the $i$-th primitive vector.

  • basis_cell::Any

    Repeated basis cell of the lattice.

  • label::Union{Nothing, Symbol}

    Label of the Lattice.

  • num_of_cells::Int64

    Total number of cells.

  • num_of_nodes::Int64

    Total number of nodes.

  • central_cell::CartesianIndex

    Cartesian index of the central cell (in the case of even length among of dimensions it is an approximation).

This type describes a regular arrangment of nodes in D-dimensional space with boundary condition PB (PB=true for periodic boundary conditions, PB=false for free periodic boundary conditions). A general lattice consists of identicall cells (combinations of nodes) arranged as a Bravais lattice.

source
LightLattices.RegularLatticeMethod

RegularLattice(lattice_dims::NTuple{D, Int}, primitive_vecs::SMatrix{D,D}, basis_cell::AbstractCell{D}; label=nothing, periodic=true)

Convenient constructor which allows to specify the label and boundary condition as keyword arguments.

source
LightLattices.RegularLatticeMethod

RegularLattice(lattice_dims::NTuple{D, Int}, a::T=1; label=:cubic, periodic=true)

Constructs hypercubic lattice with lattice parameter a and trivial unit cell.

source
LightLattices.TrivialCellType
struct TrivialCell{D, T} <: AbstractCell{D, T}

Trivial cell consisting of one node at the origin of D-dimensional coordinate system. The type T is used to represent coordinates.

source
Base.getindexMethod

getindex(cell::AbstractCell, i...)

Returns the coordinate of the $i$-th node of the cell. In the case of InhomogeneousCell we can use double index i = i1, i2 to access $i_1$-th node of $i_2$-th group.

source
Base.lengthMethod

length(cell::AbstractCell)

Returns the number of the nodes in the cell.

source
LightLattices.group_sizeMethod
group_size(cell::Union{HomogeneousCell, TrivialCell}, ig::Int64) -> Int64

Returns the size of the ig-th homogeneous group inside a cell.

source
LightLattices.relative_coordinateMethod
relative_coordinate(collection::AbstractNodeCollection, i1, i2) -> Any

Returns the coordinate of node with index i1 relative to coordinate of the node with index i2.

source
LightLattices.relative_coordinateMethod
relative_coordinate(lattice::RegularLattice{D, T, true, <:TrivialCell}, I1::CartesianIndex{D}, I2::CartesianIndex{D}) -> Any

For periodic lattice, the "shortest" relative coordinate is calculated instead.

For, that the following heuristic is used. Cartesian indices of the two nodes are shifted by the same amount, so that the cartesian index of the second node corresponds to the central cell of the lattice. Then, the cartesian index of the first node is translated back inside the lattice. The relative coordinate is computed using the resulting indices.

This heuristic guarantees that relative_coordinate(lattice, I1, I2) == -relative_coordinate(lattice, I2, I1).

source