|
faunus
|
Base data structure for native XTC format as used in Gromacs and supported by the C library. More...
#include <io.h>
Public Member Functions | |
| XTCTrajectoryFrame (int number_of_atoms) | |
| Creates an empty XTC trajectory frame for given number of coordinates (atoms). More... | |
| XTCTrajectoryFrame (const TrajectoryFrame &frame) | |
| Creates an XTC trajectory frame from TrajectoryFrame and converts data accordingly. More... | |
| template<RequirePointIterator begin_iterator, class end_iterator > | |
| XTCTrajectoryFrame (int step, float time, const Point &box, begin_iterator coordinates_begin, end_iterator coordinates_end) | |
| Creates an XTC trajectory frame from scalar parameters and input iterator and converts data accordingly. More... | |
| XTCTrajectoryFrame & | operator= (const TrajectoryFrame &frame) |
| Copies TrajectoryFrame and converts data. More... | |
| void | importFrame (const TrajectoryFrame &frame) |
| Imports data from a TrajectoryFrame. More... | |
| template<RequirePointIterator begin_iterator, class end_iterator > | |
| void | importFrame (const int step, const float time, const Point &box, begin_iterator coordinates_begin, end_iterator coordinates_end) |
| Imports data from scalar parameters and an input iterator over coordinates. More... | |
| void | exportFrame (TrajectoryFrame &frame) const |
| Exports data from a TrajectoryFrame. More... | |
| template<RequirePointIterator begin_iterator, RequirePointIterator end_iterator> | |
| void | exportFrame (int &step, float &time, Point &box, begin_iterator coordinates_begin, end_iterator coordinates_end) const |
| Exports data to scalar paramers and output iterator over atomic coordinates. More... | |
Public Attributes | |
| XdrFile::matrix | xtc_box |
| box tensor; only diagonal elements are used | |
| std::unique_ptr< XdrFile::rvec[]> | xtc_coordinates |
| C-style array of particle coordinates. | |
| int | xtc_step = 0 |
| current frame number | |
| float | xtc_time = 0.0 |
| current time (unit?) | |
| int | number_of_atoms = 0 |
| number of coordinates (atoms) in each frame | |
| float | precision = 1000.0 |
| output precision | |
Protected Types | |
| using | XTCFloat = float |
| using | XTCMatrix = Eigen::Matrix< XTCFloat, 3, 3, Eigen::RowMajor > |
| using | XTCVector = Eigen::Matrix< XTCFloat, 3, 1 > |
Protected Member Functions | |
| void | importTimestamp (int step, float time) |
| Imports and converts step and timestamp. More... | |
| void | importBox (const Point &box) |
| Imports and converts simulation box dimensions. More... | |
| void | importCoordinates (const PointVector &coordinates, const Point &offset) |
| Imports and converts atomic coordinates. More... | |
| template<RequirePointIterator begin_iterator, typename end_iterator > | |
| void | importCoordinates (begin_iterator begin, end_iterator end, const Point &offset) const |
| Imports and converts atomic coordinates. More... | |
| void | exportTimestamp (int &step, float &time) const |
| Exports and converts step and timestamp. More... | |
| void | exportBox (Point &box) const |
| Exports and converts simulation box dimensions. More... | |
| void | exportCoordinates (PointVector &coordinates, const Point &offset) const |
| Exports and converts atomic coordinates. More... | |
| template<RequirePointIterator begin_iterator, typename end_iterator > | |
| void | exportCoordinates (begin_iterator begin, end_iterator end, const Point &offset) const |
| Exports and converts atomic coordinates. More... | |
Base data structure for native XTC format as used in Gromacs and supported by the C library.
Import methods do the data conversion from the Faunus native format to the XTC format, and export methods do the oposite.
By convention, XTC has coordinates' origin in a corner (main box's coordinates are always positive), while Faunus has coordinates' origin in the center of the simulation box. During conversion the corresponding offset is subtracted, or added, respectively.
XTC format uses floats (Faunus doubles) and dimensions are in nanometers (Faunus ångströms). XTC library requires raw 2D C-style arrays for coordinates in row-major format. XTC tensor of the simulation box is converted to an XYZ point pressuming orthogonal geometry bacause of current limitation of Faunus. XTC format does not support variable number of coordinates (atoms) between frames.
| Faunus::XTCTrajectoryFrame::XTCTrajectoryFrame | ( | int | number_of_atoms | ) |
Creates an empty XTC trajectory frame for given number of coordinates (atoms).
| number_of_atoms | number of coordinates (atoms) |
| Faunus::XTCTrajectoryFrame::XTCTrajectoryFrame | ( | const TrajectoryFrame & | frame | ) |
Creates an XTC trajectory frame from TrajectoryFrame and converts data accordingly.
| frame | source trajectory frame |
|
inline |
Creates an XTC trajectory frame from scalar parameters and input iterator and converts data accordingly.
| begin_iterator | |
| end_iterator |
| [in] | step | frame step |
| [in] | time | timestamp in picoseconds |
| [in] | box | box dimensions (xyz) in nanometers |
| [in] | coordinates_begin | input iterator with coordinates in nanometers |
| [in] | coordinates_end | input iterator's end |
|
protected |
Exports and converts simulation box dimensions.
| [out] | box | simulation box dimensions in nanometers (xyz) |
|
protected |
Exports and converts atomic coordinates.
Offset is subtracted from all coordinates to account different coordinates' origin.
| [out] | coordinates | atomic coordinates in nanometers |
| [in] | offset | offset in nanometers to subtract from all coordinates upon conversion |
| std::runtime_error | when the source box is not orthogonal |
|
inlineprotected |
Exports and converts atomic coordinates.
Offset is subtracted to all coordinates to account different coordinates' origin.
| begin_iterator | |
| end_iterator |
| [out] | begin | output iterator with coordinates in nanometers |
| [out] | end | output iterator's end |
| [in] | offset | offset in nanometers to subtract from all coordinates upon conversion |
| void Faunus::XTCTrajectoryFrame::exportFrame | ( | TrajectoryFrame & | frame | ) | const |
Exports data from a TrajectoryFrame.
| frame | target frame |
| std::runtime_error | when the number of coordinates does not match |
|
inline |
Exports data to scalar paramers and output iterator over atomic coordinates.
| begin_iterator | |
| end_iterator |
| [out] | step | frame step |
| [out] | time | frame timestamp |
| [out] | box | box dimensions (xyz) in nanometers |
| [out] | coordinates_begin | output iterator with coordinates in nanometers |
| [out] | coordinates_end | output iterator's end |
| std::runtime_error | when the number of coordinates does not match |
|
protected |
Exports and converts step and timestamp.
| [out] | step | frame step |
| [out] | time | frame timestamp |
|
protected |
Imports and converts simulation box dimensions.
| [in] | box | simulation box dimensions in nanometers (xyz) |
|
protected |
Imports and converts atomic coordinates.
Offset is added to all coordinates to account different coordinates' origin.
| [in] | coordinates | atomic coordinates in nanometers |
| [in] | offset | offset in nanometers to add to all coordinates upon conversion |
|
inlineprotected |
Imports and converts atomic coordinates.
Offset is added to all coordinates to account different coordinates' origin.
| begin_iterator | |
| end_iterator |
| [in] | begin | input iterator with coordinates in nanometers |
| [in] | end | input iterator's end |
| [in] | offset | offset in nanometers to add to all coordinates upon conversion |
| void Faunus::XTCTrajectoryFrame::importFrame | ( | const TrajectoryFrame & | frame | ) |
Imports data from a TrajectoryFrame.
| frame | source frame |
| std::runtime_error | when the number of coordinates does not match |
|
inline |
Imports data from scalar parameters and an input iterator over coordinates.
| begin_iterator | |
| end_iterator |
| [in] | step | frame step |
| [in] | time | frame timestamp |
| [in] | box | box dimensions (xyz) in nanometers |
| [in] | coordinates_begin | input iterator with coordinates in nanometers |
| [in] | coordinates_end | input iterator's end |
| std::runtime_error | when the number of coordinates does not match |
|
protected |
Imports and converts step and timestamp.
| [in] | step | frame step |
| [in] | time | frame timestamp |
| XTCTrajectoryFrame & Faunus::XTCTrajectoryFrame::operator= | ( | const TrajectoryFrame & | frame | ) |
Copies TrajectoryFrame and converts data.
Calls importFrame.
The number of coordinates is immutable to prevent mistakes.
| frame | source frame |
| std::runtime_error | when the number of coordinates does not match |
1.8.13