- Timestamp:
- Aug 31, 2010 7:01:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/examples/objects/app-fermi/tcl/fermi_io.tcl
r1623 r1894 12 12 # declare a number named "temperature", 13 13 # with units of Kelvin, default value 300, 14 # and specify that it is only an input14 # 15 15 # the next number is named "Ef", has units of 16 # electron Volts, default value of -5.5 and 17 # is also only an input value 18 Rappture::Number "temperature" "K" 300 RP_VAR_INPUT 19 Rappture::Number "Ef" "eV" -5.5 RP_VAR_INPUT 16 # electron Volts, default value of -5.5 17 # 18 # Rappture::Number are assumed to be an input 19 Rappture::Number "temperature" "K" 300 20 Rappture::Number "Ef" "eV" -5.5 20 21 21 22 # describe the outputs 22 23 # declare a table to store the outputs 23 # table is named "factorsTable" and is declared as24 # an output only object.two new columns are added to the24 # table is named "factorsTable". 25 # two new columns are added to the 25 26 # table "factorsTable". the first column is named 26 27 # "Fermi-Dirac Factor", a description is provided, … … 28 29 # "Energy", a description is provided, and has units 29 30 # of electron Volts 30 set results [Rappture::Table "factorsTable" RP_VAR_OUTPUT] 31 $results new column "Fermi-Dirac Factor" \ 32 "Plot of Fermi-Dirac Calculation" 33 $results new column "Energy" \ 34 "Energy cooresponding to each fdf" \ 35 -hints {"units=eV"} 31 # Rappture::Table is assumed to be an output 32 set results [Rappture::Table "factorsTable"] 33 $results column "Fermi-Dirac Factor" \ 34 "Plot of Fermi-Dirac Calculation" 35 $results column "Energy" \ 36 "Energy cooresponding to each fdf" \ 37 -hints {"units=eV"} 36 38 37 39 # describe how the outputs shoud be displayed 38 # initialize a view named "fdfView", specifying it 39 # as an output only object with a 1x1 view layout. 40 # next, add a plot named "fdfPlot" to the view fdfView". 40 # initialize a view named "fdfView", with a 1x1 layout. 41 # next, add a plot named "fdfPlot" to the view "fdfView". 41 42 # populate the plot with data from the table 42 # "f ermifactors". Plot the column named43 # "factorsTable". Plot the column named 43 44 # "Fermi-Dirac Factor" vs the column named "Energy". 44 # place the plot, named fdfPlot, at position 1 x1 within45 # place the plot, named fdfPlot, at position 1,1 within 45 46 # the view's layout. 46 set v [Rappture::View "fdfView" -flags RP_VAR_OUTPUT|RP_VIEW_1X1] 47 $v plot table "fdfPlot" "factorsTable" \ 48 "Fermi-Dirac Factor" "Energy" \ 49 -hints {"position=1x1"} 50 51 # add another curve to the "fdfPlot" plot. 52 # plot the column named "Fermi-Dirac Factor2" vs 53 # the column named "Energy" 54 # $v plot table "fdfPlot" "factorsTable" \ 55 # "Fermi-Dirac Factor2" "Energy" \ 56 # -hints {"position=1x1"} 47 # Rappture::View is assumed to be an output 48 set v [Rappture::View "fdfView" -rows 1 -cols 1] 49 $v plot "fdfPlot" -at "1,1" -table "factorsTable" \ 50 {"Fermi-Dirac Factor" "Energy" "g:o"} 57 51 }
Note: See TracChangeset
for help on using the changeset viewer.