OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | List of all members
LinearMapper Class Reference

Build a map using a linear map for each element. More...

#include <LinearMapper.h>

Inheritance diagram for LinearMapper:
Inheritance graph
[legend]
Collaboration diagram for LinearMapper:
Collaboration graph
[legend]

Public Member Functions

 LinearMapper (const Beamline &beamline, const PartData &, bool revBeam, bool revTrack)
 Constructor. More...
 
virtual ~LinearMapper ()
 
virtual void getMap (LinearMap< double, 6 > &) const
 Return the linear part of the accumulated map. More...
 
virtual void getMap (FVps< double, 6 > &) const
 Return the full map accumulated so far. More...
 
virtual void setMap (const LinearMap< double, 6 > &)
 Reset the linear part of the accumulated map for restart. More...
 
virtual void setMap (const FVps< double, 6 > &)
 Reset the full map for restart. More...
 
virtual void visitBeamBeam (const BeamBeam &)
 Apply the algorithm to a BeamBeam. More...
 
virtual void visitBeamStripping (const BeamStripping &)
 Apply the algorithm to a beam stripping. More...
 
virtual void visitCCollimator (const CCollimator &)
 Apply the algorithm to a collimator. More...
 
virtual void visitComponent (const Component &)
 Apply the algorithm to an arbitrary component. More...
 
virtual void visitCorrector (const Corrector &)
 Apply the algorithm to a Corrector. More...
 
virtual void visitDegrader (const Degrader &)
 Apply the algorithm to a drift. More...
 
virtual void visitDiagnostic (const Diagnostic &)
 Apply the algorithm to a Diagnostic. More...
 
virtual void visitDrift (const Drift &)
 Apply the algorithm to a Drift. More...
 
virtual void visitFlexibleCollimator (const FlexibleCollimator &)
 Apply the algorithm to a flexible collimator. More...
 
virtual void visitLambertson (const Lambertson &)
 Apply the algorithm to a Lambertson. More...
 
virtual void visitMarker (const Marker &)
 Apply the algorithm to a Marker. More...
 
virtual void visitMonitor (const Monitor &)
 Apply the algorithm to a Monitor. More...
 
virtual void visitMultipole (const Multipole &)
 Apply the algorithm to a Multipole. More...
 
virtual void visitPatch (const Patch &pat)
 Apply the algorithm to a patch. More...
 
virtual void visitProbe (const Probe &prob)
 Apply the algorithm to a probe. More...
 
virtual void visitRBend0 (const RBend &)
 Apply the algorithm to a RBend. More...
 
virtual void visitRBend (const RBend &)
 Apply the algorithm to a rectangular bend. More...
 
virtual void visitRFCavity (const RFCavity &)
 Apply the algorithm to a RFCavity. More...
 
virtual void visitRFQuadrupole (const RFQuadrupole &)
 Apply the algorithm to a RFQuadrupole. More...
 
virtual void visitSBend (const SBend &)
 Apply the algorithm to a SBend. More...
 
virtual void visitSeparator (const Separator &)
 Apply the algorithm to a Separator. More...
 
virtual void visitSeptum (const Septum &)
 Apply the algorithm to a Septum. More...
 
virtual void visitSolenoid (const Solenoid &)
 Apply the algorithm to a Solenoid. More...
 
virtual void visitAlignWrapper (const AlignWrapper &)
 Apply the algorithm to an offset beamline object wrapper. More...
 
virtual void visitParallelPlate (const ParallelPlate &)
 Apply the algorithm to a ParallelPlate. More...
 
virtual void visitCyclotronValley (const CyclotronValley &)
 Apply the algorithm to a CyclotronValley. More...
 
virtual void visitMapIntegrator (const MapIntegrator &)
 Apply the algorithm to an integrator capable of mapping. More...
 
- Public Member Functions inherited from AbstractMapper
 AbstractMapper (const Beamline &bl, const PartData &data, bool revBeam, bool revTrack)
 Constructor. More...
 
virtual ~AbstractMapper ()
 
