|
OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
#include <VerticalFFAMagnet.h>


Public Member Functions | |
| VerticalFFAMagnet (const std::string &name) | |
| ~VerticalFFAMagnet () | |
| ElementBase * | clone () const |
| bool | apply (const size_t &i, const double &t, Vector_t &E, Vector_t &B) |
| bool | apply (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) |
| bool | getFieldValue (const Vector_t &R, Vector_t &B) const |
| void | initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField) |
| void | initialise () |
| void | finalise () |
| bool | bends () const |
| void | getDimensions (double &zBegin, double &zEnd) const |
| BGeometryBase & | getGeometry () |
| const BGeometryBase & | getGeometry () const |
| EMField & | getField () |
| const EMField & | getField () const |
| void | accept (BeamlineVisitor &visitor) const |
| endfieldmodel::EndFieldModel * | getEndField () const |
| void | setEndField (endfieldmodel::EndFieldModel *endField) |
| size_t | getMaxOrder () const |
| void | setMaxOrder (size_t maxOrder) |
| double | getB0 () const |
| void | setB0 (double Bz) |
| double | getFieldIndex () const |
| void | setFieldIndex (double index) |
| double | getNegativeVerticalExtent () const |
| void | setNegativeVerticalExtent (double negativeExtent) |
| double | getPositiveVerticalExtent () const |
| void | setPositiveVerticalExtent (double positiveExtent) |
| double | getBBLength () const |
| void | setBBLength (double bbLength) |
| double | getWidth () const |
| void | setWidth (double width) |
| std::vector< std::vector < double > > | getDfCoefficients () const |
Public Member Functions inherited from Component | |
| Component (const std::string &name) | |
| Constructor with given name. More... | |
| Component () | |
| Component (const Component &right) | |
| virtual | ~Component () |
| EVector | Efield (const Point3D &P) const |
| Return the field in a point. More... | |
| BVector | Bfield (const Point3D &P) const |
| Return the field in a point. More... | |
| EVector | Efield (const Point3D &P, double t) const |
| Return the field in a point. More... | |
| BVector | Bfield (const Point3D &P, double t) const |
| Return the field in a point. More... | |
| EBVectors | EBfield (const Point3D &P) const |
| Return the field in a point. More... | |
| EBVectors | EBfield (const Point3D &P, double t) const |
| Return the field in a point. More... | |
| virtual void | addKR (int i, double t, Vector_t &K) |
| virtual void | addKT (int i, double t, Vector_t &K) |
| virtual bool | applyToReferenceParticle (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) |
| virtual bool | getPotential (const Vector_t &R, const double &t, Vector_t &A, double &phi) |
| virtual double | getDesignEnergy () const |
| virtual void | setDesignEnergy (const double &energy, bool changeable) |
| virtual void | goOnline (const double &kineticEnergy) |
| virtual void | goOffline () |
| virtual bool | Online () |
| virtual ElementBase::ElementType | getType () const |
| Get element type std::string. More... | |
| virtual void | setComponentType (std::string) |
| virtual std::string | getComponentType () const |
| virtual const ElementBase & | getDesign () const |
| Return design element. More... | |
| virtual void | trackBunch (PartBunchBase< double, 3 > *bunch, const PartData &, bool revBeam, bool revTrack) const |
| Track particle bunch. More... | |
| virtual void | trackMap (FVps< double, 6 > &map, const PartData &, bool revBeam, bool revTrack) const |
| Track a map. More... | |
| void | setExitFaceSlope (const double &) |
Public Member Functions inherited from ElementBase | |
| ElementBase (const std::string &name) | |
| Constructor with given name. More... | |
| ElementBase () | |
| ElementBase (const ElementBase &) | |
| virtual | ~ElementBase () |
| virtual const std::string & | getName () const |
| Get element name. More... | |
| virtual void | setName (const std::string &name) |
| Set element name. More... | |
| std::string | getTypeString () const |
| virtual double | getArcLength () const |
| Get arc length. More... | |
| virtual double | getElementLength () const |
| Get design length. More... | |
| virtual void | setElementLength (double length) |
| Set design length. More... | |
| virtual void | getElementDimensions (double &begin, double &end) const |
| virtual double | getOrigin () const |
| Get origin position. More... | |
| virtual double | getEntrance () const |
| Get entrance position. More... | |
| virtual double | getExit () const |
| Get exit position. More... | |
| virtual Euclid3D | getTransform (double fromS, double toS) const |
| Get transform. More... | |
| virtual Euclid3D | getTransform (double s) const |
| Get transform. More... | |
| virtual Euclid3D | getTotalTransform () const |
| Get transform. More... | |
| virtual Euclid3D | getEntranceFrame () const |
| Get transform. More... | |
| virtual Euclid3D | getExitFrame () const |
| Get transform. More... | |
| virtual Euclid3D | getEntrancePatch () const |
| Get patch. More... | |
| virtual Euclid3D | getExitPatch () const |
| Get patch. More... | |
| virtual double | getAttribute (const std::string &aKey) const |
| Get attribute value. More... | |
| virtual bool | hasAttribute (const std::string &aKey) const |
| Test for existence of an attribute. More... | |
| virtual void | removeAttribute (const std::string &aKey) |
| Remove an existing attribute. More... | |
| virtual void | setAttribute (const std::string &aKey, double val) |
| Set value of an attribute. More... | |
| virtual Channel * | getChannel (const std::string &aKey, bool create=false) |
| Construct a read/write channel. More... | |
| virtual const ConstChannel * | getConstChannel (const std::string &aKey) const |
| Construct a read-only channel. More... | |
| virtual ElementImage * | getImage () const |
| Construct an image. More... | |
| virtual ElementBase * | copyStructure () |
| Make a structural copy. More... | |
| bool | isSharable () const |
| Test if the element can be shared. More... | |
| virtual void | makeSharable () |
| Set sharable flag. More... | |
| virtual ElementBase * | makeAlignWrapper () |
| Allow misalignment. More... | |
| virtual ElementBase * | makeFieldWrapper () |
| Allow field errors. More... | |
| virtual ElementBase * | makeWrappers () |
| Allow errors. More... | |
| virtual ElementBase * | removeAlignWrapper () |
| Remove align wrapper. More... | |
| virtual const ElementBase * | removeAlignWrapper () const |
| Remove align wrapper. More... | |
| virtual ElementBase * | removeFieldWrapper () |
| Remove field wrapper. More... | |
| virtual const ElementBase * | removeFieldWrapper () const |
| Remove field wrapper. More... | |
| virtual ElementBase * | removeWrappers () |
| Return the design element. More... | |
| virtual const ElementBase * | removeWrappers () const |
| Return the design element. More... | |
| bool | update (const AttributeSet &) |
| Update element. More... | |
| virtual void | setBoundaryGeometry (BoundaryGeometry *geo) |
| virtual BoundaryGeometry * | getBoundaryGeometry () const |
| return the attached boundary geometrt object if there is any More... | |
| virtual bool | hasBoundaryGeometry () const |
| virtual void | setWake (WakeFunction *wf) |
| attach a wake field to the element More... | |
| virtual WakeFunction * | getWake () const |
| return the attached wake object if there is any More... | |
| virtual bool | hasWake () const |
| virtual void | setParticleMatterInteraction (ParticleMatterInteractionHandler *spys) |
| virtual ParticleMatterInteractionHandler * | getParticleMatterInteraction () const |
| virtual bool | hasParticleMatterInteraction () const |
| ElemType | getElType () const |
| returns element type as enumeration needed in the envelope tracker More... | |
| void | setElType (ElemType elt) |
| set the element type as enumeration needed in the envelope tracker More... | |
| void | setCSTrafoGlobal2Local (const CoordinateSystemTrafo &ori) |
| CoordinateSystemTrafo | getCSTrafoGlobal2Local () const |
| void | releasePosition () |
| void | fixPosition () |
| bool | isPositioned () const |
| virtual CoordinateSystemTrafo | getEdgeToBegin () const |
| virtual CoordinateSystemTrafo | getEdgeToEnd () const |
| void | setAperture (const ApertureType &type, const std::vector< double > &args) |
| std::pair < ElementBase::ApertureType, std::vector< double > > | getAperture () const |
| virtual bool | isInside (const Vector_t &r) const |
| void | setMisalignment (double x, double y, double s) |
| void | setMisalignment (const CoordinateSystemTrafo &cst) |
| void | getMisalignment (double &x, double &y, double &s) const |
| CoordinateSystemTrafo | getMisalignment () const |
| void | setActionRange (const std::queue< std::pair< double, double > > &range) |
| void | setCurrentSCoordinate (double s) |
| void | setRotationAboutZ (double rotation) |
| Set rotation about z axis in bend frame. More... | |
| double | getRotationAboutZ () const |
| void | setElementPosition (double elemedge) |
| Access to ELEMEDGE attribute. More... | |
| double | getElementPosition () const |
| bool | isElementPositionSet () const |
Public Member Functions inherited from RCObject | |
| int | addReference () const |
| Increment reference count. More... | |
| int | removeReference () const |
| Decrement the reference count. More... | |
| bool | isShared () const |
| Test for sharing. More... | |
Private Member Functions | |
| void | calculateDfCoefficients () |
| VerticalFFAMagnet (const VerticalFFAMagnet &right) | |
| VerticalFFAMagnet & | operator= (const VerticalFFAMagnet &rhs) |
Private Attributes | |
| StraightGeometry | straightGeometry_m |
| BMultipoleField | dummy |
| size_t | maxOrder_m = 0 |
| double | k_m = 0. |
| double | Bz_m = 0. |
| double | zNegExtent_m = 0. |
| double | zPosExtent_m = 0. |
| double | halfWidth_m = 0. |
| double | bbLength_m = 0. |
| std::unique_ptr < endfieldmodel::EndFieldModel > | endField_m |
| std::vector< std::vector < double > > | dfCoefficients_m |
| const double | mm =1000. |
| const double | Tesla =10. |
Bending magnet with an exponential dependence on field in the vertical plane
VerticalFFAMagnet makes a rectangular bending magnet with a dipole field that has a dependence like B0 exp(mz)
Definition at line 28 of file VerticalFFAMagnet.h.
|
explicit |
Construct a new VerticalFFAMagnet
| name | User-defined name of the VerticalFFAMagnet |
Definition at line 15 of file VerticalFFAMagnet.cpp.
References isDrift, and ElementBase::setElType().
Referenced by clone().

