TABLE OF CONTENTS


::pwtk::pp_bader

SYNOPSIS

proc ::pwtk::pp_bader {args} {

USAGE

   pp_bader ?-p PLOT_NUM? HEAD 

DESCRIPTION

Calculate Bader charges by running pp.x and bader codes. This routine requires the bader program: https://theory.cm.utexas.edu/henkelman/code/bader/

pp.x specifics: a CUBE file is created with the 'plot_num' value specified by the -p option (default = 17)

OPTIONS

ARGUMENTS

SOURCE

    set narg 1
    set usage "?-p PLOT_NUM?  HEAD"
    set options {
        {p.arg 17     "plot_num for pp.x calculation"}            
    }
    parseOpt_
    checkOTypeStrict_ p $opt(p) integer

    set head $args
    
    switch -- $opt(p) {
        0       { set prefix chdens }
        17 - 21 { set prefix pawden }
        default {
            ::pwtk::error "unsupported plot_num = $opt(p) for Bader charges, must be one of 0, 17, or 21" 1
        }
    }

    input_pushpop {
        print "Making a pp.x calculation for plot_num = $opt(p)\nCube file = $prefix.$head.cube\n"
        INPUTPP [subst {
            filplot  = '$prefix.$head.pp'
            plot_num = $opt(p)}]
        
        PLOT [subst {
            nfile     = 1 
            weight(1) = 1.0
            filepp(1) = '$prefix.$head.pp'
            fileout   = '$prefix.$head.cube' 
            iflag = 3 
            output_format = 6}]
        
        runPP $prefix.$head
    }
    
    ::pwtk::cube2bader $prefix.$head.cube
}