TABLE OF CONTENTS


::pwtk::pdos_atm_files

SYNOPSIS

proc ::pwtk::pdos_atm_files {args} {

USAGE

    ::pwtk::pdos_atm_files ?-f PATTERN?  ?-n PATTERN?  ?-s PATTERN?  ?-w PATTERN?  ?-l PATTERN?

DESCRIPTION

Return a list of projwfc.x filpdos pdos_atm files that matches the supplied (glob) patterns. The name of these files are:

      "filpdos".pdos_atm#N(S)_wfc#M(l)

where N = atom number, S = atom symbol, M = wfc number, l = orbital angular momentum (s,p,d,f).

Note that options are cumulative, implying that the full glob pattern is assembled by their combination.

All the options are optional (default value for each option is "*" that means anything).

OPTIONS

EXAMPLE

    set pdosFiles [::pwtk::pdos_atm_files -n 1-6]

This will return all pdos_atm files for atoms 1, 2, 3, 4, 5, 6 in the current working directory.

SOURCE

    set narg -1; # no narg checking (allow flexible use)
    set usage "?-f PATTERN?  ?-n PATTERN?  ?-s PATTERN?  ?-w PATTERN?  ?-l PATTERN?"
    set options {
        {f.arg  * "glob pattern for the 'filpdos' head"}
        {n.arg  * "list of atom numbers (glob * and ? patterns and ranges using \"from-to\" syntax are supported)"}
        {s.arg  * "list of atom symbols (glob * and ? patterns are supported)"}
        {w.arg  * "list of wfc number (glob * and ? patterns and ranges using \"from-to\" syntax are supported)"}
        {l.arg  * "list of orbital angular momentum s, p, d... (glob * and ? patterns are supported)"}
    }
    parseOpt_

    if { $opt(n) != "*" } {
        set opt(n) \{[join [::pwtk::expandSequence $opt(n)] ,]\}
    }
    if { $opt(s) != "*" } {
        set opt(s) \{[join $opt(s) ,]\}
    }
    if { $opt(w) != "*" } {
        set opt(w) \{[join [::pwtk::expandSequence $opt(w)] ,]\}
    }
    if { $opt(l) != "*" } {
        set opt(l) \{[join $opt(l) ,]\}
    }

    set glob $opt(f).pdos_atm#${opt(n)}($opt(s))_wfc#${opt(w)}($opt(l))
    ::pwtk::print "glob pattern for selecting pdos_atm files:  $glob\n"
    
    return [lsort [glob -nocomplain $glob]]
}