[]Struct lumol::sys::Configuration

pub struct Configuration {
    pub cell: UnitCell,
    // some fields omitted
}

The Configuration contains the physical data of the system:

Fields

cell: UnitCell

Unit cell of the system

Methods

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

Important traits for MoleculeIter<'a>
pub fn molecules(&self) -> MoleculeIter

Get an iterator over the molecules in the configuration.

Important traits for MoleculeIterMut<'a>
pub fn molecules_mut(&mut self) -> MoleculeIterMut

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>

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)

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)

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Configuration

impl Sync for Configuration

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]