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
- -before ... add a new image positions before the index-th image
- -after ... add a new image positions after the index-th image
ARGUMENTS
- index --- the image's index
- xsfFile -- the XSF file from where to load the image's atomic coordinates
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 }