pub struct Lattice { /* private fields */ }
Expand description
A lattice is a collection of sites and vertices.
For now it only supports rectangular lattices. This is Orthorombic, Tetragonal and Cubic Bravais lattices. We assume the lattice vectors are aligned with the cartesian axes. While you can choose the lattice parameters a, b, and c to be different.
Implementations§
Source§impl Lattice
impl Lattice
Sourcepub fn try_with_size(self, size: (f64, f64, f64)) -> Result<Self>
pub fn try_with_size(self, size: (f64, f64, f64)) -> Result<Self>
Changes the size of the lattice
Sourcepub fn try_with_sites(self, sites: Vec<Site>) -> Result<Self>
pub fn try_with_sites(self, sites: Vec<Site>) -> Result<Self>
Changes the sites of the lattice
Sourcepub fn try_with_vertices(self, vertices: Vec<Vertex>) -> Result<Self>
pub fn try_with_vertices(self, vertices: Vec<Vertex>) -> Result<Self>
Changes the vertices of the lattice
Sourcepub fn expand_all(self, amount: usize) -> Self
pub fn expand_all(self, amount: usize) -> Self
Expand lattice by the same ammount along all axes
Sourcepub fn expand(self, x: usize, y: usize, z: usize) -> Self
pub fn expand(self, x: usize, y: usize, z: usize) -> Self
Expand lattice by the given ammount along all axes
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lattice
impl<'de> Deserialize<'de> for Lattice
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Lattice
impl RefUnwindSafe for Lattice
impl Send for Lattice
impl Sync for Lattice
impl Unpin for Lattice
impl UnwindSafe for Lattice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more