[gmx-users] Length of .xtc file in frames for C-Code

GtrAngus maps99 at online.de
Fri Apr 4 03:06:34 CEST 2014


Hi to all! :)

@ Mirco Wahab

It is a mixture of both, I guess. I do know the total number of frames in my
traj.xtc, it is 80.000. Furthermore, I am doing some averaging and other
stuff, so I need the total number of frames. Actually, I could write a
C-Code which is very very brute force, so I just would make a counter++

Something like

static int analyze_frame(t_topology *top, t_trxframe *fr, t_pbc *pbc,
              int nr, gmx_ana_selection_t *sel[], void *data)
{
     counter++;
}

and then I would have the total numer of frames and I could continue with
the next analysis. But I would prefer something smaller, just like you wrote
Mirco. But I have never seen this kind of code..?? Is it Pascal?


@ Barnett, James W.
I do not have any XDR files. In fact, I do the calculations like you do it.
But in this particular case I need all the informations from all the frames
and in the next step I do my calculations. But for the second step I need
the total number of all frames to initialze new variables. I managed to
solve this problem but I am still interested to have just 1-2 slices of code
because I think this might be very useful! :)

@Justin Lemkul
This looks very good! But I must admit, I have absolutely NO idea what to do
with these files or how I get access to the number of files with this code.
I will take a closer look the next few days! :)

--
View this message in context: http://gromacs.5086.x6.nabble.com/Length-of-xtc-file-in-frames-for-C-Code-tp5015607p5015631.html
Sent from the GROMACS Users Forum mailing list archive at Nabble.com.


More information about the gromacs.org_gmx-users mailing list