[gmx-developers] saving modified trajectory
titov_ai
titov_ai at pnpi.nrcki.ru
Mon Feb 11 23:33:58 CET 2019
Hello.
A bit overview about the goal:
I've been using the gromacs template for a trajectory analysis tool.
First i have to read the trajectory, then modify it and save it again.
As i dont need most of the information from MD trajectory i dont have
issues with saving it in the memory.
But creating a pdb one is not an optimal solution i've found a function
in gromacs libs:
"write_trxframe_indexed" in "gromacs/fileio/trxio.h"
and its a bit unclear how exactly should i use the function
Also i encountered an issue (which might be a simple misunderstanding
from my side):
while reading frames with
void <project name>::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc
*pbc, ...) {...}
i try to save the "fr" into defined much earlier "std::vector<
t_trxframe > saved_traj" by
"saved_traj.push_back(fr)" which seems to copy the link to whereever the
"fr" is stored and i end up having trajectory sized vector with
identical links to the last frame
is this happening because i need to save it differently or because teh
code does not do a deep copy and ending loosing data ?
Best wishes,
Anatoly Titov, phd sudent, PNPI.
More information about the gromacs.org_gmx-developers
mailing list