25#include <gromacs/fileio/trxio.h>
26#include <gromacs/trajectory/trajectoryframe.h>
36 file_ = open_trx((
char *)file.c_str(),
"w");
44 rvec *x =
new rvec[N];
47 Eigen::Matrix3d box = conf->
getBox();
49 frame.natoms = (int)N;
51 frame.time = real(conf->
getTime());
54 frame.bLambda =
false;
62 for (
Index i = 0; i < 3; i++) {
63 for (
Index j = 0; j < 3; j++) {
64 frame.box[j][i] = real(box(i, j));
68 for (
Index i = 0; i < N; ++i) {
70 x[i][0] = real(pos.x());
71 x[i][1] = real(pos.y());
72 x[i][2] = real(pos.z());
77 for (
Index i = 0; i < N; ++i) {
80 v[i][0] = real(vel.x());
81 v[i][1] = real(vel.y());
82 v[i][2] = real(vel.z());
87 for (
Index i = 0; i < N; ++i) {
90 f[i][0] = real(force.x());
91 f[i][1] = real(force.y());
92 f[i][2] = real(force.z());
96 write_trxframe(
file_, &frame,
nullptr);
virtual const Eigen::Vector3d & getPos() const
const Eigen::Vector3d & getF() const
get the force acting on the bead
const Eigen::Vector3d & getVel() const
void Write(Topology *conf) override
void Open(std::string file, bool=false) override
topology of the whole system
const Eigen::Matrix3d & getBox() const
Bead * getBead(const Index i)
Returns a pointer to the bead with index i.
base class for all analysis tools