[][src]Struct gchemol_core::Lattice

pub struct Lattice { /* fields omitted */ }

Periodic 3D lattice

Methods

impl Lattice[src]

pub fn replicate(
    &self,
    ra: impl Clone + Iterator<Item = isize>,
    rb: impl Clone + Iterator<Item = isize>,
    rc: impl Clone + Iterator<Item = isize>
) -> impl Iterator<Item = Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>
[src]

Create a supercell along three cell directions.

impl Lattice[src]

pub fn new<T>(tvs: [T; 3]) -> Lattice where
    T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>> + Copy
[src]

Construct Lattice from three lattice vectors.

pub fn from_matrix<T>(tvs: T) -> Lattice where
    T: Into<Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>>, 
[src]

Construct Lattice from lattice matrix (3x3).

pub fn from_params(
    a: f64,
    b: f64,
    c: f64,
    alpha: f64,
    beta: f64,
    gamma: f64
) -> Lattice
[src]

Construct lattice from lattice parameters Unit cell angles in degrees, lengths in Angstrom

pub fn widths(&self) -> [f64; 3][src]

Return the perpendicular widths of the cell along three directions. i.e. the distance between opposite faces of the unit cell

pub fn volume(&self) -> f64[src]

Return the volume of the unit cell the cache will be updated if necessary

pub fn set_origin<T>(&mut self, loc: T) where
    T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>, 
[src]

Set cell origin in Cartesian coordinates

pub fn lengths(&self) -> [f64; 3][src]

Lattice length parameters: a, b, c

pub fn angles(&self) -> [f64; 3][src]

Lattice angle parameters in degrees

pub fn scale_by(&mut self, v: f64)[src]

Scale Lattice by a positive constant

pub fn origin(
    &self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
[src]

Get cell origin in Cartesian coordinates

pub fn to_frac<T>(
    &self,
    p: T
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer> where
    T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>, 
[src]

Returns the fractional coordinates given cartesian coordinates.

pub fn to_cart<T>(
    &self,
    p: T
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer> where
    T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>, 
[src]

Returns the cartesian coordinates given fractional coordinates.

pub fn vector_a(
    &self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
[src]

Lattice vector a

pub fn vector_b(
    &self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
[src]

Lattice vector b

pub fn vector_c(
    &self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
[src]

Lattice vector c

pub fn vectors(
    &self
) -> [Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>; 3]
[src]

Three lattice vectors.

pub fn matrix(
    &self
) -> Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>
[src]

Lattice vectors

pub fn is_orthorhombic(&self) -> bool[src]

Check if lattice is orthorhombic

pub fn wrap<T>(
    &self,
    vec: T
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer> where
    T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>, 
[src]

Wrap a point in cartesian coordinates into unit cell, obeying the periodic boundary conditions. Returns cartesian coordinates.

pub fn wrap_frac<T>(
    &self,
    f: T
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer> where
    T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>, 
[src]

Wrap a point in fractional coordinates into unit cell, obeying the periodic boundary conditions. Returns fractional coordinates.

pub fn distance<T>(&self, pi: T, pj: T) -> f64 where
    T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>, 
[src]

Return the shortest distance between pi (point i) and the periodic images of pj (point j) under the minimum image convention

Parameters

  • pi, pj: Cartesian coordinates of point i and point j

pub fn apply_mic<T>(
    &self,
    p: T
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer> where
    T: Into<[f64; 3]>, 
[src]

Return the shortest vector obeying the minimum image convention.

Trait Implementations

impl Clone for Lattice[src]

impl Copy for Lattice[src]

impl Debug for Lattice[src]

impl Default for Lattice[src]

impl<'de> Deserialize<'de> for Lattice[src]

impl Serialize for Lattice[src]

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

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,