TABLE OF CONTENTS


::pwtk::shiftAtmPos

SYNOPSIS

proc ::pwtk::shiftAtmPos {dx dy dz atmPos} {

PURPOSE

Displace given atomic coordinates by ($dx,$dy,$dz) vector.

ARGUMENTS

SOURCE

    # multiply by 1.0 to force the use of floating-point arithmetics
    # (dx can be expression such as 1/2)
    set dx [expr 1.0*$dx]
    set dy [expr 1.0*$dy]
    set dz [expr 1.0*$dz]

    set result ""
    foreach line [split $atmPos \n] {   
        set len [llength $line]
        if { $len == 4 || $len == 7 } {
            lassign $line sym x y z ix iy iz  
            # multiply x,y,z by 1.0 to force the use of floating-point arithmetics
            append result [format $::pwtk::fmt_coor(4) \
                               $sym [expr 1.0*$x + $dx] [expr 1.0*$y + $dy] [expr 1.0*$z + $dz] $ix $iy $iz]
        }
    }
    return $result
}