Changeset 555
- Timestamp:
- Dec 9, 2006, 1:33:35 AM (18 years ago)
- Location:
- trunk/examples
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/app-fermi/cee/fermi.c
r159 r555 3 3 // 4 4 // This simple example shows how to use Rappture within a simulator 5 // written in Python.5 // written in C. 6 6 // ====================================================================== 7 // AUTHOR: Michael McLennan, Purdue University7 // AUTHOR: Derrick Kearney, Purdue University 8 8 // Copyright (c) 2004-2005 Purdue Research Foundation 9 9 // … … 12 12 // ====================================================================== 13 13 14 #include "RpLibraryCInterface.h" 15 #include "RpUnitsCInterface.h" 14 #include "rappture.h" 16 15 17 16 #include <stdlib.h> … … 69 68 dE = 0.005*(Emax-Emin); 70 69 70 rpPutString ( lib, 71 "output.curve(f12).about.label", 72 "Fermi-Dirac Factor", 73 RPLIB_OVERWRITE ); 74 rpPutString ( lib, 75 "output.curve(f12).xaxis.label", 76 "Fermi-Dirac Factor", 77 RPLIB_OVERWRITE ); 78 rpPutString ( lib, 79 "output.curve(f12).yaxis.label", 80 "Energy", 81 RPLIB_OVERWRITE ); 82 rpPutString ( lib, 83 "output.curve(f12).yaxis.units", 84 "eV", 85 RPLIB_OVERWRITE ); 86 71 87 while (E < Emax) { 72 88 f = 1.0/(1.0 + exp((E - Ef)/kT)); 73 89 sprintf(line,"%f %f\n",f, E); 74 rpPutString(lib,"output.curve(f12).component.xy", line, 1);90 rpPutString(lib,"output.curve(f12).component.xy", line, RPLIB_APPEND); 75 91 E = E + dE; 76 92 } -
trunk/examples/app-fermi/cee/tool.xml
r124 r555 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 42 -
trunk/examples/app-fermi/fortran/fermi.f
r119 r555 41 41 dE = 0.005*(Emax - Emin) 42 42 43 c Label out graph with a title, x-axis label, 44 c y-axis label and y-axis units 45 46 call rp_lib_put_str (driver,"output.curve(f12).about.label", 47 + "Fermi-Dirac Factor",0) 48 call rp_lib_put_str (driver,"output.curve(f12).xaxis.label", 49 + "Fermi-Dirac Factor",0) 50 call rp_lib_put_str (driver,"output.curve(f12).yaxis.label", 51 + "Energy",0) 52 call rp_lib_put_str (driver,"output.curve(f12).yaxis.units", 53 + "eV",0) 54 43 55 do 10 E=Emin,Emax,dE 44 56 f = 1.0/(1.0+exp((E-Ef)/kT)) 45 57 write(xy,'(E20.12,F13.9,A)') f, E, char(10) 46 call rp_lib_put_str (driver,47 + "output.curve(f12).component.xy", xy, 1)58 call rp_lib_put_str (driver, 59 + "output.curve(f12).component.xy", xy, 1) 48 60 10 continue 49 61 -
trunk/examples/app-fermi/fortran/tool.xml
r66 r555 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 42 -
trunk/examples/app-fermi/matlab/tool.xml
r521 r555 3 3 <tool> 4 4 <about>Press Simulate to view results.</about> 5 <command>matlab -no jvm -nosplash -nodisplay -r infile='@driver',fermi</command>5 <command>matlab -nodisplay -r infile='@driver',fermi</command> 6 6 </tool> 7 7 <input> … … 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 42 -
trunk/examples/app-fermi/octave/tool.xml
r144 r555 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 42 -
trunk/examples/app-fermi/perl/fermi.pl
r473 r555 31 31 $dE = 0.005*($Emax - $Emin); 32 32 33 # Label the output graph with a title, x-axis label, 34 # y-axis label, y-axis units. 35 36 $driver->put("output.curve(f12).about.label","Fermi-Dirac Factor",0); 37 $driver->put("output.curve(f12).xaxis.label","Fermi-Dirac Factor",0); 38 $driver->put("output.curve(f12).yaxis.label","Energy",0); 39 $driver->put("output.curve(f12).yaxis.units","eV",0); 40 33 41 while( $E < $Emax ) { 34 42 $f = 1.0 / ( 1.0 + exp(($E - $Ef) / $kT)); -
trunk/examples/app-fermi/perl/tool.xml
r473 r555 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 42 -
trunk/examples/app-fermi/python/fermi.py
r543 r555 35 35 E = Emin 36 36 dE = 0.005*(Emax-Emin) 37 38 # Label the output graph with a title, x-axis label, 39 # y-axis label, and y-axis units 40 driver.put('output.curve(f12).about.label','Fermi-Dirac Factor',append=0) 41 driver.put('output.curve(f12).xaxis.label','Fermi-Dirac Factor',append=0) 42 driver.put('output.curve(f12).yaxis.label','Energy',append=0) 43 driver.put('output.curve(f12).yaxis.units','eV',append=0) 44 37 45 while E < Emax: 38 46 f = 1.0/(1.0 + exp((E - Ef)/kT)) -
trunk/examples/app-fermi/python/tool.xml
r66 r555 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 -
trunk/examples/app-fermi/tcl/fermi.tcl
r115 r555 27 27 set E $Emin 28 28 set dE [expr {0.005*($Emax-$Emin)}] 29 30 # Label output graph with title, x-axis label, 31 # y-axis lable, and y-axis units 32 $driver put -append no output.curve(f12).about.label "Fermi-Dirac Factor" 33 $driver put -append no output.curve(f12).xaxis.label "Fermi-Dirac Factor" 34 $driver put -append no output.curve(f12).yaxis.label "Energy" 35 $driver put -append no output.curve(f12).yaxis.units "eV" 36 29 37 while {$E < $Emax} { 30 38 set f [expr {1.0/(1.0 + exp(($E - $Ef)/$kT))}] -
trunk/examples/app-fermi/tcl/tool.xml
r66 r555 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 42 -
trunk/examples/app-fermi/wrapper/fermi.tcl
r115 r555 35 35 close $fid 36 36 37 # Label output graph with title, x-axis label, 38 # y-axis lable, and y-axis units 39 $driver put -append no output.curve(f12).about.label "Fermi-Dirac Factor" 40 $driver put -append no output.curve(f12).xaxis.label "Fermi-Dirac Factor" 41 $driver put -append no output.curve(f12).yaxis.label "Energy" 42 $driver put -append no output.curve(f12).yaxis.units "eV" 43 37 44 # skip over the first 4 header lines 38 45 foreach line [lrange [split $info \n] 5 end] { -
trunk/examples/app-fermi/wrapper/tool.xml
r66 r555 39 39 </number> 40 40 </input> 41 <output>42 <curve id="f12">43 <about><label>Fermi-Dirac Factor</label></about>44 <xaxis>45 <label>Fermi-Dirac Factor</label>46 </xaxis>47 <yaxis>48 <label>Energy</label>49 <units>eV</units>50 </yaxis>51 </curve>52 </output>53 41 </run> 54 42 -
trunk/examples/c-example/plot.cc
r130 r555 5 5 // ====================================================================== 6 6 7 #include " RpLibrary.h"7 #include "rappture.h" 8 8 9 9 #include <stdlib.h> 10 10 #include <math.h> 11 12 11 #include <iostream> 13 12 #include <sstream> … … 87 86 } 88 87 88 // label the graph with a title 89 lib->put("output.curve(result).about.label", 90 "Formula: Y Vs X",RPLIB_OVERWRITE); 91 89 92 // evaluate formula and generate results 90 93 // science begains here … … 97 100 fy = sin(fx); 98 101 myStr << fx << " " << fy << std::endl; 99 lib->put("output.curve.component.xy", myStr.str(), "result", 1); 100 myStr.str(""); 102 lib->put("output.curve(result).component.xy", 103 myStr.str(), append=RPLIB_APPEND); 104 myStr.str(""); 101 105 } 102 106 -
trunk/examples/c-example/plotc.c
r159 r555 6 6 * ====================================================================== 7 7 */ 8 #include " RpLibraryCInterface.h"8 #include "rappture.h" 9 9 10 10 #include <stdlib.h> … … 95 95 } 96 96 97 // label the graph with a title 98 rpPutString(lib,"output.curve(result).about.label", 99 "Formula: Y Vs X",RPLIB_OVERWRITE); 100 97 101 // evaluate formula and generate results 98 102 for (i = 0; i<npts; i++) { … … 100 104 fy = sin(fx); 101 105 sprintf(str, "%f %f\n", fx, fy); 102 rpPut (lib, "output.curve.component.xy", str, "result", 1);106 rpPutString(lib,"output.curve(result).component.xy",str,RPLIB_APPEND); 103 107 } 104 108 -
trunk/examples/c-example/tool.xml
r128 r555 16 16 </number> 17 17 </input> 18 <output>19 <curve id="result">20 <about> <label>Formula: Y vs X</label> </about>21 </curve>22 </output>23 18 </run> -
trunk/examples/c-example/tool2.xml
r128 r555 16 16 </number> 17 17 </input> 18 <output>19 <curve id="result">20 <about> <label>Formula: Y vs X</label> </about>21 </curve>22 </output>23 18 </run> -
trunk/examples/graph/graph.py
r115 r555 26 26 npts = 100 27 27 28 io.put('output.curve(result).about.label','Formula: Y vs X',append=0) 29 28 30 for i in range(npts): 29 31 x = (xmax-xmin)/npts * i + xmin; 30 32 y = eval(formula) 31 io.put('output.curve .component.xy', '%g %g\n' % (x,y), append=1)33 io.put('output.curve(result).component.xy', '%g %g\n' % (x,y), append=1) 32 34 33 35 Rappture.result(io) -
trunk/examples/graph/tool.xml
r62 r555 23 23 </number> 24 24 </input> 25 <output>26 <curve id="result">27 <about> <label>Formula: Y vs X</label> </about>28 </curve>29 </output>30 25 </run>
Note: See TracChangeset
for help on using the changeset viewer.