- Public Member Functions inherited from DefaultVisitor
 DefaultVisitor (const Beamline &beamline, bool backBeam, bool backTrack)
 Constructor. More...
 
virtual ~DefaultVisitor ()=0
 
virtual void execute ()
 Apply the algorithm to the top-level beamline. More...
 
virtual void visitCyclotron (const Cyclotron &)
 Apply the algorithm to an cyclotron. More...
 
virtual void visitRing (const Ring &)
 Apply the algorithm to an opal ring.. More...
 
virtual void visitMultipoleT (const MultipoleT &)
 Apply the algorithm to a multipoleT. More...
 
virtual void visitMultipoleTStraight (const MultipoleTStraight &)
 Apply the algorithm to a multipoleTStraight. More...
 
virtual void visitMultipoleTCurvedConstRadius (const MultipoleTCurvedConstRadius &)
 Apply the algorithm to a multipoleTCurvedConstRadius. More...
 
virtual void visitMultipoleTCurvedVarRadius (const MultipoleTCurvedVarRadius &)
 Apply the algorithm to a multipoleTCurvedVarRadius. More...
 
virtual void visitOffset (const Offset &)
 Apply the algorithm to an Offset. More...
 
virtual void visitRBend3D (const RBend3D &)
 Apply the algorithm to a rectangular bend. More...
 
virtual void visitVariableRFCavity (const VariableRFCavity &vcav)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitVariableRFCavityFringeField (const VariableRFCavityFringeField &vcav)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitTravelingWave (const TravelingWave &)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitSBend3D (const SBend3D &)
 Apply the algorithm to a sector bend. More...
 
virtual void visitScalingFFAMagnet (const ScalingFFAMagnet &)
 Apply the algorithm to a scaling FFA magnet. More...
 
virtual void visitVerticalFFAMagnet (const VerticalFFAMagnet &)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitSource (const Source &)
 Apply the algorithm to a source. More...
 
virtual void visitStripper (const Stripper &)
 Apply the algorithm to a charge stripper. More...
 
virtual void visitBeamline (const Beamline &)
 Apply the algorithm to a beam line. More...
 
virtual void visitFlaggedElmPtr (const FlaggedElmPtr &)
 Apply the algorithm to a FlaggedElmPtr. More...
 
virtual void visitCorrectorWrapper (const CorrectorWrapper &)
 Apply the algorithm to an corrector wrapper.. More...
 
virtual void visitCyclotronWrapper (const CyclotronWrapper &)
 Apply the algorithm to an cyclotron wrapper.. More...
 
virtual void visitMultipoleWrapper (const MultipoleWrapper &)
 Apply the algorithm to an multipole wrapper.. More...
 
virtual void visitRBendWrapper (const RBendWrapper &)
 Apply the algorithm to an RBend wrapper.. More...
 
virtual void visitSBendWrapper (const SBendWrapper &)
 Apply the algorithm to an SBend wrapper.. More...
 
virtual void visitIntegrator (const Integrator &)
 Apply the algorithm to a generic integrator. More...
 
virtual void visitTrackIntegrator (const TrackIntegrator &)
 Apply the algorithm to an integrator capable of tracking. More...
 
- Public Member Functions inherited from BeamlineVisitor
 BeamlineVisitor ()
 
virtual ~BeamlineVisitor ()
 

Protected Member Functions

void applyDrift (double length)
 Apply drift length. More...
 
void applyEntranceFringe (double edge, const BMultipoleField &field, double scale)
 Transforms fringing fields. More...
 
void applyExitFringe (double edge, const BMultipoleField &field, double scale)
 
void applyLinearMap (double length, double refLength, double h, const FTps< double, 2 > &Fx, const FTps< double, 2 > &Fy)
 Apply linear map, defined by the linear expansions Fx and Fy. More...
 
void applyMultipoleBody (double length, double refLength, const BMultipoleField &field, double scale)
 Apply body of SBend. More...
 
