From: Ignacio Fernández Galván (jellby_at_yahoo.com)
Date: Wed Jul 30 2008 - 02:24:58 CDT

--- On Wed, 23/7/08, Axel Kohlmeyer <akohlmey_at_cmm.chem.upenn.edu> wrote:

> if you don't want to use the dummy atom option that i suggested,
> and compute everything explicitly, you can use the "user" field
> to store per-timestep information about each atom of your system.
> this can not only be used to color code atoms but to do selections
> (user > 0).

Thank you all for your suggestions.

I could have used the dummy atom, but can I add atoms to a molecule in VMD? and can I add them (easily) to a dcd file? Or can I use atoms in another molecule in a selection?

I load an xyz file with my solute, and a dcd file with all the coordinates of solute + solvent molecules, and then align and wrap every frame of the dcd to fit the solute in the xyz file. Then I solved my problem with this script:

# calculate the coordinates of the "dummy atoms" P1 and P2
set V1 [expr [[atomselect 0 "index 0"] get {x y z}]]
set V2 [expr [[atomselect 0 "index 1"] get {x y z}]]
set V3 [expr [[atomselect 0 "index 2"] get {x y z}]]
set V4 [expr [[atomselect 0 "index 3"] get {x y z}]]
set V5 [expr [[atomselect 0 "index 4"] get {x y z}]]
set V6 [expr [[atomselect 0 "index 5"] get {x y z}]]
set Cen [vecscale [expr 1.0/6] [vecadd $V1 $V2 $V3 $V4 $V5 $V6]]
set Per [vecnorm [veccross [vecsub $V3 $V1] [vecsub $V5 $V1]]]
set P1 [vecadd $Cen [vecscale 3.5 $Per]]
set P2 [vecsub $Cen [vecscale 3.5 $Per]]

# set the user field with the distance to the "dummy atoms"
set solv [atomselect 1 "all"]
for {set i 0} {$i < $n} {incr i} {
  set dist {}
  $solv frame $i
  foreach pos [$solv get {x y z}] {
    set d1 [vecdist $P1 $pos]
    set d2 [vecdist $P2 $pos]
    if {$d1 < $d2} {lappend dist $d1} else {lappend dist $d2}
    unset d1 d2
  }
  $solv set user $dist
  unset dist
}

... and then I can use the user field in representations and calculations.

      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html