[]Struct lumol::Trajectory

pub struct 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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,