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

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]
}