TABLE OF CONTENTS


::pwtk::pwo::totforLine

SYNOPSIS

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

PURPOSE

Extract the index-th total-force file 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 forLineList $line
        }
    }
    if { ! [info exists forLineList] } {
        ::pwtk::error "no *Total force* line found in output file: $file"
        set forLineList {}
    }
    return [lindex $forLineList $index]
}