#$Id: zundel-all.vmd,v 1.1 2003/07/16 13:29:12 wwwadmin Exp $ ################################ # load the molecule mol new {zundel.xyz} type xyz mol addfile {zundel.dcd} type dcd waitfor all # delete default representation mol delrep 0 top # bonds mol representation DynamicBonds 1.2 0.15 10 mol color Name mol selection {not name X} mol material Opaque mol addrep top # atoms mol representation VDW 0.2 15 mol color Name mol selection {not name X} mol material Opaque mol addrep top # wannier centers mol representation VDW 0.15 12 mol color ColorId 15 mol selection {name X} mol material Glass mol addrep top mol rename top {Zundel Ion} ############################## # define function to (re-)draw the dipole vector proc do_dipdraw {args} { # dipdata has the center and the direction/lenght of the vector # dipgraph has the indices of the vector graphic elements global dipdata dipgraph set molid 0 # get the current frame number set frame [molinfo $molid get frame] if {[info exists dipdata($frame)]} then { if {[info exists dipgraph]} then { foreach g $dipgraph { graphics $molid delete $g } } graphics $molid color yellow lassign $dipdata($frame) cnt vec # scaling res radius set dipgraph [vmd_draw_vector $molid $cnt $vec 100000.0 10 0.08] } } # read in the dipole data set sel [atomselect 0 "not name X"] set dip [open "zundel.dip" r] set n [molinfo 0 get numframes] for {set i 0} {$i < $n} {incr i} { $sel frame $n $sel update set dipdata($i) [list [center_of_mass $sel] [gets $dip]] } close $dip trace variable vmd_frame(0) w do_dipdraw ############################## # function to draw the time bar with required options proc do_time {args} { # see source for explanations of the options display_time_bar 1.0 50.0 "fs" 0 } # connect do_time to vmd_frame trace variable vmd_frame(0) w do_time animate goto 0