pub struct OrderedPacking {
pub lattice: LatticeType,
pub radius: f64,
pub lattice_parameter: f64,
pub n_cells: [usize; 3],
pub spheres: Vec<PackingSphere>,
}Expand description
Ordered sphere packing on crystal lattices.
Fields§
§lattice: LatticeTypeLattice type.
radius: f64Sphere radius.
lattice_parameter: f64Lattice parameter (edge length of unit cell).
n_cells: [usize; 3]Number of unit cells in each direction.
spheres: Vec<PackingSphere>Generated sphere positions.
Implementations§
Source§impl OrderedPacking
impl OrderedPacking
Sourcepub fn new(lattice: LatticeType, radius: f64, n_cells: [usize; 3]) -> Self
pub fn new(lattice: LatticeType, radius: f64, n_cells: [usize; 3]) -> Self
Create a new ordered packing.
The lattice parameter is set so spheres are touching:
- FCC:
a = 2*r*sqrt(2) - BCC:
a = 4*r/sqrt(3) - SC:
a = 2*r
Sourcepub fn theoretical_packing_fraction(&self) -> f64
pub fn theoretical_packing_fraction(&self) -> f64
Theoretical packing efficiency for the lattice type.
Sourcepub fn coordination_number(&self) -> usize
pub fn coordination_number(&self) -> usize
Coordination number (number of nearest neighbors) for the lattice.
Sourcepub fn actual_packing_fraction(&self) -> f64
pub fn actual_packing_fraction(&self) -> f64
Compute the packing fraction from generated spheres.
Sourcepub fn nearest_neighbor_distance(&self) -> f64
pub fn nearest_neighbor_distance(&self) -> f64
Return the nearest-neighbor distance for the lattice.
Auto Trait Implementations§
impl Freeze for OrderedPacking
impl RefUnwindSafe for OrderedPacking
impl Send for OrderedPacking
impl Sync for OrderedPacking
impl Unpin for OrderedPacking
impl UnsafeUnpin for OrderedPacking
impl UnwindSafe for OrderedPacking
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<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.