void applySBendBody (double length, double refLength, double h, const BMultipoleField &field, double scale)
 Apply thin multipole kick (integrated over length) to all particles. More...
 
void applyThinMultipole (const BMultipoleField &field, double factor)
 Thin multipole kick. More...
 
void applyTransform (const Euclid3D &, double refLength)
 Apply transform. More...
 
FTps< double, 2 > buildSBendVectorPotential (const BMultipoleField &, double h)
 Construct the vector potential for a SBend. More...
 
- Protected Member Functions inherited from AbstractMapper
FTps< double, 6 > buildMultipoleVectorPotential (const BMultipoleField &)
 Construct the vector potential for a Multipole. More...
 
FTps< double, 6 > buildSBendVectorPotential (const BMultipoleField &, double h)
 Construct the vector potential for an SBend. More...
 

Protected Attributes

LinearMap< double, 6 > itsMap
 
- Protected Attributes inherited from AbstractMapper
const PartData itsReference
 The reference information. More...
 
- Protected Attributes inherited from DefaultVisitor
const BeamlineitsLine
 
bool back_beam
 
bool back_track
 
bool back_path
 
double flip_B
 
double flip_s
 

Private Member Functions

 LinearMapper ()
 
 LinearMapper (const LinearMapper &)
 
void operator= (const LinearMapper &)
 

Static Private Member Functions

static void makeFocus (double k, double L, double &c, double &s, double &d, double &f)
 Helper function for finding first-order coefficients. More...
 

Additional Inherited Members

- Public Types inherited from AbstractMapper
enum  {
  X, PX, Y, PY,
  T, PT
}
 

Detailed Description

Build a map using a linear map for each element.

Definition at line 68 of file LinearMapper.h.

Constructor & Destructor Documentation

LinearMapper::LinearMapper ( const Beamline beamline,
const PartData reference,
bool  revBeam,
bool  revTrack 
)

Constructor.

Definition at line 64 of file LinearMapper.cpp.

LinearMapper::~LinearMapper ( )
virtual

Definition at line 70 of file LinearMapper.cpp.

LinearMapper::LinearMapper ( )
private
LinearMapper::LinearMapper ( const LinearMapper )
private

Member Function Documentation

void LinearMapper::applyDrift ( double  length)
protected
void LinearMapper::applyEntranceFringe ( double  edge,
const BMultipoleField field,
double  scale 
)
protected

Transforms fringing fields.

Definition at line 442 of file LinearMapper.cpp.

References itsMap, BMultipoleField::normal(), AbstractMapper::PX, AbstractMapper::PY, tan(), AbstractMapper::X, and AbstractMapper::Y.

Referenced by visitRBend0(), and visitSBend().

Here is the call graph for this function:

void LinearMapper::applyExitFringe ( double  edge,
const BMultipoleField field,
double  scale 
)
protected

Definition at line 453 of file LinearMapper.cpp.

References itsMap, BMultipoleField::normal(), AbstractMapper::PX, AbstractMapper::PY, tan(), AbstractMapper::X, and AbstractMapper::Y.

Referenced by visitRBend0(), and visitSBend().

Here is the call graph for this function:

void LinearMapper::applyLinearMap ( double  length,
double  refLength,
double  h,
const FTps< double, 2 > &  Fx,
const FTps< double, 2 > &  Fy 
)
protected

Apply linear map, defined by the linear expansions Fx and Fy.

Definition at line 464 of file LinearMapper.cpp.

References PartData::getE(), PartData::getM(), Hypervolume::hv(), itsMap, AbstractMapper::itsReference, makeFocus(), AbstractMapper::PT, AbstractMapper::PX, AbstractMapper::PY, sqrt(), AbstractMapper::T, AbstractMapper::X, and AbstractMapper::Y.

Referenced by applyMultipoleBody(), and applySBendBody().

Here is the call graph for this function:

void LinearMapper::applyMultipoleBody ( double  length,
double  refLength,
const BMultipoleField field,
double  scale 
)
protected
void LinearMapper::applySBendBody ( double  length,
double  refLength,
double  h,
const BMultipoleField field,
double  scale 
)
protected

