|
OPAL (Object Oriented Parallel Accelerator Library)
2024.1
OPAL
|
#include <Undulator.h>


Public Member Functions | |
| Undulator (const std::string &name) | |
| Constructor with given name. More... | |
| Undulator () | |
| Undulator (const Undulator &right) | |
| virtual | ~Undulator () |
| virtual void | accept (BeamlineVisitor &) const |
| Apply visitor to Undulator. More... | |
| virtual void | initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField) |
| void | apply (PartBunchBase< double, 3 > *itsBunch, CoordinateSystemTrafo const &refToLocalCSTrafo) |
| virtual void | finalise () |
| virtual bool | bends () const |
| virtual ElementType | getType () const |
| Get element type std::string. More... | |
| virtual void | getDimensions (double &zBegin, double &zEnd) const |
| void | setK (double k) |
| double | getK () const |
| void | setLambda (double lambda) |
| double | getLambda () const |
| void | setNumPeriods (unsigned int np) |
| unsigned int | getNumPeriods () const |
| void | setAngle (double theta) |
| double | getAngle () const |
| void | setFilename (const std::string &fname) |
| const std::string & | getFilename () const |
| void | setMeshLength (const std::vector< double > &ml) |
| std::vector< double > | getMeshLength () const |
| void | setMeshResolution (const std::vector< double > &mr) |
| std::vector< double > | getMeshResolution () const |
| void | setTruncationOrder (unsigned int trunOrder) |
| unsigned int | getTruncationOrder () const |
| void | setTotalTime (double tt) |
| double | getTotalTime () const |
| void | setDtBunch (double dtb) |
| double | getDtBunch () const |
| void | setHasBeenSimulated (bool hbs) |
| bool | getHasBeenSimulated () const |
Public Member Functions inherited from Component | |
| Component (const std::string &name) | |
| Constructor with given name. More... | |
| Component () | |
| Component (const Component &right) | |
| virtual | ~Component () |
| virtual EMField & | getField ()=0 |
| Return field. More... | |
| virtual const EMField & | getField () const =0 |
| Return field. More... | |
| 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 bool | apply (const size_t &i, const double &t, Vector_t &E, Vector_t &B) |
| virtual bool | apply (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) |
| 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 &, const double &, Vector_t &, double &) |
| virtual double | getDesignEnergy () const |
| virtual void | setDesignEnergy (const double &energy, bool changeable=true) |
| virtual void | goOnline (const double &kineticEnergy) |
| virtual void | goOffline () |
| virtual bool | Online () |
| 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 BGeometryBase & | getGeometry ()=0 |
| Get geometry. More... | |
| virtual const BGeometryBase & | getGeometry () const =0 |
| Get geometry. More... | |
| 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 ElementBase * | clone () const =0 |
| Return clone. 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... | |
| 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 |
| 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< ApertureType, std::vector< double > > | getAperture () const |
| virtual bool | isInside (const Vector_t &r) const |
| 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 |
| virtual BoundingBox | getBoundingBoxInLabCoords () const |
| virtual int | getRequiredNumberOfTimeSteps () const |
| void | setOutputFN (std::string fn) |
| Set output filename. More... | |
| std::string | getOutputFN () const |
| Get output filename. More... | |
| void | setFlagDeleteOnTransverseExit (bool=true) |
| bool | getFlagDeleteOnTransverseExit () 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 | operator= (const Undulator &) |
Private Attributes | |
| double | k_m |
| The undulator parameter. More... | |
| double | lambda_m |
| Undulator period. More... | |
| unsigned int | numPeriods_m |
| Number of periods. More... | |
| double | angle_m |
| Polarisation angle of the undulator field. More... | |
| std::string | fname_m |
| Mithra file with output information. More... | |
| std::vector< double > | meshLength_m |
| Size of computational domain. More... | |
| std::vector< double > | meshResolution_m |
| Mesh dx, dy, dz. More... | |
| unsigned int | truncationOrder_m |
| First or second order absorbing boundary conditions. More... | |
| double | totalTime_m |
| Total time to run undulator. More... | |
| double | dtBunch_m |
| Time step for the bunch position update. More... | |
| bool | hasBeenSimulated_m |
| Boolean to indicate whether this undulator has already been simulated. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ElementBase | |
| static std::string | getTypeString (ElementType type) |
Protected Member Functions inherited from ElementBase | |
| bool | isInsideTransverse (const Vector_t &r) const |
Protected Member Functions inherited from RCObject | |
| RCObject () | |
| Default constructor. More... | |
| RCObject (const RCObject &) | |
| Copy constructor. More... | |
| virtual | ~RCObject ()=0 |
| RCObject & | operator= (const RCObject &right) |
Protected Attributes inherited from Component | |
| double | exit_face_slope_m |
| PartBunchBase< double, 3 > * | RefPartBunch_m |
| bool | online_m |
Protected Attributes inherited from ElementBase | |
| bool | shareFlag |
| CoordinateSystemTrafo | csTrafoGlobal2Local_m |
| CoordinateSystemTrafo | misalignment_m |
| std::pair< ApertureType, std::vector< double > > | aperture_m |
| double | elementEdge_m |
| double | rotationZAxis_m |
Static Protected Attributes inherited from Component | |
| static const std::vector< double > | defaultAperture_m |
Definition at line 31 of file Undulator.h.
|
explicit |
Constructor with given name.
Definition at line 60 of file Undulator.cpp.
| Undulator::Undulator | ( | ) |
Definition at line 42 of file Undulator.cpp.
| Undulator::Undulator | ( | const Undulator & | right | ) |
Definition at line 45 of file Undulator.cpp.
|
virtual |
Definition at line 75 of file Undulator.cpp.
|
virtual |
| void Undulator::apply | ( | PartBunchBase< double, 3 > * | itsBunch, |
| CoordinateSystemTrafo const & | refToLocalCSTrafo | ||
| ) |
Definition at line 87 of file Undulator.cpp.
References allreduce(), PartBunchBase< T, Dim >::calcBeamParameters(), PartBunchBase< T, Dim >::create(), PartBunchBase< T, Dim >::destroy(), PartBunchBase< T, Dim >::dt, endl(), euclidean_norm(), fname_m, PartBunchBase< T, Dim >::get_centroid(), PartBunchBase< T, Dim >::get_gamma(), PartBunchBase< T, Dim >::get_maxExtent(), PartBunchBase< T, Dim >::get_pmean(), getAngle(), PartBunchBase< T, Dim >::getChargePerParticle(), PartBunchBase< T, Dim >::getdT(), getDtBunch(), getK(), getLambda(), PartBunchBase< T, Dim >::getLocalNum(), getMeshLength(), getMeshResolution(), getNumPeriods(), PartBunchBase< T, Dim >::getT(), PartBunchBase< T, Dim >::getTotalNum(), getTotalTime(), getTruncationOrder(), CoordinateSystemTrafo::inverted(), min(), PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::print(), PartBunchBase< T, Dim >::Q, Physics::q_e, PartBunchBase< T, Dim >::R, PartBunchBase< T, Dim >::RefPartP_m, PartBunchBase< T, Dim >::RefPartR_m, CoordinateSystemTrafo::rotateTo(), Options::seed, setHasBeenSimulated(), PartBunchBase< T, Dim >::setT(), sqrt(), PartBunchBase< T, Dim >::toLabTrafo_m, CoordinateSystemTrafo::transformTo(), and Units::us2s.

