pub struct CrystalStructure {
pub lattice: [[f64; 3]; 3],
pub atoms: Vec<CrystalAtom>,
pub space_group: u16,
}Expand description
A periodic crystal structure described by its lattice and atom list.
Fields§
§lattice: [[f64; 3]; 3]Lattice vectors as row matrix: lattice[i] is the i-th basis vector in Å.
atoms: Vec<CrystalAtom>List of atoms in the asymmetric unit (or full unit cell).
space_group: u16International Tables space group number (1–230).
Implementations§
Source§impl CrystalStructure
impl CrystalStructure
Sourcepub fn to_cartesian(&self) -> Vec<[f64; 3]>
pub fn to_cartesian(&self) -> Vec<[f64; 3]>
Convert all atom fractional coordinates to Cartesian coordinates (Å).
Sourcepub fn volume(&self) -> f64
pub fn volume(&self) -> f64
Volume of the unit cell in ų (scalar triple product of basis vectors).
Sourcepub fn density(&self, molar_mass: f64) -> f64
pub fn density(&self, molar_mass: f64) -> f64
Crystal density in g/cm³.
molar_mass is the molar mass of one formula unit in g/mol.
The number of formula units Z is taken as the atom count.
Sourcepub fn reciprocal_lattice(&self) -> [[f64; 3]; 3]
pub fn reciprocal_lattice(&self) -> [[f64; 3]; 3]
Compute the reciprocal lattice vectors (2π convention).
Returns [[b1x,b1y,b1z\],[b2x,b2y,b2z],[b3x,b3y,b3z]] in Å⁻¹.
Trait Implementations§
Source§impl Clone for CrystalStructure
impl Clone for CrystalStructure
Source§fn clone(&self) -> CrystalStructure
fn clone(&self) -> CrystalStructure
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CrystalStructure
impl RefUnwindSafe for CrystalStructure
impl Send for CrystalStructure
impl Sync for CrystalStructure
impl Unpin for CrystalStructure
impl UnsafeUnpin for CrystalStructure
impl UnwindSafe for CrystalStructure
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.