TABLE OF CONTENTS
::pwtk::nebi::substituteAtom
SYNOPSIS
proc ::pwtk::nebi::substituteAtom {atomIndex newType} {
PURPOSE
Substitute a specified atom in all ATOMIC_POSITIONS cards with a new atomic type.
ARGUMENTS
- atomIndex -- index of the atom to substitute (the first atom has index 1)
- newType -- new atomic type
SOURCE
set ind -999 set newPos "" foreach line [split [::pwtk::input::cardGetContent POSITIONS] \n] { if { [string match "*ATOMIC_POSITIONS*" $line] } { set ind 0 } if { $atomIndex == $ind } { append newPos "$newType [lrange $line 1 end]\n" } else { append newPos $line\n } incr ind } POSITIONS $newPos return [::pwtk::input::cardGetContent POSITIONS] }