TABLE OF CONTENTS


::pwtk::pdos_plot

SYNOPSIS

proc ::pwtk::pdos_plot {args} {

USAGE

   pdos_plot ?-e E_FERMI|PWO_FILE?  ?-xr XMIN:XMAX?  ?-yr YMIN:YMAX?  ?-yf YFORMAT?  ?-lm LEFT_MARGIN? \
             ?-t TERM?  ?-s PX,PY?  ?-o ORIENT?  ?-v?  pdosFileOrbitalL head

DESCRIPTION

Visualize the specified PDOS components as a "single-plot" with aid of Gnuplot.

ARGUMENTS

The structure of the pdosFileOrbitalL list is the following:

    set pdosFileOrbitalL {
           pdosFile1 orbitalExpression1
           pdosFile2 orbitalExpression2
           pdosFile3 orbitalExpression3
           ...       ...
    }

EXAMPLE

    set pdosFileOrbitalL {
           pdosFile1 {px + py - 2*pz}
           pdosFile2 {dxy + dxz + dyz - dx2-y2 - dz2}
           pdosFile3 px
    }

EXPLANATION

With the above example, a plot is generated for each {file orbitalExpression} pair, implying that three PDOSes are plotted: the first corresponds to px+py-2*pz orbital combination, the second to specified combination of d orbitals, and the third to the px orbital.

THE SYNTAX OF ORBITAL EXPRESSIONS

Orbital expressions are simple mathematical expressions involving orbital labels, defined in the ::pwtk::obitalIndex array (i.e. ldos, s, px,py,pz, dxy,dxz,dxy,dx2y2,dz2), where ldos stands for the sum of all components present in the PDOS file.

In addition to orbital labels, also group-orbitals can be used as defined in the ::pwtk::obitalGroup array. New group-orbitals can be defined with the ::pwtk::orbitalGroup command.

OPTIONS

Note that options are optional and any number of them can be specified.

RETURN VALUE

Filename of the created image (for file terminals) or the empty string (for window terminals).

SOURCE

    set xdos PDOS
    set mode single
    printTitle "$xdos plotting"        
    xdosParseOptions_
    xdosGnuplotOptions_
    
    # make a PDOS plot for each list element in $pdosLL    
    
    #
    # filledcurves
    #
    set lt 1
    foreach {pdos orbExpr} $pdosLL {                            
        set kres [pdos_kresolved $pdos]
        set spin [pdos_spin $pdos]
        set Ei   [expr 1 + $kres]        
        set using [gp_using_ $kres $spin $orbExpr up_i_]

        append plot "     '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? $using : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n"
            
        if { $spin } {
            set using [gp_using_ $kres $spin $orbExpr dw_i_]
            append plot "     '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? -1*($using) : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n"
        }            
        incr lt
    }
    append plot "    \\\n"

    #
    # lines
    #   
    set lt 1
    foreach {pdos orbExpr} $pdosLL {
        set kres [pdos_kresolved $pdos]
        set spin [pdos_spin $pdos]
        set Ei   [expr 1 + $kres]
        set using [gp_using_ $kres $spin $orbExpr up_i_]
        set orb   [regsub -all { +} $orbExpr {}]; # condensed orbital expression
        if { $lt > 1 } {
            append plot ", \\\n"
        }
        set title "$orb ($pdos)"
        append plot "     '$pdos' u (\$$Ei-Efermi):($using) t '$title' w l lt $lt lw 2"
            
        if { $spin } {
            set using [gp_using_ $kres $spin $orbExpr dw_i_]
            append plot ", \\
     '$pdos' u (\$$Ei-Efermi):(-1*($using)) not w l lt $lt lw 2"
        }
        incr lt
    }
    $gp plot $plot

    xdosExecGnuplot_    
    return $outputs
}