[−]Struct gchemol::Lattice
Periodic 3D lattice
Methods
impl Lattice
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>>
&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>>
Create a supercell along three cell directions.
impl Lattice
pub fn new<T>(tvs: [T; 3]) -> Lattice where
T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>> + Copy,
T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>> + Copy,
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>>,
T: Into<Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>>,
Construct Lattice
from lattice matrix (3x3).
pub fn from_params(
a: f64,
b: f64,
c: f64,
alpha: f64,
beta: f64,
gamma: f64
) -> Lattice
a: f64,
b: f64,
c: f64,
alpha: f64,
beta: f64,
gamma: f64
) -> Lattice
Construct lattice from lattice parameters Unit cell angles in degrees, lengths in Angstrom
pub fn widths(&self) -> [f64; 3]
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
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>>,
T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>,
Set cell origin in Cartesian coordinates
pub fn lengths(&self) -> [f64; 3]
Lattice length parameters: a, b, c
pub fn angles(&self) -> [f64; 3]
Lattice angle parameters in degrees
pub fn scale_by(&mut self, v: f64)
Scale Lattice by a positive constant
pub fn origin(
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
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>>,
&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>>,
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>>,
&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>>,
Returns the cartesian coordinates given fractional coordinates.
pub fn vector_a(
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
Lattice vector a
pub fn vector_b(
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
Lattice vector b
pub fn vector_c(
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
&self
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
Lattice vector c
pub fn vectors(
&self
) -> [Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>; 3]
&self
) -> [Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>; 3]
Three lattice vectors.
pub fn matrix(
&self
) -> Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>
&self
) -> Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>
Lattice vectors
pub fn is_orthorhombic(&self) -> bool
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>>,
&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>>,
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>>,
&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>>,
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>>,
T: Into<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>>,
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]>,
&self,
p: T
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer> where
T: Into<[f64; 3]>,
Return the shortest vector obeying the minimum image convention.
Trait Implementations
impl Clone for Lattice
fn clone(&self) -> Lattice
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Lattice
impl Debug for Lattice
impl Default for Lattice
impl<'de> Deserialize<'de> for Lattice
fn deserialize<__D>(
__deserializer: __D
) -> Result<Lattice, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
__deserializer: __D
) -> Result<Lattice, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Serialize for Lattice
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
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]
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> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,