| VerticalFFAMagnet::~VerticalFFAMagnet | ( | ) |
Destructor - deletes the field
Definition at line 37 of file VerticalFFAMagnet.cpp.
|
private |
Copy constructor
Definition at line 20 of file VerticalFFAMagnet.cpp.
References Component::RefPartBunch_m.
|
virtual |
Accept a beamline visitor
Implements ElementBase.
Definition at line 76 of file VerticalFFAMagnet.cpp.
References BeamlineVisitor::visitVerticalFFAMagnet().

|
inlinevirtual |
Calculate the field at the position of the ith particle
| i | index of the particle event; field is calculated at this position |
| t | time at which the field is to be calculated |
| E | calculated electric field - always 0 (no E-field) |
| B | calculated magnetic field |
Reimplemented from Component.
Definition at line 218 of file VerticalFFAMagnet.h.
References PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::R, and Component::RefPartBunch_m.
|
inlinevirtual |
Calculate the field at some arbitrary position
| R | position in the local coordinate system of the magnet |
| P | not used |
| t | not used |
| E | not used |
| B | calculated magnetic field |
Reimplemented from Component.
Definition at line 223 of file VerticalFFAMagnet.h.
References getFieldValue().

|
inlinevirtual |
Return false - VerticalFFAMagnet is a straight magnet
Nb: the VerticalFFAMagnet geometry is straight even though trajectories are not
Implements Component.
Definition at line 97 of file VerticalFFAMagnet.h.
|
private |
Definition at line 122 of file VerticalFFAMagnet.cpp.
References dfCoefficients_m, k_m, maxOrder_m, and Hypervolume::n.
Referenced by initialise().
|
virtual |
Inheritable copy constructor
Implements ElementBase.
Definition at line 40 of file VerticalFFAMagnet.cpp.
References initialise(), and VerticalFFAMagnet().

