TABLE OF CONTENTS


::pwtk::eos::run

SYNOPSIS

proc ::pwtk::eos::run {head {eosInput ""}} {

PURPOSE

Run the "eos" calculation, i.e., find the optimum lattice parameter for cubic systems.

ARGUMENTS

SOURCE

    variable eos

    ::pwtk::input::pushpop {

        if { $eosInput != "" } {
            EOS $eosInput
        }
    
        init_

        # create $head.d directory ...
        
        print_ ""
        print_ "  pw.x input/output files will be stored in ${head}.d/ subdirectory"
        
        if { ! [file isdirectory ${head}.d]} {
            if { [catch {file mkdir ${head}.d}] } {
                ::pwtk::error "cannot create directory: ${head}.d" 
            }
        }
        
        if { ! [info exists eos(mode)] } {
            ::pwtk::error "EOS mode not set"
        }
        
        run_${eos(mode)}_ [file join $head.d $head]
        findMinimum [file join $head.d $head] $eos(datafile)
        
        if { [file exists [file join $head.d $head.RESULTS]] } {
            file rename -force -- [file join $head.d $head.RESULTS] .
        }
    }
}