TABLE OF CONTENTS
::pwtk::pdos_plot
SYNOPSIS
proc ::pwtk::pdos_plot {args} {
USAGE
::pwtk::pdos_plot ?SPECIFIC-OPTIONS? ?PLOTTING-OPTIONS? PDOSFILE_ORBITAL_LIST ?HEAD? where SPECIFIC-OPTIONS are: -e E_FERMI|PWO_FILE -o ORIENT For PLOTTING-OPTIONS, see: ::pwtk::plot. Ignored PLOTTING-OPTIONS: -u A more detailed description of SPECIFIC-OPTIONS and ARGUMENTS is provided below.
DESCRIPTION
Visualize the specified PDOS components as a "single-plot" with aid of Gnuplot.
SPECIFIC OPTIONS
PLOTTING OPTIONS
See ::pwtk::plot
ARGUMENTS
- PDOSFILE_ORBITAL_LIST -- list of projwfc.x PDOS files and the corresponding orbital-expressions (see below)
- HEAD -- (optional, default = plot-X, X = integer)) rootname for the generated plot files: $HEAD.gp and, for file terminals, $HEAD.EXT, where EXT = image type
The structure of the PDOSFILE_ORBITAL_LIST list is the following:
set PDOSFILE_ORBITAL_LIST { pdosFile1 orbitalExpression1 pdosFile2 orbitalExpression2 pdosFile3 orbitalExpression3 ... ... }
EXAMPLE
set PDOSFILE_ORBITAL_LIST { pdosFile1 {px + py - 2*pz} pdosFile2 {dxy + dxz + dyz - dx2-y2 - dz2} pdosFile3 px } ::pwtk::pdos_plot $PDOSFILE_ORBITAL_LIST pdos-example
EXPLANATION
With the above example, each "file orbitalExpression" pair in $PDOSFILE_ORBITAL_LIST is plotted, 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.
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" print "Options & arguments : $args\n" # parse command-line options & initialize plotting set arguments "PDOSFILE_ORBITAL_LIST ?HEAD?" xdosParseOpts_initPlot_ # make a PDOS plot for each list element in $pdosLL # # filledcurves # if { $dos_fill } { 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 return [::pwtk::gp::execDisplay_ $gp opt] }