[−]Struct lumol::Trajectory
A Trajectory is a file containing one or more successive simulation steps.
One should use the TrajectoryBuilder
to
create a new trajectory.
Examples
let mut trajectory = TrajectoryBuilder::new() .open("file.xyz") .unwrap(); let system = trajectory.read().unwrap();
Implementations
impl Trajectory
pub fn read(&mut self) -> Result<System, Error>
Read the next step of the trajectory
Examples
let mut trajectory = TrajectoryBuilder::new() .open("file.nc") .unwrap(); let system = trajectory.read().unwrap();
pub fn read_guess_bonds(&mut self) -> Result<System, Error>
Read the next step of the trajectory, and guess the bonds of the
resulting [System
][struct.System.html].
Examples
let mut trajectory = TrajectoryBuilder::new() .open("file.nc") .unwrap(); let system = trajectory.read_guess_bonds().unwrap();
pub fn write(&mut self, system: &System) -> Result<(), Error>
Write the system to the trajectory.
Examples
let mut trajectory = TrajectoryBuilder::new() .mode(OpenMode::Write) .open("file.xyz") .unwrap(); trajectory.write(&system).unwrap();
pub fn set_cell(&mut self, cell: &UnitCell)
Set the unit cell associated with a trajectory. This cell will be used when reading and writing the files, replacing any unit cell in the frames or files.
Examples
let mut trajectory = TrajectoryBuilder::new() .open("file.xyz") .unwrap(); trajectory.set_cell(&UnitCell::cubic(10.0)); let system = trajectory.read().unwrap(); assert_eq!(system.cell, UnitCell::cubic(10.0));
pub fn set_topology_file(&mut self, path: &str) -> Result<(), Error>
Set the topology associated with this trajectory by reading the first
frame of the file at the given path
and extracting the topology of
this frame. This topology will be used to replace any existing topology
when reading or writing with this trajectory.
Examples
let mut trajectory = TrajectoryBuilder::new() .open("file.xyz") .unwrap(); trajectory.set_topology_file("topology.pdb").unwrap(); // The system will contain the topology from topology.pdb let system = trajectory.read().unwrap();
Auto Trait Implementations
impl RefUnwindSafe for Trajectory
impl !Send for Trajectory
impl !Sync for Trajectory
impl Unpin for Trajectory
impl UnwindSafe for Trajectory
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>,