From: Vlad Cojocaru (Vlad.Cojocaru_at_eml-r.villa-bosch.de)
Date: Fri Oct 26 2007 - 09:04:03 CDT

Dear VMD users,

I am sorry I rushed to post the question before. The solution is an
obvious one, one just needs to multiply the box vectors with the 4x4
transformation matrix using the command "vectrans". The lines below will
give the new box vectors of the box that was transformed with the vmd
script from previous email. And I hope this is the correct solution.

Hope this solution will be useful for somebody .... so that posting this
question was not in vain ...

Cheers
vlad

set a {a 0 0}
set b {0 b 0}
set c {0 0 c}
set new_a [vectrans $tm1 $a]
set new_b [vectrans $tm1 $b]
set new_c [vectrans $tm1 $c]
puts "the new periodic cell vectors are:"
puts "$new_a"
puts "$new_b"
puts "$new_c"

Vlad Cojocaru wrote:

> Dear VMD users,
>
> I need to transform the coordinates of my system in such a way that a
> vecor v {vx vy vz} is brought to the x axis. The system is a cubic
> periodic box with the vectors {a 0 0}, {0 b 0}, and {0 0 c}. When I
> apply the transformations in the script below, the periodic box
> rotates such as that the vectors are not valid anymore. Could somebody
> give an advice on how to derive the new cell vectors for the
> transformed coordinates ?
>
> Thank you very much in advance,
>
> Best wishes
> vlad
>
> --------VMD transformation script -------------
> mol load parm7 a.top
> mol addfile a_rst.coor type pdb set all [atomselect top "all"]
> set sel1 [atomselect top "resid 230"]
> set center_sel1 [measure center $sel1]
> set sel2 [atomselect top "name CA and resid 76 192"]
> set center_sel2 [measure center $sel2]
> set smd_dir [vecnorm [vecsub $center_sel2 $center_sel1]]
> puts "Direction of force is $smd_dir"
> set tm1 [transvecinv "$smd_dir"]
> $all move $tm
> unset all
> set all [atomselect top "all"]
> set center [measure center $all]
> set tm2 [trans origin "$center"]
> $all move $rm2
> $all writepdb a.pdb
> quit
>

-- 
----------------------------------------------------------------------------
Dr. Vlad Cojocaru
EML Research gGmbH
Schloss-Wolfsbrunnenweg 33
69118 Heidelberg
Tel: ++49-6221-533266
Fax: ++49-6221-533298
e-mail:Vlad.Cojocaru[at]eml-r.villa-bosch.de
http://projects.villa-bosch.de/mcm/people/cojocaru/
----------------------------------------------------------------------------
EML Research gGmbH
Amtgericht Mannheim / HRB 337446
Managing Partner: Dr. h.c. Klaus Tschira
Scientific and Managing Director: Prof. Dr.-Ing. Andreas Reuter
http://www.eml-r.org
----------------------------------------------------------------------------