pub struct PyMdBinding { /* private fields */ }Expand description
PyO3-style binding handle for an MD simulation.
Wraps PyMdSimulation and exposes flat-array query helpers that mirror the
#[pymethods] surface that would be used with the real PyO3 macro
expansion. All methods take and return primitive Rust types so that
future #[pyfunction] / #[pymethods] annotations require no changes.
Implementations§
Source§impl PyMdBinding
impl PyMdBinding
Sourcepub fn new_default() -> Self
pub fn new_default() -> Self
Create a new MD binding with the default (argon-reduced) configuration.
Sourcepub fn new(config: PyMdConfig) -> Self
pub fn new(config: PyMdConfig) -> Self
Create from explicit configuration.
Sourcepub fn add_atom(
&mut self,
x: f64,
y: f64,
z: f64,
vx: f64,
vy: f64,
vz: f64,
atom_type: u32,
) -> usize
pub fn add_atom( &mut self, x: f64, y: f64, z: f64, vx: f64, vy: f64, vz: f64, atom_type: u32, ) -> usize
Add an atom at [x, y, z] with optional velocity [vx, vy, vz].
Returns the index of the newly added atom.
Sourcepub fn atom_count(&self) -> usize
pub fn atom_count(&self) -> usize
Return the number of atoms.
Sourcepub fn step(&mut self, dt: f64)
pub fn step(&mut self, dt: f64)
Advance the simulation by dt (reduced units or SI, consistent with config).
Sourcepub fn run_steps(&mut self, n_steps: u32, dt: f64)
pub fn run_steps(&mut self, n_steps: u32, dt: f64)
Advance the simulation by n_steps steps, each of size dt.
Sourcepub fn get_positions_flat(&self) -> Vec<f64>
pub fn get_positions_flat(&self) -> Vec<f64>
Return positions as a flat [x0,y0,z0, x1,y1,z1, …] array.
Sourcepub fn get_velocities_flat(&self) -> Vec<f64>
pub fn get_velocities_flat(&self) -> Vec<f64>
Return velocities as a flat array.
Sourcepub fn get_energies(&self) -> [f64; 3]
pub fn get_energies(&self) -> [f64; 3]
Return [kinetic, potential, total] energy.
Sourcepub fn get_temperature(&self) -> f64
pub fn get_temperature(&self) -> f64
Instantaneous temperature in reduced units (from equipartition theorem).
Sourcepub fn elapsed_time(&self) -> f64
pub fn elapsed_time(&self) -> f64
Total simulation time elapsed.
Sourcepub fn step_count(&self) -> u64
pub fn step_count(&self) -> u64
Number of completed time steps.
Sourcepub fn set_thermostat_enabled(&mut self, enabled: bool)
pub fn set_thermostat_enabled(&mut self, enabled: bool)
Enable or disable the velocity-rescaling thermostat at runtime.
Sourcepub fn set_target_temperature(&mut self, temp: f64)
pub fn set_target_temperature(&mut self, temp: f64)
Set the target temperature (reduced units).
Trait Implementations§
Source§impl Clone for PyMdBinding
impl Clone for PyMdBinding
Source§fn clone(&self) -> PyMdBinding
fn clone(&self) -> PyMdBinding
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PyMdBinding
impl RefUnwindSafe for PyMdBinding
impl Send for PyMdBinding
impl Sync for PyMdBinding
impl Unpin for PyMdBinding
impl UnsafeUnpin for PyMdBinding
impl UnwindSafe for PyMdBinding
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.