Permalink
Browse files

Move +location from DCA to Accelerator.pm

  • Loading branch information...
jberger committed Oct 24, 2012
1 parent db4e40b commit ba9dc2b77a516e61f189a4d52deb802f2df2684b
Showing with 91 additions and 2 deletions.
  1. +50 −0 lib/Physics/UEMColumn/Accelerator.pm
  2. +40 −1 lib/Physics/UEMColumn/DCAccelerator.pm
  3. +1 −1 lib/Physics/UEMColumn/Element.pm
@@ -7,6 +7,8 @@ BEGIN { extends 'Physics::UEMColumn::Element'; }
use Method::Signatures;
+has '+location' => ( required => 0, default => 0 );
+
method field () {
return 0;
}
@@ -15,4 +17,52 @@ __PACKAGE__->meta->make_immutable;
1;
+=head1 NAME
+
+Physics::UEMColumn::Accelerator - Base class for acceleration regions in a UEM system
+
+=head1 SYNOPSIS
+
+ package Physics::UEMColumn::MyAccelerator;
+ use Moose;
+ extends 'Physics::UEMColumn::Accelerator';
+
+=head1 DESCRIPTION
+
+L<Physics::UEMColumn::Accelerator> is a base class for acceleration regions in a UEM system. It is itself a subclass of L<Physics::UEMColumn::Element> and inherits its attributes and methods. Additionally it provides:
+
+=head1 ATTRIBUTES
+
+=over
+
+=item C<location>
+
+unlike L<Physics::UEMColumn::Element>, accelerators' location defines the start of the region and defaults to a C<0>.
+
+=back
+
+=head1 METHODS
+
+=over
+
+=item C<field>
+
+Returns a field strength possibly derived from other attributes. In this base class it simply returns zero. This method is intended to be redefined on subclassing.
+
+=back
+
+=head1 SOURCE REPOSITORY
+
+L<http://github.com/jberger/Physics-UEMColumn>
+
+=head1 AUTHOR
+
+Joel Berger, E<lt>joel.a.berger@gmail.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2012 by Joel Berger
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
@@ -11,7 +11,6 @@ use Physics::UEMColumn::Auxiliary ':constants';
use Math::Trig qw/tanh sech/;
use MooseX::Types::NumUnit qw/num_of_unit/;
-has '+location' => ( required => 0, default => 0 );
has 'voltage' => ( isa => num_of_unit('V'), is => 'ro', required => 1 );
has 'sharpness' => ( isa => 'Num', is => 'ro', default => 10 );
@@ -77,3 +76,43 @@ __PACKAGE__->meta->make_immutable;
1;
+=head1 NAME
+
+Physics::UEMColumn::Element - A class representing a DC acceleration region in a UEM system
+
+=head1 SYNOPSIS
+
+ use Physics::UEMColumn alias => ':standard';
+ my $acc = DCAccelerator->new(
+
+ );
+
+=head1 DESCRIPTION
+
+L<Physics::UEMColumn::Accelerator> is a class representing a DC (static electric field) acceleration region in a UEM system It is itself a subclass of L<Physics::UEMColumn::Element> and inherits its attributes and methods. Additionally it provides:
+
+=head1 METHODS
+
+=over
+
+=item C<field>
+
+Returns a field strength possibly derived from other attributes. In this base class it simply returns zero. This method is intended to be redefined on subclassing.
+
+=back
+
+=head1 SOURCE REPOSITORY
+
+L<http://github.com/jberger/Physics-UEMColumn>
+
+=head1 AUTHOR
+
+Joel Berger, E<lt>joel.a.berger@gmail.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2012 by Joel Berger
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
@@ -60,7 +60,7 @@ A number representing the number of C<length>s away from the the center of the e
=item C<effect>
-Returns a hash reference of subroutine references defining the effect that the element has on a pulse's width (C<M_t>), length (C<M_z>) and velocity (C<acc_z>). These subroutine references expect arguments of time, pulse position and pulse velocty (C<t>, C<z>, C<v>), they return a number quantifying this effect. The base class simply returns an empty hashreference. This method is meant to be redefined on subclassing.
+Returns a hash reference of subroutine references defining the effect that the element has on a pulse's width (C<M_t>), length (C<M_z>) and velocity (C<acc_z>). These subroutine references expect arguments of time, pulse position and pulse velocty (C<t>, C<z>, C<v>), they return a number quantifying this effect. The base class simply returns an empty hashreference. This method is intended to be redefined on subclassing.
=back

0 comments on commit ba9dc2b

Please sign in to comment.