TABLE OF CONTENTS
::pwtk::pwi::substituteAtom
SYNOPSIS
proc ::pwtk::pwi::substituteAtom {atomIndex newType} {
PURPOSE
Substitute a specified atom in ATOMIC_POSITIONS with a new atomic type. The first atom has index 1.
ARGUMENTS
- atomIndex -- index of the atom to substitute (the first atom has index 1)
- newType -- new atomic type
SOURCE
set lenUnit [::pwtk::input::cardGetFlags ATOMIC_POSITIONS] set atmPos [::pwtk::purifyCoor [::pwtk::input::cardGetContent ATOMIC_POSITIONS]] set ind 1 set new_atmPos "" foreach line [split $atmPos \n] { if { $atomIndex == $ind } { append new_atmPos "$newType [lrange $line 1 end]\n" } else { append new_atmPos $line\n } incr ind } ATOMIC_POSITIONS $lenUnit [::pwtk::purifyCoor $new_atmPos] return [::pwtk::pwi::getAtmPos] }