[][src]Struct spglib::cell::Cell

pub struct Cell {
    pub lattice: [[f64; 3]; 3],
    pub positions: Vec<[f64; 3]>,
    pub types: Vec<i32>,
}

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]

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]

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]

Applies a Delaunay reduction

pub fn niggli_reduce(&mut self, symprec: f64) -> Result<(), NiggliReduceError>[src]

Applies a Niggli reduction

Trait Implementations

impl Clone for Cell[src]

impl Debug for Cell[src]

impl Default for Cell[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.