OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Undulator Class Reference

#include <Undulator.h>

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

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
 
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)
 
- Public Member Functions inherited from Component
 Component (const std::string &name)
 Constructor with given name. More...
 
 Component ()
 
 Component (const Component &right)
 
virtual ~Component ()
 
virtual EMFieldgetField ()=0
 Return field. More...
 
virtual const EMFieldgetField () 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 initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField)=0
 
virtual void finalise ()=0
 
virtual bool bends () const =0
 
virtual void goOnline (const double &kineticEnergy)
 
virtual void goOffline ()
 
virtual bool Online ()
 
virtual void getDimensions (double &zBegin, double &zEnd) const =0
 
virtual ElementType getType () const
 Get element type std::string. More...
 
virtual const ElementBasegetDesign () 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...
 
virtual ElementType getType () const =0
 Get element type std::string. More...
 
std::string getTypeString () const
 
virtual BGeometryBasegetGeometry ()=0
 Get geometry. More...
 
virtual const BGeometryBasegetGeometry () 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 ChannelgetChannel (const std::string &aKey, bool create=false)
 Construct a read/write channel. More...
 
virtual const ConstChannelgetConstChannel (const std::string &aKey) const
 Construct a read-only channel. More...
 
virtual void accept (BeamlineVisitor &visitor) const =0
 Apply visitor. More...
 
virtual ElementBaseclone () const =0
 Return clone. More...
 
virtual ElementBasecopyStructure ()
 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 BoundaryGeometrygetBoundaryGeometry () 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 WakeFunctiongetWake () const
 return the attached wake object if there is any More...
 
virtual bool hasWake () const
 
virtual void setParticleMatterInteraction (ParticleMatterInteractionHandler *spys)
 
virtual ParticleMatterInteractionHandlergetParticleMatterInteraction () 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
 
