VMD-L Mailing List
From: kirtana S (skirtana4_at_gmail.com)
Date: Tue Sep 20 2011 - 10:54:07 CDT
- Next message: Alexandr Kornev: "NetCDF plugin"
- Previous message: Axel Kohlmeyer: "Re: select each element of array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
I get an error as extra characters after close braces.
set nf [molinfo top get numframes]
for {set n 0} {$n < $nf} {incr n }{
set sel [atomselect top all frame $n]
set x1 {}
set y1 {}
set z1 {}
lappend x1 [$sel get {x}]
lappend y1 [$sel get {y}]
lappend z1 [$sel get {z}]
#get mass
set sum 0
foreach mass [$sel get mass] {
set sum [expr $sum + $mass]
}
#return "$sum"
#get mixi
set comx 0
foreach comx [$sel get {x}] {
set comx [vecadd $comx [vecscale $sum $comx]]
}
#get miyi
set comy 0
foreach comy [$sel get {y}] {
set comy [vecadd $comy [vecscale $sum $comy]]
}
#get mizi
set comz 0
foreach comz [$sel get {z}] {
set comz [vecadd $comz [vecscale $sum $comz]]
}
set xc [vecscale [expr 1/$sum] $comx]
set yc [vecscale [expr 1/$sum] $comy]
set zc [vecscale [expr 1/$sum] $comz]
puts $outfile1 "frame $n $xc $yc $zc"
$sel delete
}
I need separate arrays for x y z as I perform some calculations .
Thanks for any suggestions
kirtana
- Next message: Alexandr Kornev: "NetCDF plugin"
- Previous message: Axel Kohlmeyer: "Re: select each element of array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]