1 | package Rappture;
|
---|
2 |
|
---|
3 | use 5.008;
|
---|
4 | use strict;
|
---|
5 | use warnings;
|
---|
6 |
|
---|
7 | require Exporter;
|
---|
8 |
|
---|
9 | our @ISA = qw(Exporter);
|
---|
10 |
|
---|
11 | # Items to export into callers namespace by default. Note: do not export
|
---|
12 | # names by default without a very good reason. Use EXPORT_OK instead.
|
---|
13 | # Do not simply export all your public functions/methods/constants.
|
---|
14 |
|
---|
15 | # This allows declaration use Rappture ':all';
|
---|
16 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
|
---|
17 | # will save memory.
|
---|
18 | our %EXPORT_TAGS = ( 'all' => [ qw(
|
---|
19 |
|
---|
20 | ) ] );
|
---|
21 |
|
---|
22 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
|
---|
23 |
|
---|
24 | our @EXPORT = qw(
|
---|
25 |
|
---|
26 | );
|
---|
27 |
|
---|
28 | our $VERSION = '0.01';
|
---|
29 |
|
---|
30 | require XSLoader;
|
---|
31 | XSLoader::load('Rappture', $VERSION);
|
---|
32 |
|
---|
33 | # Preloaded methods go here.
|
---|
34 |
|
---|
35 | 1;
|
---|
36 | __END__
|
---|
37 |
|
---|
38 | =head1 NAME
|
---|
39 |
|
---|
40 | Rappture - Rappture/Perl API, Bindings to the Rappture Development Toolkit.
|
---|
41 |
|
---|
42 | =head1 SYNOPSIS
|
---|
43 |
|
---|
44 | use Rappture;
|
---|
45 |
|
---|
46 | # open the XML file containing the run parameters
|
---|
47 |
|
---|
48 | $driver = Rappture::RpLibrary->new($ARGV[0]);
|
---|
49 |
|
---|
50 | $Tstr = $driver->get("input.(temperature).current");
|
---|
51 | $T = Rappture::RpUnits::convert($Tstr, "K", "off");
|
---|
52 |
|
---|
53 | $Efstr = $driver->get("input.(Ef).current");
|
---|
54 | $Ef = Rappture::RpUnits::convert($Efstr, "eV", "off");
|
---|
55 |
|
---|
56 | $kT = 8.61734e-5 * $T;
|
---|
57 | $Emin = $Ef - 10 * $kT;
|
---|
58 | $Emax = $Ef + 10 * $kT;
|
---|
59 |
|
---|
60 | $E = $Emin;
|
---|
61 | $dE = 0.005*($Emax - $Emin);
|
---|
62 |
|
---|
63 | while( $E < $Emax ) {
|
---|
64 | $f = 1.0 / ( 1.0 + exp(($E - $Ef) / $kT));
|
---|
65 | $driver->put("output.curve(f12).component.xy", "$f $E\n", 1);
|
---|
66 | $E = $E + $dE;
|
---|
67 | }
|
---|
68 |
|
---|
69 | $driver->result();
|
---|
70 |
|
---|
71 | =head1 DESCRIPTION
|
---|
72 |
|
---|
73 | This module provides an interface to the RAPPTURE (Rapid APPlication
|
---|
74 | infrastrucTURE) Toolkit.
|
---|
75 |
|
---|
76 | =head2 EXPORT
|
---|
77 |
|
---|
78 | None by default.
|
---|
79 |
|
---|
80 |
|
---|
81 |
|
---|
82 | =head1 SEE ALSO
|
---|
83 |
|
---|
84 | See
|
---|
85 | http://developer.nanohub.org/projects/rappture
|
---|
86 | http://developer.nanohub.org/projects/rappture/wiki/Documentation
|
---|
87 | http://developer.nanohub.org/projects/rappture/wiki/rappture_perl_api
|
---|
88 |
|
---|
89 | =head1 AUTHOR
|
---|
90 |
|
---|
91 | Nicholas J. Kisseberth
|
---|
92 |
|
---|
93 | =head1 COPYRIGHT AND LICENSE
|
---|
94 |
|
---|
95 | Copyright (c) 2004-2012 HUBzero Foundation, LLC |
---|
96 | All rights reserved.
|
---|
97 |
|
---|
98 | Developed by: Network for Computational Nanotechnology
|
---|
99 | Purdue University, West Lafayette, Indiana
|
---|
100 | http://www.rappture.org
|
---|
101 |
|
---|
102 | Permission is hereby granted, free of charge, to any person obtaining a
|
---|
103 | copy of this software and associated documentation files (the "Software"),
|
---|
104 | to deal with the Software without restriction, including without
|
---|
105 | limitation the rights to use, copy, modify, merge, publish, distribute,
|
---|
106 | sublicense, and/or sell copies of the Software, and to permit persons
|
---|
107 | to whom the Software is furnished to do so, subject to the following
|
---|
108 | conditions:
|
---|
109 |
|
---|
110 | * Redistributions of source code must retain the above copyright
|
---|
111 | notice, this list of conditions and the following disclaimers.
|
---|
112 |
|
---|
113 | * Redistributions in binary form must reproduce the above copyright
|
---|
114 | notice, this list of conditions and the following disclaimers
|
---|
115 | in the documentation and/or other materials provided with the
|
---|
116 | distribution.
|
---|
117 |
|
---|
118 | * Neither the names of the Network for Computational Nanotechnology,
|
---|
119 | Purdue University, nor the names of its contributors may be used
|
---|
120 | to endorse or promote products derived from this Software without
|
---|
121 | specific prior written permission.
|
---|
122 |
|
---|
123 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
124 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
---|
125 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
---|
126 | IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
---|
127 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
---|
128 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
---|
129 | SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
|
---|
130 |
|
---|
131 | =cut
|
---|