|
virtual |
Finalise the VerticalFFAMagnet - sets bunch to NULL
Implements Component.
Definition at line 64 of file VerticalFFAMagnet.cpp.
References Component::RefPartBunch_m.
|
inline |
Get the centre field at z=0
Definition at line 140 of file VerticalFFAMagnet.h.
|
inline |
Get the length of the bounding box (centred on magnet centre)
Definition at line 164 of file VerticalFFAMagnet.h.
References bbLength_m, and mm.
|
inline |
Get the coefficients used for the field expansion
B_y is given by sum_n B_0 exp(ky) f_n x^n where f_n = sum_k c_{nk} partial_k f_0
Returns a vector of vectors, like c[n][k]. The expansion for the other field elements can be related back to c[n][k] (see elsewhere for details).
Definition at line 228 of file VerticalFFAMagnet.h.
References dfCoefficients_m.
|
inlinevirtual |
|
inline |
Get the fringe field
Returns the fringe field model; VerticalFFAMagnet retains ownership of the returned memory.
Definition at line 122 of file VerticalFFAMagnet.h.
References endField_m.
Referenced by OpalVerticalFFAMagnet::update().
|
virtual |
Return a dummy (0.) field value (what is this for?)
Implements Component.
Definition at line 46 of file VerticalFFAMagnet.cpp.
References dummy.
|
virtual |
Return a dummy (0.) field value (what is this for?)
Implements Component.
Definition at line 50 of file VerticalFFAMagnet.cpp.
References dummy.
|
inline |
Calculate the field at some arbitrary position in cartesian coordinates
| R | position in the local coordinate system of the bend, in cartesian coordinates defined like (x, y, z) |
| B | calculated magnetic field defined like (Bx, By, Bz) |
Definition at line 81 of file VerticalFFAMagnet.cpp.
References abs(), bbLength_m, Bz_m, dfCoefficients_m, endField_m, exp(), halfWidth_m, k_m, maxOrder_m, Hypervolume::n, zNegExtent_m, and zPosExtent_m.
Referenced by apply().

