From: Vikas Varshney (vv0210_at_gmail.com)
Date: Mon Oct 15 2012 - 10:53:26 CDT

Dear John, Axel,

I have a trajectory of my system of interest (CNTs) which I want to
visualize with certain color scheme associated with retrival of bonds
information.

Basically, I am stretching a CNT and would like to color the atoms based on
the longest bond distance. I have looked over the forum to get some
insights on how to color atoms based on user defined parameters and have
the following TCl script which hopefully will do the job. I need some help
with how to retrive bond information so that I can calculated bond lengths
for each atom with its bonding pairs.

I am using Axel's topotools package to load the lammps data file which I
think is loading bond information as well. Below is the template of the TCl
script

-------------------
#/usr/bin/tclsh

 set lmpdata [atomselect 0 all] #This contains topology information
 set lmptrj [atomselect 1 all] #This is the trajectory file

 for {set i 0} {$i < [molinfo 1 get numframes]} {incr i} {
 $lmptrj frame $i
 foreach atomind [$allsel get index] {
 set csel [atomselect 1 "index $atomind" frame $i]
 # Get indices of other atoms that are connected to atom "atomind"
 # Calculate distance of each bond pair with one atom "atomind" using
vector operators or some other functions
 # Get the largest distance (ldist)
 # Color atom
 $csel set user $ldist
 $csel delete
 }
 }

 $lmpsdata delete
 $lmptrj delete

-------------------

I will highly appreciate any other suggestions as well.

Best Regards,
Vikas