From: CHARLES MCCALLUM (cmccallum_at_me.com)
Date: Thu Apr 18 2024 - 13:18:51 CDT

We are trying to do an analysis in a tcl script, and I’m a bit confused as to how VMD acts versus how the VMD tcl command documentation suggests. I want to load the veldcd and regular dcd into two separate molids, but with the same psf:

set velid [mol new file.psf] ;# molid “0” for example
set trajid [mol new file.psf];# molid “1” for example
mol addfile file.veldcd type dcd waitfor all molid $velid
mol addfile file.dcd type dcd waitfor all molid $trajid

I would expect that adding the ‘molid $velid’ forces the veldcd to to into the molid 0, that is, the velocity dcd. But it always adds into the second molid (the top molid).

We work around this by always ‘mol addfile…’ after each new molid while it is the top:

set velid [mol new file.psf] ;# molid “0” for example
mol addfile file.veldcd type dcd waitfor all molid $velid
set trajid [mol new file.psf];# molid “1” for example
mol addfile file.dcd type dcd waitfor all molid $trajid

Or, we can explicitly set whichever one we want as the top with ‘mol top $velid’. But it makes me wonder why it doesn’t work in the first set of commands; the ‘molid $velid’ seems to be ignored. We have tried this with actual numbers instead of variables. In other words, the variables representing the molids are being set correctly. When I make selections for the calculation later on, setting the molid that I want (velocities or coordinates) works as expected with ‘atomselect’. Clearly I’m missing something here.

Thanks
Mike

--
C. Michael McCallum           
Professor                        
Department of Chemistry, UOP    
mmccallum .at. pacific .dot. edu                (209) 946-2636 v  / (209) 946-2607 fax