Vectors and indexing in VMD

From: Chun Heung Wong (
Date: Tue Jan 23 2018 - 06:16:00 CST

Dear all,

I am trying to make my first MD simulation in NAMD, by adapting the
Nanopore-tutorial files on the website. To accurately set up my problem, I
need to shift some atoms around along a specific vector. The vector
components were calculated in previous code, lets say (a, b, c).

I have 2 difficulties:
# Example vector components
set a 0
set b 1
set c 2

#Creating vector from previous variables
set mov_vec {$a, $b, $c}
puts $mov_vec

it returns: $a, $b, $c
instead of 0, 1, 2

Furthermore, for a given vector "set vec {0,1,2}", I cannot access vector
components with e.g. vec(1), vec[1], vec{1} etc.

I tried looking up the syntax, but I believe it is not documented. I fixed
my specific problem by just hard-coding the right coordinates in, but is
there any way to assign vectors using previously declared variables and to
access vector components?

Yours sincerely,

Chun Heung Wong

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2019 - 23:19:37 CST