TABLE OF CONTENTS


::pwtk::pdos_multiplot

SYNOPSIS

proc ::pwtk::pdos_multiplot {args} {

USAGE

   pdos_multiplot ?-e E_FERMI|PWO_FILE?  ?-xr XMIN:XMAX?  ?-yr YMIN:YMAX?  ?-yf YFORMAT?  ?-lm LEFT_MARGIN?  \
                  ?-nx NX?  ?-np NP?  ?-t TERM?  ?-s PX,PY?  ?-o ORIENT?  ?-v?  pdosFileOrbitalLL head

DESCRIPTION

Visualize specified PDOS components as a "multiplot" with aid of Gnuplot.

ARGUMENTS

The structure of the pdosFileOrbitalLL list-of-lists is the following:

    set pdosFileOrbitalLL {
          { pdosFile1 orbitalExpression1
            pdosFile2 orbitalExpression2
            ...       ...
          }
          {
            pdosFileX orbitalExpressionX
            ...       ...
          }
          ...
    }

EXAMPLE

      set pdosFileOrbitalLL {
          {
              pdosFile1 {pz + px - 2*pz}
              pdosFile2 {dxy + dxz + dyz - dx2-y2 - dz2}
          }
          {
              pdosFileX px
              pdosFileX py
              pdosFileX pz
           }
           {
              pdosFileW {px + py + pz}
           }
      }

For each list element in pdosFileOrbitalLL, a plot is generated. Hence, the number of generated plots is [llength $pdosFileOrbitalLL]. For the above example, three PDOS plots are created. The 1st plot displays the PDOSes for pdosFile1 and pdosFile2, the 2nd plot displays the PDOSes for pdosFileX, pdosFileY, and pdosFileZ, etc.

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 multi
    printTitle $xdos "Multiplot $xdos plotting"        
    xdosParseOptions_
    xdosGnuplotOptions_

    #
    # make a PDOS plot for each list element in $pdosLL
    #
    
    set ith 0
    set ipage 1
    foreach pdosL $pdosLL {
        #
        # filledcurves
        #
        set lt 1
        set plot {}
        foreach {pdos orbExpr} $pdosL {
            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} $pdosL {
            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
}