From: Thomas Aldershof (tald574_at_aucklanduni.ac.nz)
Date: Wed Jul 20 2016 - 01:36:21 CDT

Hey all,

I am fairly new to VMD and am just getting started with TCL scripting.
I would like to visualise a phase change from solid to liquid with VMD, I
already have all necessary information in a xyz trajectory file where each
atom line has the format:
1 x y z q6
Where q6 is the Steinhardt parameter I use to distinguish solid and liquid.

I've tried storing the liquid/solid information as the element in a new xyz
file, liquid/solid = Ag/Au. To do this, I try to follow the buckyball
example in 5.3 of this tutorial
<http://www.ks.uiuc.edu/Training/Tutorials/cpmd-vmd.pdf>, however it still
only loads the element information of the first frame and it does not
update. I understand that this is an inherent trait of VMD, but I thought
one could work around it with scripting.

Is there any way to update the selection/colouring by element or
alternatively can I upload the liquid solid information straight from the
original file with the q6 parameter.

Thanks for any help you can provide,
Thom

p.s. The script file I am using, for reference:

# $Id: track_element.vmd$
set viewplist {}
# Display settings
display projection Orthographic
display nearclip set 0.000000
display depthcue off

mol new {liqsol_Al6_1.xyz} type xyz waitfor all autobonds off
animate goto 0
mol delrep 0 top
mol representation cpk 0.950000 0.000000
mol color User
mol selection {all}
mol material Opaque
mol addrep top

mol colupdate 0 top 1
mol scaleminmax top 0
mol representation DynamicBonds 1.600000 0.200000 19.000000
mol color user
mol addrep top
mol rename top {Wire}
set viewpoints([molinfo top]) {{{1.000000 0.000000 0.000000 0.000001}
{0.000000 1.000000 0.000000 0.000000} {0.000000 0.000000 1.000000
-0.000000} {0.000000 0.000000 0.000000 1.000000}} {{0.975860 -0.027307
0.216693 0.000000} {0.061060 0.986706 -0.150639 0.000000} {-0.209698
0.160234 0.964556 0.000000} {0.000000 0.000000 0.000000 1.000000}}
{{0.090228 0.000000 0.000000 0.000000} {0.000000 0.090228 0.000000
0.000000} {0.000000 0.000000 0.090228 0.000000} {0.000000 0.000000 0.000000
1.000000}} {{1.000000 0.000000 0.000000 0.000000} {0.000000 1.000000
0.000000 0.000000} {0.000000 0.000000 1.000000 0.000000} {0.000000 0.000000
0.000000 1.000000}}}
lappend viewplist [molinfo top]
# done with molecule

foreach v $viewplist {
  molinfo $v set {center_matrix rotate_matrix scale_matrix global_matrix}
$viewpoints($v)
}
unset viewplist

# Set selection and obtain liquid solid classification from element
set mol top
set wire [atomselect $mol all]
set n [ molinfo $mol get numframes ]

for {set i 0} {$i < $n} {incr i} {
    $wire frame $i
    set el_list "";
    # Get the element for each atom Au = solid, Ag = liquid.
    foreach el [$wire get {element}] {
set sol 0
if [ expr { $el == "Au" } ] {
set sol 1
}
lappend el_list $sol;
    }
#puts [ llength $el_list ]
    $wire set user $el_list;

}

animate style loop
animate speed 0.8
animate forward