TABLE OF CONTENTS


::pwtk::nebi::addImageCoor_fromXSF

SYNOPSIS

proc ::pwtk::nebi::addImageCoor_fromXSF {args} {

USAGE

   ::pwtk::nebi::addImageCoor_fromXSF ?-before | -after? index xsfFile

PURPOSE

Add a new image's atomic Coor (aka ATOMIC_POSITIONS) from the XSF file to the POSITIONS card.

OPTIONS

ARGUMENTS

EXAMPLE

   ::pwtk::nebi::addImagePos_fromXSF -before 1 file.xsf

SOURCE

    set xsfFile [lindex $args end]
    ::pwtk::fileMustExist $xsfFile xsfFile

    # if "nat" in the SYSTEM namelist is undefined, define it
    if { [::pwtk::input::namelistGetVarValue SYSTEM nat]  == "" } {
        SYSTEM " nat = [::pwtk::xsf::getNAtoms $xsfFile] "
    }
    set unit [::pwtk::xsf::getPrimCoorUnit $xsfFile]
    set coor [::pwtk::atmPosToCoor [::pwtk::purifyCoor [::pwtk::xsf::getPrimCoor $xsfFile]]]
    if { $coor eq "" } {
        pwtk::error "no coordinates found in the XSF file: $xsfFile" 1
    }
    set imageData "ATOMIC_POSITIONS $unit\n$coor"
    addImage {*}[lrange $args 0 end-1] $imageData
}