[]Struct lumol::sys::EnergyCache

pub struct EnergyCache { /* fields omitted */ }

This is a cache for energy computation.

Cache integrity is left up to the user of this structure: any function with update_ prefix must be called as needed to ensure cache consistency.

Methods

impl EnergyCache

pub fn new() -> EnergyCache

Create a new empty energy cache.

pub fn init(&mut self, system: &System)

Initialize the cache to be used with system. After a call to this function, the cache is only usable with the same system. To change the associated system, one must call this function again.

pub fn energy(&self) -> f64

Get the cached energy

pub fn update(&mut self, system: &mut System)

Update the cache after a call to a EnergyCache::*_cost function or EnergyCache::unused.

pub fn unused(&mut self)

This function should be called whenever the cache is not used, but one still want it to be updated. Future call to EnergyCache::update will recompute the full cache.

impl EnergyCache

pub fn move_molecule_cost(
    &mut self,
    system: &System,
    molecule_id: usize,
    new_positions: &[Vector3D]
) -> f64

Get the cost of moving a rigid molecule at molecule_id in the system to new_positions.

This function DOES NOT update the cache, the update function MUST be called if the particles are effectively moved.

pub fn move_all_molecules_cost(&mut self, system: &System) -> f64

Return the cost for moving all rigid molecules of the system.

This function is intended for use when all the molecules in the system are moved rigidly, for example when resizing the system in NPT Monte Carlo. It computes energy changes due to:

  • non bonded pairs interactions;
  • Coulomb interactions;
  • global interactions;

It DOES NOT recompute bonds, angles and dihedral interactions. You must not use this function when the intramolecular configuration changed.

This function DOES NOT update the cache, the update function MUST be called if the molecules are effectively moved.

Auto Trait Implementations

impl Send for EnergyCache

impl Sync for EnergyCache

Blanket Implementations

impl<T> From for T[src]

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

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]