Draw Simulation Box

Mac

alias vmd='/Applications/VMD/VMD\ 1.9.1.app/Contents/MacOS/startup.command'

Linux install

cd Downloads

tar xvf vmd-1.9.1.bin.LINUXAMD64.opengl.tar.gz

cd vmd-1.9.1

sudo su

./configure LINUXAMD64

cd src

make install

draw delete all

draw color red

molinfo top set {a b c} {20 20 20}

pbc box_draw

molinfo top set {a b c} {20 20 20}

pbc box -on -color green

draw line "x0 y0 z0" "x0 y0 z1" width 2

draw line "x0 y0 z0" "x0 y1 z0"

draw line "x0 y0 z0" "x1 y0 z0"

sphere

graphics top sphere {0 0 0} radius 5 resolution 80

draw material Transparent

# get the number of frames in the movie set num [molinfo top get numframes] # loop through the frames for {set i 0} {$i < $num} {incr i} { # go to the given frame animate goto $i # take the picture set filename snap.[format "%04d" $i].rgb render snapshot $filename }

pbc set {10.5 3.0 20.3 90 90 90} -all #"-all" means for all frames

pbc box -on -color green

pbc box -center bb

http://www.ks.uiuc.edu/Research/vmd/plugins/pbctools/

#set different boxes for different frames

pbc set {7.937005 7.937005 7.937005 90.000000 90.000000 90.000000} -first 0 -last 0

pbc set {7.937005 7.937005 7.937005 90.000000 90.000000 90.000000} -first 1 -last 1

pbc set {7.805111 7.838550 7.776138 90.532463 90.061517 90.037390} -first 2 -last 2

pbc set {7.791769 7.794349 7.883833 89.167441 89.531917 89.769540} -first 3 -last 3

pbc set {7.860835 7.994905 7.932628 89.115031 91.231666 90.093857} -first 4 -last 4

pbc set {7.876932 8.068487 8.051696 90.156578 89.047838 89.993569} -first 5 -last 5

... ... ...

pbc box -on -color green

vmd movie.xyz movie.dcd

animate write psf movie.psf beg 1 end 1

vmd movie.psf movie.dcd

open vmd

cd ~/users/movies/

topo readlammpsdata data.lammps angle

[atomselect top "name 1"] set name N

[atomselect top "name N"] set radius 20

[atomselect top "name 2"] set name O

[atomselect top "name 3"] set name C

animate write psf movie.psf

vmd movie.psf movie.dcd

pbc box -center bb

pbc wrap -all

pbc unwarp -all

pbc join fragment -bondlist -all

render high resolution snapshots

Click "Render" and choose "Tachyon" in "Render the current scene using".

In the "Render Command:", specify "-res xxx yyy" the resolution.

Remove long bonds that cross the box?

http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/23787.html

"You can simply remove those bonds that stretch the whole box. To do that, you can use the following Tcl function. Copy it into your ~/.vmdrc file, then you can call "remove_long_bonds 10" in the VMD console to remove all bonds that are longer than 10. The number depends on your specific system, it just needs to be longer than any real bond in the system. A reasonable value would be half the size of the simulation box. Beware that this has a few consequences. After the operation, the bonds are gone from the system, so when you have a simulation over several timesteps, the bonds will be gone even after the atoms have moved. Also, if you would like to write the molecule's data to another file afterwards, the bonds will not be included. Furthermore,"

proc remove_long_bonds { max_length } {

set n [ molinfo top get numatoms ]

for { set i 0 } { $i < $n } { incr i } {

set bead [ atomselect top "index $i" ]

set bonds [ lindex [$bead getbonds] 0 ]

if { $i % 1000 == 0 || $i == $n-1 } then {

vmdcon -info "$i / $n"

}

if { [ llength bonds ] > 0 } {

set bonds_new {}

set xyz [ lindex [$bead get {x y z}] 0 ]

foreach j $bonds {

set bead_to [ atomselect top "index $j" ]

set xyz_to [ lindex [$bead_to get {x y z}] 0 ]

$bead_to delete

if { [ vecdist $xyz $xyz_to ] < $max_length } {

lappend bonds_new $j

}

}

$bead setbonds [ list $bonds_new ]

}

$bead delete

}

vmdcon -info "$n / $n"

}

copy above script to "removelongbond.tcl"

source removelongbond.tcl

remove_long_bonds 10