TABLE OF CONTENTS


::pwtk::pwi::celldm3

SYNOPSIS

proc ::pwtk::pwi::celldm3 {} {

PURPOSE

Get the value of celldm(3) or C in units of alat, depending on which is specified. If neither is specified 0.0 is returned.

RETURN VALUE

Either the value of celldm(3) or C converted to alat units. If neither celldm(3) nor C are defined, 0.0 is returned.

SOURCE

    set C       [::pwtk::pwi::cC]
    set celldm3 [::pwtk::input::namelistGetVarValue SYSTEM celldm(3)]

    if { $C != "" && $celldm3 != "" } {
        ::pwtk::error "both C and celldm(3) are specified, specify only one of them !!!" 1
    }

    if { $C != "" } {
        set alat [::pwtk::pwi::alat]
        if { $alat == 0.0 } {
            ::pwtk::warning "from [::pwtk::procName]: neither celldm(1) nor A are specified, cannot calculate celldm(3)"
        } else {            
            set celldm3 [expr $::pwtk::angs2bohr * $C / $alat]
        }
    }
    ::pwtk::ifset celldm3 0.0    
    
    return $celldm3
}