|
virtual |
Return the cell geometry
Implements ElementBase.
Definition at line 68 of file VerticalFFAMagnet.cpp.
References straightGeometry_m.
|
virtual |
Return the cell geometry
Implements ElementBase.
Definition at line 72 of file VerticalFFAMagnet.cpp.
References straightGeometry_m.
|
inline |
Get the maximum power of x used in the off-midplane expansion;
Definition at line 133 of file VerticalFFAMagnet.h.
References maxOrder_m.
|
inline |
Get the maximum extent below z = 0
Definition at line 152 of file VerticalFFAMagnet.h.
References mm, and zNegExtent_m.
|
inline |
Get the maximum extent above z = 0
Definition at line 158 of file VerticalFFAMagnet.h.
References mm, and zPosExtent_m.
|
inline |
Get the full width of the bounding box (centred on magnet centre)
Definition at line 170 of file VerticalFFAMagnet.h.
References halfWidth_m, and mm.
|
virtual |
Initialise the VerticalFFAMagnet
| bunch | the global bunch object (but not used) |
| startField | not used |
| endField | not used |
Implements Component.
Definition at line 59 of file VerticalFFAMagnet.cpp.
References initialise(), and Component::RefPartBunch_m.
Referenced by clone(), and OpalVerticalFFAMagnet::update().

| void VerticalFFAMagnet::initialise | ( | ) |
Initialise the VerticalFFAMagnet
Sets up the field expansion and the geometry; call after changing any field parameters
Definition at line 54 of file VerticalFFAMagnet.cpp.
References bbLength_m, calculateDfCoefficients(), StraightGeometry::setElementLength(), and straightGeometry_m.
Referenced by initialise().