Apply thin multipole kick (integrated over length) to all particles.

Definition at line 678 of file LinearMapper.cpp.

References applyLinearMap(), buildSBendVectorPotential(), and FTps< T, N >::derivative().

Referenced by visitSBend().

Here is the call graph for this function:

void LinearMapper::applyThinMultipole ( const BMultipoleField field,
double  factor 
)
protected

Thin multipole kick.

Definition at line 693 of file LinearMapper.cpp.

References BMultipoleField::normal(), BMultipoleField::order(), PX, PY, BMultipoleField::skew(), X, and Y.

Referenced by visitMultipole(), visitRBend0(), and visitSBend().

Here is the call graph for this function:

void LinearMapper::applyTransform ( const Euclid3D euclid,
double  refLength 
)
protected
Series2 LinearMapper::buildSBendVectorPotential ( const BMultipoleField field,
double  h 
)
protected
void LinearMapper::getMap ( LinearMap< double, 6 > &  map) const
virtual

Return the linear part of the accumulated map.

Implements AbstractMapper.

Definition at line 74 of file LinearMapper.cpp.

References itsMap.

void LinearMapper::getMap ( FVps< double, 6 > &  map) const
virtual

Return the full map accumulated so far.

Implements AbstractMapper.

Definition at line 79 of file LinearMapper.cpp.

References itsMap.

void LinearMapper::makeFocus ( double  k,
double  L,
double &  c,
double &  s,
double &  d,
double &  f 
)
staticprivate

Helper function for finding first-order coefficients.

Definition at line 411 of file LinearMapper.cpp.

References abs(), Physics::c, cos(), cosh(), Physics::e, sin(), sinh(), and sqrt().

Referenced by applyLinearMap().

Here is the call graph for this function:

void LinearMapper::operator= ( const LinearMapper )
private
void LinearMapper::setMap ( const LinearMap< double, 6 > &  map)
virtual

Reset the linear part of the accumulated map for restart.

Implements AbstractMapper.

Definition at line 84 of file LinearMapper.cpp.

References itsMap.

void LinearMapper::setMap ( const FVps< double, 6 > &  map)
virtual

Reset the full map for restart.

Implements AbstractMapper.

Definition at line 89 of file LinearMapper.cpp.

References itsMap.

void LinearMapper::visitAlignWrapper ( const AlignWrapper wrap)
virtual

Apply the algorithm to an offset beamline object wrapper.

Reimplemented from DefaultVisitor.

Reimplemented in IdealMapper.

Definition at line 381 of file LinearMapper.cpp.

References ElementBase::accept(), applyTransform(), DefaultVisitor::back_track, AlignWrapper::getElement(), AlignWrapper::getEntranceTransform(), AlignWrapper::getExitTransform(), Inverse(), Euclid3D::isIdentity(), and AlignWrapper::offset().

Here is the call graph for this function:

void LinearMapper::visitBeamBeam ( const BeamBeam )
virtual

Apply the algorithm to a BeamBeam.

Reimplemented from DefaultVisitor.

Definition at line 94 of file LinearMapper.cpp.

void LinearMapper::visitBeamStripping ( const BeamStripping )
virtual

Apply the algorithm to a beam stripping.

Reimplemented from DefaultVisitor.

Definition at line 98 of file LinearMapper.cpp.

void LinearMapper::visitCCollimator ( const CCollimator coll)
virtual

Apply the algorithm to a collimator.

Reimplemented from DefaultVisitor.

Definition at line 102 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitComponent ( const Component comp)
virtual

Apply the algorithm to an arbitrary component.

Reimplemented from DefaultVisitor.

Definition at line 107 of file LinearMapper.cpp.

References DefaultVisitor::back_beam, DefaultVisitor::back_track, itsMap, AbstractMapper::itsReference, and Component::trackMap().

Here is the call graph for this function:

void LinearMapper::visitCorrector ( const Corrector corr)
virtual
void LinearMapper::visitCyclotronValley ( const CyclotronValley cv)
virtual

