TABLE OF CONTENTS
::pwtk::pwo::totmag
SYNOPSIS
proc ::pwtk::pwo::totmag {file {index end}} {
PURPOSE
Extract the index-th total-magnetization from PW-output. Index can be "end" or digital number (first total magnetization has an index of 0).
ARGUMENTS
- file -- name of the pw.x output file
- index -- which total magnetization (optional), default = end
SOURCE
pwtk::lineread line $file { if { [string match {*total magnetization*} $line] } { lappend magList [lindex $line 3] } } if { ! [info exists magList] } { ::pwtk::error "no *total magnetization* line found in output file: $file" set magList {} } return [lindex $magList $index] }