|
virtual |
Implements Component.
Definition at line 263 of file Undulator.cpp.
|
virtual |
Implements Component.
Definition at line 260 of file Undulator.cpp.
| double Undulator::getAngle | ( | ) | const |
|
virtual |
Implements Component.
Definition at line 267 of file Undulator.cpp.
| double Undulator::getDtBunch | ( | ) | const |
| const std::string & Undulator::getFilename | ( | ) | const |
Definition at line 305 of file Undulator.cpp.
References fname_m.
| bool Undulator::getHasBeenSimulated | ( | ) | const |
Definition at line 347 of file Undulator.cpp.
References hasBeenSimulated_m.
| double Undulator::getK | ( | ) | const |
| double Undulator::getLambda | ( | ) | const |
| std::vector< double > Undulator::getMeshLength | ( | ) | const |
| std::vector< double > Undulator::getMeshResolution | ( | ) | const |
| unsigned int Undulator::getNumPeriods | ( | ) | const |
| double Undulator::getTotalTime | ( | ) | const |
| unsigned int Undulator::getTruncationOrder | ( | ) | const |
|
virtual |
Get element type std::string.
Reimplemented from Component.
Definition at line 270 of file Undulator.cpp.
References UNDULATOR.
|
virtual |
Implements Component.
Definition at line 82 of file Undulator.cpp.
References Component::RefPartBunch_m.
| void Undulator::setAngle | ( | double | theta | ) |
Definition at line 295 of file Undulator.cpp.
References angle_m.
Referenced by OpalUndulator::update().
| void Undulator::setDtBunch | ( | double | dtb | ) |
Definition at line 337 of file Undulator.cpp.
References dtBunch_m.
Referenced by OpalUndulator::update().
| void Undulator::setFilename | ( | const std::string & | fname | ) |
Definition at line 302 of file Undulator.cpp.
References fname_m.
Referenced by OpalUndulator::update().
| void Undulator::setHasBeenSimulated | ( | bool | hbs | ) |
| void Undulator::setK | ( | double | k | ) |
Definition at line 274 of file Undulator.cpp.
References k_m.
Referenced by OpalUndulator::update().
| void Undulator::setLambda | ( | double | lambda | ) |
Definition at line 281 of file Undulator.cpp.
References lambda_m.
Referenced by OpalUndulator::update().
| void Undulator::setMeshLength | ( | const std::vector< double > & | ml | ) |
Definition at line 309 of file Undulator.cpp.
References meshLength_m.
Referenced by OpalUndulator::update().
| void Undulator::setMeshResolution | ( | const std::vector< double > & | mr | ) |
Definition at line 316 of file Undulator.cpp.
References meshResolution_m.
Referenced by OpalUndulator::update().
| void Undulator::setNumPeriods | ( | unsigned int | np | ) |
Definition at line 288 of file Undulator.cpp.
References numPeriods_m.
Referenced by OpalUndulator::update().
| void Undulator::setTotalTime | ( | double | tt | ) |
Definition at line 330 of file Undulator.cpp.
References totalTime_m.
Referenced by OpalUndulator::update().
| void Undulator::setTruncationOrder | ( | unsigned int | trunOrder | ) |
Definition at line 323 of file Undulator.cpp.
References truncationOrder_m.
Referenced by OpalUndulator::update().
|
private |
Polarisation angle of the undulator field.
Definition at line 90 of file Undulator.h.
Referenced by getAngle(), and setAngle().
|
private |
Time step for the bunch position update.
Definition at line 108 of file Undulator.h.
Referenced by getDtBunch(), and setDtBunch().
|
private |
Mithra file with output information.
Definition at line 93 of file Undulator.h.
Referenced by apply(), getFilename(), and setFilename().
|
private |
Boolean to indicate whether this undulator has already been simulated.
Definition at line 111 of file Undulator.h.
Referenced by getHasBeenSimulated(), and setHasBeenSimulated().
|
private |
The undulator parameter.
Definition at line 81 of file Undulator.h.
|
private |
Undulator period.
Definition at line 84 of file Undulator.h.
Referenced by getLambda(), and setLambda().
|
private |
Size of computational domain.
Definition at line 96 of file Undulator.h.
Referenced by getMeshLength(), and setMeshLength().
|
private |
Mesh dx, dy, dz.
Definition at line 99 of file Undulator.h.
Referenced by getMeshResolution(), and setMeshResolution().
|
private |
Number of periods.
Definition at line 87 of file Undulator.h.
Referenced by getNumPeriods(), and setNumPeriods().
|
private |
Total time to run undulator.
Definition at line 105 of file Undulator.h.
Referenced by getTotalTime(), and setTotalTime().
|
private |
First or second order absorbing boundary conditions.
Definition at line 102 of file Undulator.h.
Referenced by getTruncationOrder(), and setTruncationOrder().
1.8.5