Apply the algorithm to a CyclotronValley.

Reimplemented from DefaultVisitor.

Definition at line 376 of file LinearMapper.cpp.

void LinearMapper::visitDegrader ( const Degrader deg)
virtual

Apply the algorithm to a drift.

Reimplemented from DefaultVisitor.

Definition at line 129 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitDiagnostic ( const Diagnostic diag)
virtual

Apply the algorithm to a Diagnostic.

Reimplemented from DefaultVisitor.

Definition at line 133 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitDrift ( const Drift drift)
virtual

Apply the algorithm to a Drift.

Reimplemented from DefaultVisitor.

Definition at line 138 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitFlexibleCollimator ( const FlexibleCollimator coll)
virtual

Apply the algorithm to a flexible collimator.

Reimplemented from DefaultVisitor.

Definition at line 142 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitLambertson ( const Lambertson lamb)
virtual

Apply the algorithm to a Lambertson.

Reimplemented from DefaultVisitor.

Definition at line 146 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitMapIntegrator ( const MapIntegrator i)
virtual

Apply the algorithm to an integrator capable of mapping.

Reimplemented from DefaultVisitor.

Definition at line 403 of file LinearMapper.cpp.

References DefaultVisitor::back_beam, DefaultVisitor::back_track, itsMap, AbstractMapper::itsReference, and MapIntegrator::trackMap().

Here is the call graph for this function:

void LinearMapper::visitMarker ( const Marker marker)
virtual

Apply the algorithm to a Marker.

Reimplemented from DefaultVisitor.

Definition at line 152 of file LinearMapper.cpp.

void LinearMapper::visitMonitor ( const Monitor corr)
virtual

Apply the algorithm to a Monitor.

Reimplemented from DefaultVisitor.

Definition at line 157 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitMultipole ( const Multipole multipole)
virtual
void LinearMapper::visitParallelPlate ( const ParallelPlate pplate)
virtual

Apply the algorithm to a ParallelPlate.

Reimplemented from DefaultVisitor.

Definition at line 372 of file LinearMapper.cpp.

void LinearMapper::visitPatch ( const Patch pat)
virtual

Apply the algorithm to a patch.

Reimplemented from DefaultVisitor.

Reimplemented in IdealMapper.

Definition at line 178 of file LinearMapper.cpp.

References applyTransform(), DefaultVisitor::back_track, Patch::getPatch(), and Inverse().

Here is the call graph for this function:

void LinearMapper::visitProbe ( const Probe prob)
virtual

Apply the algorithm to a probe.

Reimplemented from DefaultVisitor.

Definition at line 184 of file LinearMapper.cpp.

void LinearMapper::visitRBend ( const RBend bend)
virtual

Apply the algorithm to a rectangular bend.

Reimplemented from DefaultVisitor.

Definition at line 191 of file LinearMapper.cpp.

References visitRBend0().

Referenced by IdealMapper::visitRBendWrapper().

Here is the call graph for this function:

void LinearMapper::visitRBend0 ( const RBend bend)
virtual
void LinearMapper::visitRFCavity ( const RFCavity as)
virtual
void LinearMapper::visitRFQuadrupole ( const RFQuadrupole rfq)
virtual

Apply the algorithm to a RFQuadrupole.

Reimplemented from DefaultVisitor.

Definition at line 267 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitSBend ( const SBend bend)
virtual
void LinearMapper::visitSeparator ( const Separator sep)
virtual
void LinearMapper::visitSeptum ( const Septum sept)
virtual

Apply the algorithm to a Septum.

Reimplemented from DefaultVisitor.

Definition at line 336 of file LinearMapper.cpp.

References applyDrift(), DefaultVisitor::flip_s, and ElementBase::getElementLength().

Here is the call graph for this function:

void LinearMapper::visitSolenoid ( const Solenoid solenoid)
virtual

Member Data Documentation

LinearMap<double, 6> LinearMapper::itsMap
protected

The documentation for this class was generated from the following files: