pub struct MdState {Show 14 fields
pub cfg: MdConfig,
pub atoms: Vec<AtomDynamics>,
pub water: Vec<WaterMol>,
pub adjacency_list: Vec<Vec<usize>>,
pub time: f64,
pub step_count: usize,
pub snapshots: Vec<Snapshot>,
pub cell: SimBox,
pub neighbors_nb: NeighborsNb,
pub water_pme_sites_forces: Vec<[Vec3; 3]>,
pub kinetic_energy: f64,
pub potential_energy: f64,
pub neighbor_rebuild_count: usize,
pub computation_time: ComputationTimeSums,
/* private fields */
}Fields§
§cfg: MdConfig§atoms: Vec<AtomDynamics>§water: Vec<WaterMol>§adjacency_list: Vec<Vec<usize>>§time: f64Current simulation time, in picoseconds.
step_count: usize§snapshots: Vec<Snapshot>These are the snapshots we keep in memory, accumulating.
cell: SimBox§neighbors_nb: NeighborsNb§water_pme_sites_forces: Vec<[Vec3; 3]>§kinetic_energy: f64kcal/mol
potential_energy: f64§neighbor_rebuild_count: usize§computation_time: ComputationTimeSumsImplementations§
Source§impl MdState
impl MdState
Sourcepub fn apply_angle_bending_forces(&mut self)
pub fn apply_angle_bending_forces(&mut self)
This maintains bond angles between sets of three atoms as they should be from hybridization. It reflects this hybridization, steric clashes, and partial double-bond character. This identifies deviations from the ideal angle, calculates restoring torque, and applies forces based on this to push the atoms back into their ideal positions in the molecule.
Valence angles, which are the angle formed by two adjacent bonds ba et bc in a same molecule; a valence angle tends to maintain constant the anglê abc. A valence angle is thus concerned by the positions of three atoms.
Source§impl MdState
impl MdState
Sourcepub fn step(&mut self, dev: &ComputationDevice, dt: f32)
pub fn step(&mut self, dev: &ComputationDevice, dt: f32)
Perform one integration step. This is the entry point for running the simulation.
One step of length dt is in picoseconds (10^-12),
with typical values of 0.001, or 0.002ps (1 or 2fs).
This method orchestrates the dynamics at each time step. Uses a Verlet Velocity base,
with different thermostat approaches depending on configuration.
Source§impl MdState
impl MdState
Sourcepub fn apply_nonbonded_forces(&mut self, dev: &ComputationDevice)
pub fn apply_nonbonded_forces(&mut self, dev: &ComputationDevice)
Run the appropriate force-computation function to get force on non-water atoms, force on water atoms, and virial sum for the barostat. Uses GPU if available.
Applies Coulomb and Van der Waals (Lennard-Jones) forces on non-water atoms, in place. We use the MD-standard [S]PME approach to handle approximated Coulomb forces. This function applies forces from non-water, and water sources.
Source§impl MdState
impl MdState
pub fn pack_atoms(&mut self)
Source§impl MdState
impl MdState
Sourcepub fn zero_linear_momentum_atoms(&mut self)
pub fn zero_linear_momentum_atoms(&mut self)
Remove center-of-mass drift for “atoms” only (exclude water).
Sourcepub fn zero_angular_momentum_atoms(&mut self)
pub fn zero_angular_momentum_atoms(&mut self)
Remove rigid-body rotation for “atoms” only (exclude water). Computes ω from I ω = L about the atoms’ COM, then sets v’ = v - ω × (r - r_cm).
Source§impl MdState
impl MdState
Sourcepub fn minimize_energy(&mut self, dev: &ComputationDevice, max_iters: usize)
pub fn minimize_energy(&mut self, dev: &ComputationDevice, max_iters: usize)
Relaxes the molecules. Use this at the start of the simulation to control kinetic energy that arrises from differences between atom positions, and bonded parameters. It can also be called externally. It also stabilizes the water molecules, so that their hydrogen bond structure is correct at initialization.
Uses flexible bonds to hydrogen. (Not Shake/Rattle constraints)
Source§impl MdState
impl MdState
pub fn new( dev: &ComputationDevice, cfg: &MdConfig, mols: &[MolDynamics], param_set: &FfParamSet, ) -> Result<Self, ParamError>
pub fn computation_time(&self) -> Result<ComputationTime>
pub fn save_snapshots_to_file(&mut self, path: &Path)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MdState
impl !RefUnwindSafe for MdState
impl !Send for MdState
impl !Sync for MdState
impl Unpin for MdState
impl !UnwindSafe for MdState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.