|
private |
|
inline |
Set the centre field at z=0
Definition at line 143 of file VerticalFFAMagnet.h.
Referenced by OpalVerticalFFAMagnet::update().
|
inline |
Set the length of the bounding box (centred on magnet centre)
Definition at line 167 of file VerticalFFAMagnet.h.
References bbLength_m, and mm.
Referenced by OpalVerticalFFAMagnet::update().
| void VerticalFFAMagnet::setEndField | ( | endfieldmodel::EndFieldModel * | endField | ) |
Set the fringe field
Definition at line 143 of file VerticalFFAMagnet.cpp.
References endField_m.
Referenced by OpalVerticalFFAMagnet::OpalVerticalFFAMagnet().
|
inline |
Set the field index
Definition at line 149 of file VerticalFFAMagnet.h.
Referenced by OpalVerticalFFAMagnet::update().
|
inline |
Set the maximum power of x used in the off-midplane expansion;
Definition at line 137 of file VerticalFFAMagnet.h.
References maxOrder_m.
Referenced by OpalVerticalFFAMagnet::update().
|
inline |
Set the maximum extent below z = 0
Definition at line 210 of file VerticalFFAMagnet.h.
References mm, and zNegExtent_m.
Referenced by OpalVerticalFFAMagnet::update().
|
inline |
set the maximum extent above z = 0
Definition at line 214 of file VerticalFFAMagnet.h.
References mm, and zPosExtent_m.
Referenced by OpalVerticalFFAMagnet::update().
|
inline |
Set the full width of the bounding box (centred on magnet centre)
Definition at line 173 of file VerticalFFAMagnet.h.
References halfWidth_m, and mm.
Referenced by OpalVerticalFFAMagnet::update().
|
private |
Definition at line 202 of file VerticalFFAMagnet.h.
Referenced by getBBLength(), getFieldValue(), initialise(), and setBBLength().
|
private |
Definition at line 198 of file VerticalFFAMagnet.h.
Referenced by getB0(), getFieldValue(), and setB0().
|
private |
Definition at line 204 of file VerticalFFAMagnet.h.
Referenced by calculateDfCoefficients(), getDfCoefficients(), and getFieldValue().
|
private |
Definition at line 194 of file VerticalFFAMagnet.h.
Referenced by getField().
|
private |
Definition at line 203 of file VerticalFFAMagnet.h.
Referenced by getEndField(), getFieldValue(), and setEndField().
|
private |
Definition at line 201 of file VerticalFFAMagnet.h.
Referenced by getFieldValue(), getWidth(), and setWidth().
|
private |
Definition at line 197 of file VerticalFFAMagnet.h.
Referenced by calculateDfCoefficients(), getFieldIndex(), getFieldValue(), and setFieldIndex().
|
private |
Definition at line 196 of file VerticalFFAMagnet.h.
Referenced by calculateDfCoefficients(), getFieldValue(), getMaxOrder(), and setMaxOrder().
|
private |
Definition at line 206 of file VerticalFFAMagnet.h.
Referenced by getBBLength(), getFieldIndex(), getNegativeVerticalExtent(), getPositiveVerticalExtent(), getWidth(), setBBLength(), setFieldIndex(), setNegativeVerticalExtent(), setPositiveVerticalExtent(), and setWidth().
|
private |
Definition at line 193 of file VerticalFFAMagnet.h.
Referenced by getGeometry(), and initialise().
|
private |
Definition at line 207 of file VerticalFFAMagnet.h.
|
private |
Definition at line 199 of file VerticalFFAMagnet.h.
Referenced by getFieldValue(), getNegativeVerticalExtent(), and setNegativeVerticalExtent().
|
private |
Definition at line 200 of file VerticalFFAMagnet.h.
Referenced by getFieldValue(), getPositiveVerticalExtent(), and setPositiveVerticalExtent().
1.8.5