TABLE OF CONTENTS


::pwtk::pwi::insertAtoms

SYNOPSIS

proc ::pwtk::pwi::insertAtoms {where atmPos} {

PURPOSE

Insert specified atoms to ATOMIC_POSITIONS card. The unit of coordinates is implicitly set to the unit used in the last call to ATOMIC_POSITIONS card.

ARGUMENTS

SOURCE

    set atmPos [::pwtk::purifyCoor $atmPos]
    set oldPos [::pwtk::purifyCoor [::pwtk::input::cardGetContent ATOMIC_POSITIONS]]

    switch -glob -- $where {
        beg* {
            set pos [::pwtk::purifyCoor ${atmPos}\n${oldPos}]
        }
        end {
            set pos [::pwtk::purifyCoor ${oldPos}\n${atmPos}]
        } default {
            ::pwtk::error "wrong value of \"where\" argument, $where, must be begin or end."
        }
    }

    ::pwtk::input::cardContent ATOMIC_POSITIONS $pos
    ::pwtk::pwi::setNAtoms
}