TABLE OF CONTENTS


::pwtk::pwo::reciprocal_axes

SYNOPSIS

proc ::pwtk::pwo::reciprocal_axes {pwo {index end}} {

PURPOSE

Return the reciprocal axes from the pw.x output file, taken from the following record:

     reciprocal axes: (cart. coord. in units 2 pi/alat)
               b(1) = ( -1.000000 -1.000000  1.000000 )  
               b(2) = (  1.000000  1.000000  1.000000 )  
               b(3) = ( -1.000000  1.000000 -1.000000 )

ARGUMENTS

RETURN VALUE

      b1x b1y b1z
      b2x b2y b2z
      b3x b3y b3z

SOURCE

    ::pwtk::fileMustExist $pwo "pw.x output"

    set result {}
    set fid [open $pwo r]
    while { ! [eof $fid] } {
        gets $fid line
        if { [regexp {^ +reciprocal axes: \(cart. coord. in units 2 pi/alat\)} $line] } {
            set v1 [lindex [split [gets $fid] ()] 3]
            set v2 [lindex [split [gets $fid] ()] 3]
            set v3 [lindex [split [gets $fid] ()] 3]
            lappend result $v1\n$v2\n$v3
        }
    }
    close $fid
    return [lindex $result $index]
}