From: Sangkha Borah (
Date: Tue Mar 01 2016 - 10:18:58 CST

Dear all,

I am trying to calculate the interatomic distances between various atom
pairs in a small periodic system containing an oxoanion dissolved in 60
water molecules (the same is also true for a crystalline solid). The
trajectory is wrapped about the origin. I wanted to use vmd/tcl script
using pbctools

The main part of the script goes like --

package require pbctools
pbc set {12.42 12.42 12.42} -all
set outfile [open "test.dat" w]
set nf [molinfo top get numframes]
set ind1 [atomselect top "index 1"]
set ind4 [atomselect top "index 4"]
for {set i 0} {$i < $nf} {incr i} {
         $ind1 frame $i
         $ind4 frame $i
         set dis1_4 [veclength [vecsub [lindex [$ind4 get {x y z}] 0]
[lindex [$ind1 get {x y z}] 0] ]]
         puts $outfile "$i \t $dis1_4 "

close $outfile

This script works!

But does it incorporate pbc while calculating the distance ?

My intuition is that it perhaps does not! At least the GUI version does not
do it.

Am I correct ?

If so, is there any other way to do so , like the one "pbwithin" instead
of within that is used to find the neighbours within a certain cutoff
distance using pbc.

Please help to clear my doubts.


Sangkha Borah
IIT Guwahati, Assam, India