[]Struct lumol::sys::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();

Methods

impl Trajectory

Read the next step of the trajectory

Examples

let mut trajectory = TrajectoryBuilder::new()
    .open("file.nc")
    .unwrap();

let system = trajectory.read().unwrap();

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();

Write the system to the trajectory.

Examples

let mut trajectory = TrajectoryBuilder::new()
    .mode(OpenMode::Write)
    .open("file.xyz")
    .unwrap();

trajectory.write(&system).unwrap();

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)).unwrap();
let system = trajectory.read().unwrap();

assert_eq!(system.cell, UnitCell::cubic(10.0));

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 !Send for Trajectory

impl !Sync for Trajectory

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Important traits for &'a mut R

Immutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Important traits for &'a mut R

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more