Reads frames from an XTC file (GROMACS compressed trajectory file format).
More...
#include <io.h>
|
| | XTCReader (const std::string &filename) |
| |
| int | getNumberOfCoordinates () |
| | Returns number of coordinates (atoms) in each frame. More...
|
| |
| bool | read (TrajectoryFrame &frame) |
| | Reads the next frame in the trajectory from a file. More...
|
| |
| template<RequirePointIterator begin_iterator, typename end_iterator > |
| bool | read (int &step, float &time, Point &box, begin_iterator coordinates_begin, end_iterator coordinates_end) |
| | Reads the next frame in the trajectory. More...
|
| |
|
|
std::string | filename |
| | name of the trajectory file, mainly for error reporting
|
| |
|
| bool | readFrame () |
| | Actual wrapper around C function that reads the next frame into xtc_frame. More...
|
| |
Reads frames from an XTC file (GROMACS compressed trajectory file format).
It is a wrapper around C function calls.
Frames are stored into a TrajectoryFrame structure or as a list of positions in an output iterator. The class is responsible for I/O operations, not data conversion. For details about data conversion XTCTrajectoryFrame.
◆ XTCReader()
| Faunus::XTCReader::XTCReader |
( |
const std::string & |
filename | ) |
|
|
explicit |
- Parameters
-
| filename | a name of the XTC file to open |
◆ getNumberOfCoordinates()
| int Faunus::XTCReader::getNumberOfCoordinates |
( |
| ) |
|
Returns number of coordinates (atoms) in each frame.
Immutable during object lifetime.
- Returns
- number of coordinates (atoms)
◆ read() [1/2]
Reads the next frame in the trajectory from a file.
- Parameters
-
- Returns
- true on success, false at the end of file
- Exceptions
-
| std::runtime_error | when other I/O error occures |
◆ read() [2/2]
template<RequirePointIterator begin_iterator, typename end_iterator >
| bool Faunus::XTCReader::read |
( |
int & |
step, |
|
|
float & |
time, |
|
|
Point & |
box, |
|
|
begin_iterator |
coordinates_begin, |
|
|
end_iterator |
coordinates_end |
|
) |
| |
|
inline |
Reads the next frame in the trajectory.
- Template Parameters
-
| begin_iterator | |
| end_iterator | |
- Parameters
-
| [out] | step | frame step |
| [out] | time | frame timestamp in picoseconds |
| [out] | box | box dimensions (xyz) in nanometers |
| [out] | coordinates_begin | output iterator to store coordinates |
| [out] | coordinates_end | output iterator's end |
- Returns
- true on success, false at the end of file
- Exceptions
-
| std::runtime_error | when other I/O error occures |
◆ readFrame()
| bool Faunus::XTCReader::readFrame |
( |
| ) |
|
|
protected |
Actual wrapper around C function that reads the next frame into xtc_frame.
- Returns
- true on success, false at the end of file
- Exceptions
-
| std::runtime_error | when other I/O error occures |
The documentation for this class was generated from the following files: