[−][src]Struct spglib::cell::Cell
Representation of a crystalline cell
Fields
lattice: [[f64; 3]; 3]
Lattice vectors
positions: Vec<[f64; 3]>
Position of each atom
types: Vec<i32>
Type of each atom
Methods
impl Cell
[src]
pub fn new(
lattice: [[f64; 3]; 3],
positions: &[[f64; 3]],
types: &[i32]
) -> Cell
[src]
lattice: [[f64; 3]; 3],
positions: &[[f64; 3]],
types: &[i32]
) -> Cell
Returns a crystalline cell
Examples
Generate a simple BCC cell
let lattice = [[4., 0., 0.], [0., 4., 0.], [0., 0., 4.]]; let positions = &[[0., 0., 0.], [0.5, 0.5, 0.5]]; let types = &[1, 1]; let bcc_cell = Cell::new(lattice, positions, types);
Panics
Panics if the lengths of positions
and types
are not equal
pub fn standardize(
&mut self,
std_ops: StandardizeOps,
symprec: f64
) -> Result<(), StandardizeError>
[src]
&mut self,
std_ops: StandardizeOps,
symprec: f64
) -> Result<(), StandardizeError>
Modifies the structure with one of the available standardization operations
Examples
Find primitive representation of a BCC cell
bcc_cell.standardize(StandardizeOps::Primitive, 1e-5).unwrap(); assert_eq!( bcc_cell.lattice, [[-2.0, 2.0, 2.0], [2.0, -2.0, 2.0], [2.0, 2.0, -2.0]] );
pub fn delaunay_reduce(
&mut self,
symprec: f64
) -> Result<(), DelaunayReduceError>
[src]
&mut self,
symprec: f64
) -> Result<(), DelaunayReduceError>
Applies a Delaunay reduction
pub fn niggli_reduce(&mut self, symprec: f64) -> Result<(), NiggliReduceError>
[src]
Applies a Niggli reduction
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl UnwindSafe for Cell
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,