xdrfile
Read and write xdr trajectory files in .xtc and .trr file format
This crate is mainly intended to be a wrapper around the GROMACS libxdrfile XTC library and provides basic functionality to read and write xtc and trr files with a safe api.
Basic usage example
use *;
use Path;
let mut path = new;
// get a handle to the file
let mut trj = open.unwrap;
// find number of atoms in the file
let num_atoms = trj.get_num_atoms.unwrap;
// a frame object is used to get to read or write from a trajectory
// without instantiating data arrays for every step
let mut frame = with_capacity;
// read the first frame of the trajectory
let result = trj.read;
match result
Frame iteration
For convenience, the trajectory implementations provide "into_iter" to be turned into an iterator that yields Rc. If a frame is not kept during iteration, the Iterator reuses it for better performance (and hence, Rc is required)
use *;
use Path;
let mut path = new;
// get a handle to the file
let trj = open.unwrap;
// iterate over all frames
for in trj.into_iter.filter_map.enumerate