[−]Struct lumol::sys::Configuration
The Configuration
contains the physical data of the system:
- The unit cell;
- The list of particles in the system;
- The list of molecules in the system.
Fields
cell: UnitCell
Unit cell of the system
Implementations
impl Configuration
pub fn new() -> Configuration
Create a new empty Configuration
impl Configuration
Topology and particles related functions
pub fn are_in_same_molecule(&self, i: usize, j: usize) -> bool
Check if the particles at indexes i
and j
are in the same molecule
pub fn molecules(&self) -> MoleculeIter<'_>ⓘNotable traits for MoleculeIter<'a>
impl<'a> Iterator for MoleculeIter<'a> type Item = MoleculeRef<'a>;
Notable traits for MoleculeIter<'a>
impl<'a> Iterator for MoleculeIter<'a> type Item = MoleculeRef<'a>;
Get an iterator over the molecules in the configuration.
pub fn molecules_mut(&mut self) -> MoleculeIterMut<'_>ⓘNotable traits for MoleculeIterMut<'a>
impl<'a> Iterator for MoleculeIterMut<'a> type Item = MoleculeRefMut<'a>;
Notable traits for MoleculeIterMut<'a>
impl<'a> Iterator for MoleculeIterMut<'a> type Item = MoleculeRefMut<'a>;
Get an iterator over the molecules in the configuration.
pub fn molecule(&self, id: usize) -> MoleculeRef<'_>
Get the molecule at index id
pub fn molecule_mut(&mut self, id: usize) -> MoleculeRefMut<'_>
Get the molecule at index id
pub fn molecule_id(&self, i: usize) -> usize
Get the index of the molecule containing the particle i
pub fn bond_path(&self, i: usize, j: usize) -> BondPath
Get the length of the shortest bond path to go from the particle i
to
the particle j
. If the particles are not in the same molecule, the
length is -1. Else, this length is 0 if i == j
, 1 if there is a bond
between i
and j
, etc.
pub fn remove_molecule(&mut self, molid: usize)
Remove the molecule at index i
pub fn add_bond(
&mut self,
particle_i: usize,
particle_j: usize
) -> Vec<Permutation>
&mut self,
particle_i: usize,
particle_j: usize
) -> Vec<Permutation>
Add a bond between the particles at indexes i
and j
. The particles
should have been added to the configuration before calling this.
Warning
If the bond is between two particles which are not in the same molecule, the two molecules are merged together by moving particles in the particles list, and thus invalidate any previously stored index. In particular, any bond, angle, dihedral or molecule is invalidated.
This function will return the list of atomic permutations that where applied in order to ensure that molecules are contiguous in memory.
pub fn add_molecule(&mut self, molecule: Molecule)
Add a molecule to the configuration, putting the new particles at the end of the particles list
pub fn size(&self) -> usize
Get the number of particles in this configuration
pub fn is_empty(&self) -> bool
Check if this configuration contains any particle
pub fn center_of_mass(&self) -> Vector3D
Return the center-of-mass of the configuration
pub fn particles(&self) -> ParticleSlice<'_>
Get the list of particles in this configuration, as a ParticleSlice
.
pub fn particles_mut(&mut self) -> ParticleSliceMut<'_>
Get the list of particles in this configuration, as a mutable
ParticleSliceMut
.
impl Configuration
UnitCell
related functions
pub fn distance(&self, i: usize, j: usize) -> f64
Get the distance between the particles at indexes i
and j
pub fn nearest_image(&self, i: usize, j: usize) -> Vector3D
Get the vector between the nearest image of particle j
with respect to
particle i
.
pub fn angle(&self, i: usize, j: usize, k: usize) -> f64
Get the angle between the particles i
, j
and k
pub fn angle_and_derivatives(
&self,
i: usize,
j: usize,
k: usize
) -> (f64, Vector3D, Vector3D, Vector3D)
&self,
i: usize,
j: usize,
k: usize
) -> (f64, Vector3D, Vector3D, Vector3D)
Get the angle and the derivatives of the angle between the particles
i
, j
and k
pub fn dihedral(&self, i: usize, j: usize, k: usize, m: usize) -> f64
Get the dihedral angle between the particles i
, j
, k
and m
pub fn dihedral_and_derivatives(
&self,
i: usize,
j: usize,
k: usize,
m: usize
) -> (f64, Vector3D, Vector3D, Vector3D, Vector3D)
&self,
i: usize,
j: usize,
k: usize,
m: usize
) -> (f64, Vector3D, Vector3D, Vector3D, Vector3D)
Get the dihedral angle and the derivatives of the dihedral angle
between the particles i
, j
, k
and m
Trait Implementations
impl Clone for Configuration
pub fn clone(&self) -> Configuration
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
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,
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,