[−]Struct lumol::EnergyCache
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.
Implementations
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
&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 !RefUnwindSafe for EnergyCache
impl Send for EnergyCache
impl Sync for EnergyCache
impl Unpin for EnergyCache
impl !UnwindSafe for EnergyCache
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, 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>,