TABLE OF CONTENTS
::pwtk::pwo::getXSFPrimVec
SYNOPSIS
proc ::pwtk::pwo::getXSFPrimVec {flag pwoFile {anim_index ""}} {
DESCRIPTION
Return the XSF-formatted lattice vectors (PRIMVEC section) from the pw.x output file, i.e.:
PRIMVEC ax ay az bx by bz cx cy cz
ARGUMENTS
- flag -- the option to pass to pwo2xsf.sh filter, one of -ic, -lc, -oc, or -a
- pwoFile -- pw.x output file
- anim_index -- animation index to append to PRIMVEC keyword
SOURCE
set output [::tclu::tempFile name xsf] set pwo2xsf [::pwtk::getVar_ PWO2XSF] if { $pwo2xsf == {} } { ::pwtk::error "can't run pwo2xsf.sh, because the PWOI2XSF variable is not defined" } exec -- $pwo2xsf $flag $pwoFile > $output set xsf [split [::tclu::readFile $output] \n] set ind [lsearch $xsf *PRIMVEC*] set vec "PRIMVEC $anim_index\n" append vec "[join [lrange $xsf [expr {$ind + 1}] [expr {$ind + 3}]] \n]" return $vec }