TABLE OF CONTENTS


::pwtk::pwo::totfor

SYNOPSIS

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

PURPOSE

Extract the index-th total-force from PW-output. Index can be "end" or digital number (first total force has an index of 0).

ARGUMENTS

SOURCE

    pwtk::lineread line $file {
        if { [string match {*Total force*} $line] } {
            lappend forList [lindex $line 3]
        }
    }
    if { ! [info exists forList] } {
        ::pwtk::error "no *Total force* line found in output file: $file"
        set forList {}
    }
    return [lindex $forList $index]
}