TABLE OF CONTENTS


::pwtk::pwo::etot

SYNOPSIS

proc ::pwtk::pwo::etot {file {index end}} {

PURPOSE

Extract an index-th total-energy from SCF's pw.x output (it greps the "total energy" string). Index can be "end" or digital number (first energy has an index of 0).

ARGUMENTS

SOURCE

    pwtk::lineread line $file {
        if { [regexp {^ +total energy} $line] } {
            lappend eneList [lindex $line 3]
        }
    }
    if { ! [info exists eneList] } {
        ::pwtk::error "no \"total energy\" line found in output file: $file"
        set eneList {}
    }
    return [lindex $eneList $index]
}