source: branches/1.6/lang/perl/lib/Rappture.pm @ 6221

Last change on this file since 6221 was 3177, checked in by mmc, 11 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

File size: 3.7 KB
Line 
1package Rappture;
2
3use 5.008;
4use strict;
5use warnings;
6
7require Exporter;
8
9our @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.
18our %EXPORT_TAGS = ( 'all' => [ qw(
19       
20) ] );
21
22our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
23
24our @EXPORT = qw(
25       
26);
27
28our $VERSION = '0.01';
29
30require XSLoader;
31XSLoader::load('Rappture', $VERSION);
32
33# Preloaded methods go here.
34
351;
36__END__
37
38=head1 NAME
39
40Rappture - 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
73This module provides an interface to the RAPPTURE (Rapid APPlication
74infrastrucTURE) Toolkit.
75
76=head2 EXPORT
77
78None by default.
79
80
81
82=head1 SEE ALSO
83
84See
85http://developer.nanohub.org/projects/rappture
86http://developer.nanohub.org/projects/rappture/wiki/Documentation
87http://developer.nanohub.org/projects/rappture/wiki/rappture_perl_api
88
89=head1 AUTHOR
90
91Nicholas J. Kisseberth
92
93=head1 COPYRIGHT AND LICENSE
94
95Copyright (c) 2004-2012  HUBzero Foundation, LLC
96All rights reserved.
97
98Developed by:  Network for Computational Nanotechnology
99               Purdue University, West Lafayette, Indiana
100               http://www.rappture.org
101
102Permission is hereby granted, free of charge, to any person obtaining a
103copy of this software and associated documentation files (the "Software"),
104to deal with the Software without restriction, including without
105limitation the rights to use, copy, modify, merge, publish, distribute,
106sublicense, and/or sell copies of the Software, and to permit persons
107to whom the Software is furnished to do so, subject to the following
108conditions:
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
123THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
124EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
125MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
126IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
127ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
128TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
129SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
130
131=cut
Note: See TracBrowser for help on using the repository browser.