Struct vegas_lattice::Lattice
source · 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 size_along(&self, axis: Axis) -> f64
pub fn size_along(&self, axis: Axis) -> f64
Returns the size of the lattice along the given axis
sourcepub fn with_sites(self, sites: Vec<Site>) -> Self
pub fn with_sites(self, sites: Vec<Site>) -> Self
Changes the sites of the lattice
sourcepub fn with_vertices(self, vertices: Vec<Vertex>) -> Self
pub fn with_vertices(self, vertices: Vec<Vertex>) -> Self
Changes the vertices of the lattice
sourcepub fn validate(self) -> Result<Self, LatticeError>
pub fn validate(self) -> Result<Self, LatticeError>
Validates the lattice
sourcepub fn drop(self, axis: Axis) -> Self
pub fn drop(self, axis: Axis) -> Self
Drops all the vertices that are periodic along the given axis
sourcepub fn expand_along(self, axis: Axis, amount: usize) -> Self
pub fn expand_along(self, axis: Axis, amount: usize) -> Self
Expands the lattice along the given axis
sourcepub fn apply_mask(self, mask: Mask) -> Self
pub fn apply_mask(self, mask: Mask) -> Self
Removes sites from the lattice according to the given mask
TODO: This only removes points in the xy plane, and it should be generalized
sourcepub fn alloy_sites(self, source: &str, target: Alloy) -> Self
pub fn alloy_sites(self, source: &str, target: Alloy) -> Self
Replaces the sites labeled as source
with sites in the target
alloy
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 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