From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Jan 15 2009 - 14:10:26 CST

On Thu, 15 Jan 2009, Cesar Luis Avila wrote:

CLA> Dear Axel,
CLA>
CLA> > you can of course write a script that stores the information in some
CLA> > (flat format) text file and then load this back with another script. this
CLA> > is what i am doing, since most of the properties that i compute and store
CLA> > in the user fields take a lot of time to compute..
CLA> Do you have any script file that I can follow as an example on how to
CLA> store/restore data from/to user data fields in an efficient way?

i don't know about efficient, but what i do is something
like the following:

set allres [atomselect top all]
set nf [molinfo top get numframes]
set fp [open "trajectory-user.dat" w]
    for {set i 0} {$i < $nf} {incr i} {
        $allres frame $i
        puts $fp "[$allres get user]"
}
close $fp

and to load it the inverse procedure.
it sure is _much_ faster than computing
the user field all the time.

axel.

CLA> Cheers
CLA> Cesar
CLA>
CLA>
CLA> Axel Kohlmeyer escribió:
CLA> > On Wed, 14 Jan 2009, Cesar Luis Avila wrote:
CLA> >
CLA> > CLA> Dear all,
CLA> >
CLA> > dear cesar,
CLA> >
CLA> > CLA> Regarding what I found on a previous message from Axel Kohlmeyer
CLA> > CLA>
CLA> > CLA> >data fields like mass, charge, beta, occupancy are stored
CLA> > CLA> >once per molecule. the only data fields that are once per
CLA> > CLA> >time step are x, y, z, and user. only the latest alpha test
CLA> > CLA> >versions add to this (e.g. multiple user files and velocities).
CLA> > CLA>
CLA> > CLA> I would like to know
CLA> > CLA>
CLA> > CLA> 1- Which is the alpha test version that he is referring to?
CLA> >
CLA> > the ones in the regular places. multiple user fields were added quite a
CLA> > while ago, but then again, it has been quite a while since
CLA> > the last release. i'm usually working with my self-compiled versions
CLA> > of VMD which are built from the (readonly) cvs version, so i always
CLA> > have to look up the changelog file to check at what point something
CLA> > was available. so multiple user fields were added on 2007-10-03, for
CLA> > example, so after the 1.8.6 release (which was 2007-04-07).
CLA> >
CLA> > CLA> 2- I think that also ufx, ufy and ufz are stored once per time step.
CLA> > CLA> Is there any problem on using these?
CLA> >
CLA> > those were itended for IMD, but i don't think that there would be a big
CLA> > problem.
CLA> >
CLA> > CLA> 3- It would be very nice to be able to save this data in a file in
CLA> > CLA> such a
CLA> > CLA> way that it could be easily restored and loaded along with the dcd
CLA> > CLA> file.
CLA> >
CLA> > ...or a new file format that contains all data in a consistent way,
CLA> > so you don't have to shuffle multiple files around and make certain
CLA> > that they are consistent.
CLA> >
CLA> > CLA> Is there such a feature in vmd?
CLA> >
CLA> > not really. well, not yet, that is. feel free to pick up your favorite
CLA> > text editor and help implementing it.
CLA> >
CLA> > you can of course write a script that stores the information in some
CLA> > (flat format) text file and then load this back with another script. this
CLA> > is what i am doing, since most of the properties that i compute and store
CLA> > in the user fields take a lot of time to compute...
CLA> >
CLA> > cheers,
CLA> > axel.
CLA> >
CLA> > CLA>
CLA> > CLA> Best regards
CLA> > CLA> Cesar Avila
CLA> > CLA>
CLA> >
CLA> >
CLA>
CLA>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.