From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Tue Oct 03 2006 - 11:11:45 CDT

On 10/3/06, Shenoy, Sukesh <sukeshshenoy_at_neo.tamu.edu> wrote:
> Howdy,

> I have loaded a 1000 nitromethane molecules on 16384 frames. However i
> need the position of just one particular molecule on all frames. So i wrote
> a script file to do this. However it gives me a generic windows error
> message after the script runs for a certain time and then VMD closes.

hi,
this is a classic. your script has a memory leak. for details please look at:
http://biocore.ks.uiuc.edu/biocore/biofs/VMD%20(Public)/tips/tclscripts.html

on top of that, please have a closer look at the atomselect documentation.
you may be able to simplify your script immensely.

axel.

> Surprisingly the same script file runs for 1000 water molecules perfectly
> and using VMD menu i am able to store all the coordinates. I have a 1 GB
> memory, so i am not sure if this is a memory problem. My script file is
> below. please suggest ideas.
>
> set outfile [open nitromethane.xyz w];
> set nf [molinfo top get numframes];
> for { set i 0 } { $i <= $nf } { incr i } {
> set sel [atomselect top "resid 1" frame $i];
> $sel writexyz w.xyz;
> set fd [open w.xyz r];
> set s [read $fd];
> close $fd;
> puts $outfile $s;
> }
> close $outfile;
>
>
>
> Thanks,
> Sukesh
>
>
>
>
>
>

-- 
=======================================================================
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.