On 30/11/2010 11:10 AM, ???????????? wrote:
Dear Mark,
Thank you for your reply. It seems reasonable to deal with a frame at
one time. But in my code, the coordinates in two different frames are
frequently required to compare to each other. Other part of this code
is like g_msd which calculates the mean-squared displacements for the
atoms satisfied with the conditions. So, first of all, I had better
save the coordinates in the 2D-arrays using xdrfile. I do not find
such a tool in gmx that can realize it. Is there any other algorithms
to do so more effectively? Please provide more detail about it.
You'll have fewer headaches if you build your arrays as
position[frame][atom][axisdirection] i.e. of rvec**. You'll also likely
get better cache performance than if you separate the x, y and z
coordinates, which you're likely to want to use together.
If you're doing an all-against-all analysis, you can structure that as
two loops over frames such that you only need two frames in memory at
any time. Likewise if you can determine the pairs of frames that need to
be analysed, and put them in a sorted list.
Mark
Yours sincerely,
Chaofu Wu, Dr.
------------------ ???????? ------------------
*??????:* "Mark Abraham"<[email protected]>;
*????????:* 2010??11??29??(??????) ????7:38
*??????:* "Discussion list for GROMACS users"<[email protected]>;
*????:* Re: [gmx-users] How to save the coordinates of all atoms inthe
2D-arrays using xdrfile?
On 28/11/2010 12:12 AM, ???????????? wrote:
> Dear gmxers,
> I am trying to perform an analysis on the trjectory file using xdrfile
> library. First of all, I want to save the coordinates of all atoms in
> three 2D-arrays, i.e. xx[step-1][natom-1], yy[step-1][natom-1],
> zz[step-1][natom-1]. How to do so? Could you give me some hints,
> please? If you had happened to do so, could you kindly send the code
> to me? Thanks a lot.
> Yours sincerely,
> Chaofu Wu, Dr.
You probably don't want to do that, because it doesn't scale to large
numbers of trajectory frames - you will run out of memory eventually. If
at all possible you should structure your algorithm to deal with one
frame at a time. There are already GROMACS functions that make that
easy. Pick a GROMACS trajectory analysis tool that sounds fairly simple
and vaguely similar to what you want to do, and look at how its code
works.
Mark
--
gmx-users mailing list [email protected]
http://lists.gromacs.org/mailman/listinfo/gmx-users
Please search the archive at
http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
Please don't post (un)subscribe requests to the list. Use the
www interface or send it to [email protected].
Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
--
gmx-users mailing list [email protected]
http://lists.gromacs.org/mailman/listinfo/gmx-users
Please search the archive at
http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
Please don't post (un)subscribe requests to the list. Use the
www interface or send it to [email protected].
Can't post? Read http://www.gromacs.org/Support/Mailing_Lists