SIMION::PA - PA Library in Perl¶
Perl module for reading/writing/modifying SIMION potential arrays. v2.01
SYNOPSIS¶
use SIMION::PA;
#-- read an existing array
my $pa = new SIMION::PA(file => 'buncher.pa#');
# print header parameters the simple way
print $pa->header_string;
#-- create an array from scratch
my $pa2 = new SIMION::PA(nx => 100, ny => 20,
symmetry => 'cylindrical');
my $z = 0;
for my $x (0..$pa2->nx-1) {
for my $y (0..$pa2->ny-1) {
my $inside = ($x + $y) < 10;
if($inside) {
$pa2->point($x, $y, $z, 1, 5.0); # electrode, 5V
}
}}
$pa2->save('myarray.pa#');
#-- create a magnetic field from scratch
my $pa3 = new SIMION::PA(nx => 50, ny => 50, field_type => 'magnetic');
my $z = 0;
for my $x (0..$pa3->nx-1) {
for my $y (0..$pa3->ny-1) {
my $ex = $x;
my $ey = $y**2;
my $ez = 0;
$pa3->field($x, $y, $z, $ex, $ey, $ez);
}}
$pa3->save('mag1.pa');
DESCRIPTION¶
This module is for manipulating SIMION potential array (PA/PA?) files (including creating, loading, modifying, and saving). See Appendix Section F.5 of the SIMION 8.0 manual (or Appendix p. D-5 of the SIMION 7.0 manual) for the PA file format specification.
This modules is intended to be very robust and has been put through an extensive test suite. It is also intended to be simple to use and very Perl-ish. The module is, however, not as fast as the corresponding C++ implementation, even though speed has been considered, so use the C++ implementation if speed is critical.
Note
This page is abridged from the full SIMION "Supplemental Documentation" (Help file). The following additional sections can be found in the full version of this page accessible via the "Help > Supplemental Documentation" menu in SIMION 8.1.1 or above:INTERFACE
CHANGES
SOURCE¶
version: 20110811