[]Struct lumol::sys::System

pub struct System {
    pub simulated_degrees_of_freedom: DegreesOfFreedom,
    pub step: u64,
    // some fields omitted
}

The System type hold all the data about a simulated system.

This data contains:

In the implementation, the particles contained in a molecule are guaranteed to be contiguous in memory. This allow for faster access when iterating over molecules, and easier molecule removal from the system.

Fields

simulated_degrees_of_freedom: DegreesOfFreedom

Number of degrees of freedom simulated in the system. This default to DegreesOfFreedom::Particles, and is set in the simulation setup.

step: u64

The current simulation step

Methods

impl System

pub fn new() -> System

Create a new empty System

pub fn with_cell(cell: UnitCell) -> System

Create an empty system with a specific unit cell

pub fn add_molecule(&mut self, molecule: Molecule)

Add a molecule to the system

pub fn composition(&self) -> Composition

Get the composition in particles and molecules of the configuration

pub fn simulated_temperature(&mut self, temperature: Option<f64>)

Use an external temperature for all the system properties. Calling this with Some(temperature) will replace all the computation of the temperature from the velocities with the given values. Calling it with None will use the velocities.

The default is to use the velocities unless this function is called.

impl System

Functions related to interactions

pub fn energy_evaluator(&self) -> EnergyEvaluator

Get an helper struct to evaluate the energy of this system.

pub fn add_pair_potential(&mut self, (&str, &str), potential: PairInteraction)

Add the potential pair interaction for atoms with types i and j

pub fn add_bond_potential(
    &mut self,
    (&str, &str),
    potential: Box<dyn BondPotential + 'static>
)

Add the potential bonded interaction for atoms with types i and j

pub fn add_angle_potential(
    &mut self,
    (&str, &str, &str),
    potential: Box<dyn AnglePotential + 'static>
)

Add the potential angle interaction for the angle (i, j, k)

pub fn add_dihedral_potential(
    &mut self,
    (&str, &str, &str, &str),
    potential: Box<dyn DihedralPotential + 'static>
)

Add the potential dihedral interaction for the dihedral angle (i, j, k, m)

pub fn set_coulomb_potential(
    &mut self,
    potential: Box<dyn CoulombicPotential + 'static>
)

Set the coulombic interaction for all pairs to potential

pub fn add_global_potential(
    &mut self,
    potential: Box<dyn GlobalPotential + 'static>
)

Add the potential global interaction

pub fn pair_potentials(&self, i: usize, j: usize) -> &[PairInteraction]

Get the list of pair potential acting between the particles at indexes i and j.

pub fn bond_potentials(
    &self,
    i: usize,
    j: usize
) -> &[Box<dyn BondPotential + 'static>]

Get the list of bonded potential acting between the particles at indexes i and j.

pub fn angle_potentials(
    &self,
    i: usize,
    j: usize,
    k: usize
) -> &[Box<dyn AnglePotential + 'static>]

Get the list of angle interaction acting between the particles at indexes i, j and k.

pub fn dihedral_potentials(
    &self,
    i: usize,
    j: usize,
    k: usize,
    m: usize
) -> &[Box<dyn DihedralPotential + 'static>]

Get the list of dihedral angles interaction acting between the particles at indexes i, j, k and m.

pub fn coulomb_potential(&self) -> Option<&dyn CoulombicPotential>

Get the coulombic interaction for the system

pub fn global_potentials(&self) -> &[Box<dyn GlobalPotential + 'static>]

Get all global interactions for the system

pub fn maximum_cutoff(&self) -> Option<f64>

Get maximum cutoff from coulomb, pairs and global interactions.

impl System

Functions to get physical properties of a system.

pub fn degrees_of_freedom(&self) -> usize

Get the number of degrees of freedom in the system

pub fn kinetic_energy(&self) -> f64

Get the kinetic energy of the system.

pub fn potential_energy(&self) -> f64

Get the potential energy of the system.

pub fn total_energy(&self) -> f64

Get the total energy of the system.

pub fn temperature(&self) -> f64

Get the temperature of the system.

pub fn volume(&self) -> f64

Get the volume of the system.

pub fn virial(&self) -> Matrix3

Get the virial of the system as a tensor

pub fn pressure(&self) -> f64

Get the pressure of the system from the virial equation, at the system instantaneous temperature.

pub fn stress(&self) -> Matrix3

Get the stress tensor of the system from the virial equation.

pub fn forces(&self) -> Vec<Vector3D>

Get the forces acting on all the particles in the system

Methods from Deref<Target = Configuration>

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.

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 From<Frame> for System

impl Deref for System

type Target = Configuration

The resulting type after dereferencing.

impl DerefMut for System

impl Clone for System

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

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for System

impl Sync for System

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]