Index
LightLattices.AbstractCell
— Typeabstract type AbstractCell{D, T} <: AbstractNodeCollection{D, T}
Abstract unordered collection of nodes in D
-dimensional space. Type T
is used to represent coordinates.
LightLattices.AbstractLattice
— Typeabstract 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
).
LightLattices.AbstractNodeCollection
— Typeabstract type AbstractNodeCollection{D, T}
Abstract collection of nodes in D
-dimensional space. Type T
is used to represent coordinates.
LightLattices.HomogeneousCell
— Typestruct 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.
LightLattices.InhomogeneousCell
— Typestruct 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.
LightLattices.RegularLattice
— Typestruct 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.
LightLattices.RegularLattice
— MethodRegularLattice(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.
LightLattices.RegularLattice
— MethodRegularLattice(lattice_dims::NTuple{D, Int}, a::T=1; label=:cubic, periodic=true)
Constructs hypercubic lattice with lattice parameter a
and trivial unit cell.
LightLattices.TrivialCell
— Typestruct 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.
Base.getindex
— Methodgetindex(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.
Base.length
— Methodlength(cell::AbstractCell)
Returns the number of the nodes in the cell.
LightLattices.group_size
— Methodgroup_size(cell::Union{HomogeneousCell, TrivialCell}, ig::Int64) -> Int64
Returns the size of the ig
-th homogeneous group inside a cell.
LightLattices.num_of_groups
— Methodnum_of_groups(lattice::RegularLattice) -> Any
Return the number of lattice separate groups.
LightLattices.num_of_groups
— Methodnum_of_groups(cell::Union{HomogeneousCell, TrivialCell}) -> Int64
Return the number of separate groups in a cell.
LightLattices.relative_coordinate
— Methodrelative_coordinate(collection::AbstractNodeCollection, i1, i2) -> Any
Returns the coordinate of node with index i1
relative to coordinate of the node with index i2
.
LightLattices.relative_coordinate
— Methodrelative_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)
.
LightLattices.switch_coord_type
— Methodswitch_coord_type(cell::AbstractCell{D, T}, ::Type{T′})
Converts the type used to represent coordinates from T
to T′
.
LightLattices.takes_precedence
— Methodtakes_precedence(i1, i2)
Returns true
if the index i1
occurs before i2
while iterating over a node collection.