Changeset 1615 for trunk/examples/objects/app-fermi/fermi4.tcl
- Timestamp:
- Nov 16, 2009, 3:03:37 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/objects/app-fermi/fermi4.tcl
r1581 r1615 14 14 15 15 # open the XML file containing the run parameters 16 set lib [Rappture::Library [lindex $argv 0]] 16 set lib [Rappture::Library] 17 18 $lib loadFile [lindex $argv 0] 17 19 18 20 if {[$lib error] != 0} { 19 21 # cannot open file or out of memory 20 puts stderr [$lib traceback] 22 set o [$lib outcome] 23 puts stderr [$o context] 24 puts stderr [$o remark] 21 25 exit [$lib error] 22 26 } 23 27 24 set T [Rappture:: connect $lib "temperature"]25 set Ef [$lib value "Ef" "units =eV"]28 set T [Rappture::Connect $lib "temperature"] 29 set Ef [$lib value "Ef" "units eV"] 26 30 27 31 if {[$lib error != 0]} { 28 32 # there were errors while retrieving input data values 29 33 # dump the tracepack 30 puts stderr [$lib traceback] 34 set o [$lib outcome] 35 puts stderr [$o context] 36 puts stderr [$o remark] 31 37 exit [$lib error] 32 38 } … … 38 44 set Emax [expr {$Ef + 10*$kT}] 39 45 40 set dE [expr { 0.005*($Emax-$Emin)}]46 set dE [expr {(1.0/$nPts)*($Emax-$Emin)}] 41 47 42 48 set E $Emin … … 50 56 } 51 57 52 set curveLabel "Fermi-Dirac Curve"53 set curveDesc "Plot of Fermi-Dirac Calculation"54 55 58 # do it the easy way, 56 59 # create a plot to add to the library … … 59 62 60 63 set p1 [Rappture::Plot $lib] 61 $p1 add $nPts $fArr $EArr "" $curveLabel $curveDesc 64 $p1 add $fArr $EArr -name "fdfactor" 65 $p1 propstr "label" "Fermi-Dirac Curve" 66 $p1 propstr "desc" "Plot of Fermi-Dirac Calculation" 62 67 $p1 propstr "xlabel" "Fermi-Dirac Factor" 63 68 $p1 propstr "ylabel" "Energy"
Note: See TracChangeset
for help on using the changeset viewer.