TABLE OF CONTENTS


::pwtk::pwo::bfgs_converged

SYNOPSIS

proc ::pwtk::pwo::bfgs_converged {file} {

PURPOSE

Check if BFGS has converged in a given pw.x output-file. It searches for "End of BFGS Geometry Optimization" string. It returns 1 if this string is found, and zero otherwise.

ARGUMENTS

SOURCE

    if { ! [file exists $file] } {
        return 0
    }

    set result 0
    set bfgs_conv 0
    pwtk::lineread line $file {
        if { [string match {*bfgs converged*} $line] } {
            set bfgs_conv 1
        }
        if { [string match {*End of BFGS Geometry Optimization*} $line] } {
            set result 1
        }
    }
    return [expr $result && $bfgs_conv]
}