RCObjectoperator= (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
 

Detailed Description

Definition at line 31 of file Undulator.h.

Constructor & Destructor Documentation

◆ Undulator() [1/3]

Undulator::Undulator ( const std::string &  name)
explicit

Constructor with given name.

Definition at line 60 of file Undulator.cpp.

◆ Undulator() [2/3]

Undulator::Undulator ( )

Definition at line 42 of file Undulator.cpp.

◆ Undulator() [3/3]

Undulator::Undulator ( const Undulator right)

Definition at line 45 of file Undulator.cpp.

◆ ~Undulator()

Undulator::~Undulator ( )
virtual

Definition at line 75 of file Undulator.cpp.

Member Function Documentation

◆ accept()

void Undulator::accept ( BeamlineVisitor visitor) const
virtual

Apply visitor to Undulator.

Implements ElementBase.

Definition at line 78 of file Undulator.cpp.

◆ apply() [1/3]

bool Component::apply ( const size_t &  i,
const double &  t,
Vector_t E,
Vector_t B 
)
virtual

Reimplemented from Component.

Definition at line 101 of file Component.cpp.

References ElementBase::getElementLength(), ElementBase::isInsideTransverse(), PartBunchBase< T, Dim >::R, Attrib::Distribution::R, and Component::RefPartBunch_m.

Here is the call graph for this function:

◆ apply() [2/3]

bool Component::apply ( const Vector_t R,
const Vector_t P,
const double &  t,
Vector_t E,
Vector_t B 
)
virtual

Reimplemented from Component.

Definition at line 106 of file Component.cpp.

◆ apply() [3/3]

void Undulator::apply ( PartBunchBase< double, 3 > *  itsBunch,
CoordinateSystemTrafo const &  refToLocalCSTrafo 
)

◆ bends()

bool Undulator::bends ( ) const
virtual

Implements Component.

Definition at line 263 of file Undulator.cpp.

◆ finalise()

void Undulator::finalise ( )
virtual

Implements Component.

Definition at line 260 of file Undulator.cpp.

◆ getAngle()

double Undulator::getAngle ( ) const

Definition at line 298 of file Undulator.cpp.

References angle_m.

Referenced by apply().

◆ getDimensions()

void Undulator::getDimensions ( double &  zBegin,
double &  zEnd 
) const
virtual

Implements Component.

Definition at line 267 of file Undulator.cpp.

◆ getDtBunch()

double Undulator::getDtBunch ( ) const

Definition at line 340 of file Undulator.cpp.

References dtBunch_m.

Referenced by apply().

◆ getFilename()

const std::string & Undulator::getFilename ( ) const

Definition at line 305 of file Undulator.cpp.

References fname_m.

◆ getHasBeenSimulated()

bool Undulator::getHasBeenSimulated ( ) const

Definition at line 347 of file Undulator.cpp.

References hasBeenSimulated_m.

◆ getK()

double Undulator::getK ( ) const

Definition at line 277 of file Undulator.cpp.

References k_m.

Referenced by apply().

◆ getLambda()

double Undulator::getLambda ( ) const

Definition at line 284 of file Undulator.cpp.

References lambda_m.

Referenced by apply().

◆ getMeshLength()

std::vector< double > Undulator::getMeshLength ( ) const

Definition at line 312 of file Undulator.cpp.

References meshLength_m.

Referenced by apply().

◆ getMeshResolution()

std::vector< double > Undulator::getMeshResolution ( ) const

Definition at line 319 of file Undulator.cpp.

References meshResolution_m.

Referenced by apply().

◆ getNumPeriods()

unsigned int Undulator::getNumPeriods ( ) const

Definition at line 291 of file Undulator.cpp.

References numPeriods_m.

Referenced by apply().

◆ getTotalTime()

double Undulator::getTotalTime ( ) const

Definition at line 333 of file Undulator.cpp.

References totalTime_m.

Referenced by apply().

◆ getTruncationOrder()

unsigned int Undulator::getTruncationOrder ( ) const

Definition at line 326 of file Undulator.cpp.

References truncationOrder_m.

Referenced by apply().

◆ getType()

ElementType Undulator::getType ( ) const
virtual

Get element type std::string.

Reimplemented from Component.

Definition at line 270 of file Undulator.cpp.

References UNDULATOR.

◆ initialise()

void Undulator::initialise ( PartBunchBase< double, 3 > *  bunch,
double &  startField,
double &  endField 
)
virtual

Implements Component.

Definition at line 82 of file Undulator.cpp.

References Component::RefPartBunch_m.

◆ operator=()

void Undulator::operator= ( const Undulator )
private

◆ setAngle()

void Undulator::setAngle ( double  theta)

Definition at line 295 of file Undulator.cpp.

References angle_m.

Referenced by OpalUndulator::update().

◆ setDtBunch()

void Undulator::setDtBunch ( double  dtb)

Definition at line 337 of file Undulator.cpp.

References dtBunch_m.

Referenced by OpalUndulator::update().

◆ setFilename()

void Undulator::setFilename ( const std::string &  fname)

Definition at line 302 of file Undulator.cpp.

References fname_m.

Referenced by OpalUndulator::update().

◆ setHasBeenSimulated()

void Undulator::setHasBeenSimulated ( bool  hbs)

Definition at line 344 of file Undulator.cpp.

References hasBeenSimulated_m.

Referenced by apply().

◆ setK()

void Undulator::setK ( double  k)

Definition at line 274 of file Undulator.cpp.

References k_m.

Referenced by OpalUndulator::update().

◆ setLambda()

void Undulator::setLambda ( double  lambda)

Definition at line 281 of file Undulator.cpp.

References lambda_m.

Referenced by OpalUndulator::update().

◆ setMeshLength()

void Undulator::setMeshLength ( const std::vector< double > &  ml)

Definition at line 309 of file Undulator.cpp.

References meshLength_m.

Referenced by OpalUndulator::update().

◆ setMeshResolution()

void Undulator::setMeshResolution ( const std::vector< double > &  mr)

Definition at line 316 of file Undulator.cpp.

References meshResolution_m.

Referenced by OpalUndulator::update().

◆ setNumPeriods()

void Undulator::setNumPeriods ( unsigned int  np)

Definition at line 288 of file Undulator.cpp.

References numPeriods_m.

Referenced by OpalUndulator::update().

◆ setTotalTime()

void Undulator::setTotalTime ( double  tt)

Definition at line 330 of file Undulator.cpp.

References totalTime_m.

Referenced by OpalUndulator::update().

◆ setTruncationOrder()

void Undulator::setTruncationOrder ( unsigned int  trunOrder)

Definition at line 323 of file Undulator.cpp.

References truncationOrder_m.

Referenced by OpalUndulator::update().

Member Data Documentation

◆ angle_m

double Undulator::angle_m
private

Polarisation angle of the undulator field.

Definition at line 90 of file Undulator.h.

Referenced by getAngle(), and setAngle().

◆ dtBunch_m

double Undulator::dtBunch_m
private

Time step for the bunch position update.

Definition at line 108 of file Undulator.h.

Referenced by getDtBunch(), and setDtBunch().

◆ fname_m

std::string Undulator::fname_m
private

Mithra file with output information.

Definition at line 93 of file Undulator.h.

Referenced by apply(), getFilename(), and setFilename().

◆ hasBeenSimulated_m

bool Undulator::hasBeenSimulated_m
private

Boolean to indicate whether this undulator has already been simulated.

Definition at line 111 of file Undulator.h.

Referenced by getHasBeenSimulated(), and setHasBeenSimulated().

◆ k_m

double Undulator::k_m
private

The undulator parameter.

Definition at line 81 of file Undulator.h.

Referenced by getK(), and setK().

◆ lambda_m

double Undulator::lambda_m
private

Undulator period.

Definition at line 84 of file Undulator.h.

Referenced by getLambda(), and setLambda().

◆ meshLength_m

std::vector<double> Undulator::meshLength_m
private

Size of computational domain.

Definition at line 96 of file Undulator.h.

Referenced by getMeshLength(), and setMeshLength().

◆ meshResolution_m

std::vector<double> Undulator::meshResolution_m
private

Mesh dx, dy, dz.

Definition at line 99 of file Undulator.h.

Referenced by getMeshResolution(), and setMeshResolution().

◆ numPeriods_m

unsigned int Undulator::numPeriods_m
private

Number of periods.

Definition at line 87 of file Undulator.h.

Referenced by getNumPeriods(), and setNumPeriods().

◆ totalTime_m

double Undulator::totalTime_m
private

Total time to run undulator.

Definition at line 105 of file Undulator.h.

Referenced by getTotalTime(), and setTotalTime().

◆ truncationOrder_m

unsigned int Undulator::truncationOrder_m
private

First or second order absorbing boundary conditions.

Definition at line 102 of file Undulator.h.

Referenced by getTruncationOrder(), and setTruncationOrder().


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