TABLE OF CONTENTS


::pwtk::ldos_multiplot

SYNOPSIS

proc ::pwtk::ldos_multiplot {args} {

USAGE

   ::pwtk::ldos_multiplot  ?SPECIFIC-OPTIONS?  ?PLOTTING-OPTIONS?  PDOSFILE_LLIST  ?HEAD?

   where SPECIFIC-OPTIONS are:

       -e  E_FERMI|PWO_FILE
       -o  ORIENT
       -nx NX
       -np NP

   For PLOTTING-OPTIONS, see: ::pwtk::plot.
   Ignored PLOTTING-OPTIONS: -u

   A more detailed description of SPECIFIC-OPTIONS and ARGUMENTS is provided below.

DESCRIPTION

Visualize specified LDOSes as a "multiplot" with aid of Gnuplot.

SPECIFIC OPTIONS

PLOTTING OPTIONS

See ::pwtk::plot

ARGUMENTS

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

      set PDOSFILE_LLIST {
          {pdosFile1 pdosFile2}
          {pdosFileX pdosFileY pdosFileZ}
          pdosFileW
      }

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

RETURN VALUE

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

SOURCE

    set xdos LDOS
    set mode multi
    printTitle $xdos "Multiplot $xdos plotting"        
    print "Options & arguments :  $args\n"

    # parse command-line options & initialize plotting

    set arguments "PDOSFILE_LLIST  ?HEAD?"
    xdosParseOpts_initPlot_

    #
    # make an LDOS plot for each list element in $pdosLL
    #
    
    set ith 0
    set ipage 1
    foreach pdosL $pdosLL {
        set plot {}

        #
        # filledcurves
        #
        if { $dos_fill } {
            set lt 1
            foreach pdos $pdosL {
                set kres [pdos_kresolved $pdos]
                set spin [pdos_spin $pdos]
                set Ei   [expr 1 + $kres]
                set Yi   [expr 2 + $kres]
                append plot "     '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? \$$Yi : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n"
                
                if { $spin } {
                    set Yi [expr 3 + $kres]
                    append plot "     '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? -\$$Yi : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n"
                }
                incr lt
            }
            append plot "    \\\n"
        }

        #
        # lines
        #
        set lt 1
        foreach pdos $pdosL {
            set kres [pdos_kresolved $pdos]
            set spin [pdos_spin $pdos]
            set Ei   [expr 1 + $kres]
            set Yi   [expr 2 + $kres]
            if { $lt > 1 } {
                append plot ", \\\n"
            }
            append plot "     '$pdos' u (\$$Ei-Efermi):(\$$Yi) t '$pdos' w l lt $lt lw 2"            
            if { $spin } {
                set Yi [expr 3 + $kres]
                append plot ", \\
     '$pdos' u (\$$Ei-Efermi):(-\$$Yi) not w l lt $lt lw 2"
            }
            incr lt
        }
        $gp plot $plot
    }

    return [::pwtk::gp::execDisplay_ $gp opt]
}