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


Public Member Functions | |
| VariableRFCavity (const std::string &name) | |
| Constructor with given name. More... | |
| VariableRFCavity (const VariableRFCavity &) | |
| VariableRFCavity () | |
| VariableRFCavity & | operator= (const VariableRFCavity &) |
| virtual | ~VariableRFCavity () |
| virtual void | accept (BeamlineVisitor &) const override |
| virtual ElementBase * | clone () const override |
| virtual bool | apply (const size_t &i, const double &t, Vector_t &E, Vector_t &B) override |
| virtual bool | apply (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override |
| virtual bool | applyToReferenceParticle (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override |
| virtual void | initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override |
| virtual void | finalise () override |
| virtual bool | bends () const override |
| virtual void | getDimensions (double &, double &) const override |
| virtual double | getAmplitude (double time) const |
| virtual double | getFrequency (double time) const |
| virtual double | getPhase (double time) const |
| virtual double | getHeight () const |
| virtual double | getWidth () const |
| virtual double | getLength () const |
| virtual void | setHeight (double fullHeight) |
| virtual void | setWidth (double fullWidth) |
| virtual void | setLength (double length) |
| virtual std::shared_ptr < AbstractTimeDependence > | getAmplitudeModel () const |
| virtual std::shared_ptr < AbstractTimeDependence > | getPhaseModel () const |
| virtual std::shared_ptr < AbstractTimeDependence > | getFrequencyModel () const |
| virtual void | setAmplitudeModel (std::shared_ptr< AbstractTimeDependence > time_dep) |
| virtual void | setPhaseModel (std::shared_ptr< AbstractTimeDependence > time_dep) |
| virtual void | setFrequencyModel (std::shared_ptr< AbstractTimeDependence > time_dep) |
| virtual void | setAmplitudeName (const std::string &litude) |
| virtual void | setPhaseName (const std::string &phase) |
| virtual void | setFrequencyName (const std::string &frequency) |
| virtual StraightGeometry & | getGeometry () override |
| virtual const StraightGeometry & | getGeometry () const override |
| void | initialise () const |
| virtual EMField & | getField () override |
| Not implemented. More... | |
| virtual const EMField & | getField () const override |
| Not implemented. More... | |
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 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 ElementType | getType () const override |
| Get element type std::string. More... | |
| 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 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... | |
Protected Member Functions | |
| void | initNull () |
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 | |
| std::shared_ptr < AbstractTimeDependence > | phaseTD_m |
| std::shared_ptr < AbstractTimeDependence > | amplitudeTD_m |
| std::shared_ptr < AbstractTimeDependence > | frequencyTD_m |
| std::string | phaseName_m |
| std::string | amplitudeName_m |
| std::string | frequencyName_m |
| double | halfWidth_m |
| double | halfHeight_m |
| double | length_m |
| StraightGeometry | geometry |
| The cavity's geometry. More... | |
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 |
Additional Inherited Members | |
Static Public Member Functions inherited from ElementBase | |
| static std::string | getTypeString (ElementType type) |
Static Protected Attributes inherited from Component | |
| static const std::vector< double > | defaultAperture_m |
Generates a field like E = E0*a(t)*sin{f(t)*t-q(t)} B = 0 where E0, B0 are user defined fields, a(t), f(t), q(t) are time dependent amplitude, frequency, phase respectively; it is assumed that these quantities vary sufficiently slowly that Maxwell is satisfied.
The time dependent quantities are
Definition at line 39 of file VariableRFCavity.h.
|
explicit |
Constructor with given name.
Definition at line 29 of file VariableRFCavity.cpp.
References initNull().

| VariableRFCavity::VariableRFCavity | ( | const VariableRFCavity & | var | ) |
Copy Constructor; performs deepcopy on time-dependence models
Definition at line 37 of file VariableRFCavity.cpp.
References initNull().

| VariableRFCavity::VariableRFCavity | ( | ) |
Default constructor
Definition at line 33 of file VariableRFCavity.cpp.
References initNull().
Referenced by clone().

|
virtual |
Destructor does nothing
The shared_ptrs will self-destruct when reference count goes to 0
Definition at line 68 of file VariableRFCavity.cpp.
|
overridevirtual |
Apply visitor to RFCavity.
The RF cavity finds the "time dependence" models by doing a string lookup against a list held by AbstractTimeDependence at accept time.
Implements ElementBase.
Reimplemented in VariableRFCavityFringeField.
Definition at line 168 of file VariableRFCavity.cpp.
References initialise(), and BeamlineVisitor::visitVariableRFCavity().

|
overridevirtual |
Calculate the field at the position of the i^th particle
| i | indexes the particle whose field we need |
| t | the time at which the field is calculated |
| E | return value with electric field strength |
| B | return value with magnetic field strength |
Reimplemented from Component.
Reimplemented in VariableRFCavityFringeField.
Definition at line 125 of file VariableRFCavity.cpp.
References PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::R, and Component::RefPartBunch_m.
Referenced by applyToReferenceParticle().
|
overridevirtual |
Calculate the field at a given position
| R | the position at which the field is calculated |
| P | the momentum (not used) |
| t | the time at which the field is calculated |
| E | return value; filled with electric field strength |
| B | return value; filled with magnetic field strength |
Reimplemented from Component.
Reimplemented in VariableRFCavityFringeField.
Definition at line 136 of file VariableRFCavity.cpp.
References abs(), amplitudeTD_m, frequencyTD_m, halfHeight_m, halfWidth_m, Units::Hz2GHz, length_m, Units::MHz2Hz, phaseTD_m, sin(), and Physics::two_pi.

|
overridevirtual |
Calculate the field at a given position. This is identical to "apply".
| R | the position at which the field is calculated |
| P | the momentum (not used) |
| t | the time at which the field is calculated |
| E | return value; filled with electric field strength |
| B | return value; filled with magnetic field strength |
Reimplemented from Component.
Reimplemented in VariableRFCavityFringeField.
Definition at line 151 of file VariableRFCavity.cpp.
References apply().

|
inlineoverridevirtual |
Implements Component.
Definition at line 118 of file VariableRFCavity.h.
|
overridevirtual |
Inheritable deepcopy method
Implements ElementBase.
Reimplemented in VariableRFCavityFringeField.
Definition at line 164 of file VariableRFCavity.cpp.
References VariableRFCavity().

|
overridevirtual |
Finalise following tracking
Just sets RefPartBunch_m to nullptr
Implements Component.
Definition at line 160 of file VariableRFCavity.cpp.
References Component::RefPartBunch_m.
|
inlinevirtual |
Get the amplitude at a given time
| time,: | the time at which the amplitude is calculated |
Definition at line 227 of file VariableRFCavity.h.
References amplitudeTD_m.
|
virtual |
Definition at line 82 of file VariableRFCavity.cpp.
References amplitudeTD_m.
|
inlineoverridevirtual |
|
overridevirtual |
|
overridevirtual |
|
inlinevirtual |
Get the frequency at a given time
| time,: | the time at which the frequency is calculated |
Definition at line 235 of file VariableRFCavity.h.
References frequencyTD_m.
|
virtual |
Definition at line 90 of file VariableRFCavity.cpp.
References frequencyTD_m.
|
overridevirtual |
Set the cavity geometry
Implements ElementBase.
Definition at line 106 of file VariableRFCavity.cpp.
References geometry.
|
overridevirtual |
Implements ElementBase.
Definition at line 110 of file VariableRFCavity.cpp.
References geometry.
|
inlinevirtual |
Definition at line 239 of file VariableRFCavity.h.
References halfHeight_m.
|
inlinevirtual |
Definition at line 247 of file VariableRFCavity.h.
References length_m.
|
inlinevirtual |
Get the phase at a given time
| phase,: | the time at which the phase is calculated |
Definition at line 231 of file VariableRFCavity.h.
References phaseTD_m.
|
virtual |
Definition at line 86 of file VariableRFCavity.cpp.
References phaseTD_m.
|
inlinevirtual |
Definition at line 243 of file VariableRFCavity.h.
References halfWidth_m.
|
overridevirtual |
Initialise ready for tracking
Just sets RefPartBunch_m
Implements Component.
Reimplemented in VariableRFCavityFringeField.
Definition at line 156 of file VariableRFCavity.cpp.
References Component::RefPartBunch_m.
Referenced by PyOpal::PyOpalObjectNS::PyOpalObject< C >::doSetup().
| void VariableRFCavity::initialise | ( | ) | const |
Lookup the time dependencies and update.
Throws if the named time dependencies can't be found. Also throws if the width or height is < 1 nm
Definition at line 173 of file VariableRFCavity.cpp.
References amplitudeName_m, Physics::e, frequencyName_m, AbstractTimeDependence::getTimeDependence(), halfHeight_m, halfWidth_m, phaseName_m, setAmplitudeModel(), setFrequencyModel(), and setPhaseModel().
Referenced by accept(), and VariableRFCavityFringeField::initialise().

|
protected |
Definition at line 72 of file VariableRFCavity.cpp.
References amplitudeName_m, frequencyName_m, halfHeight_m, halfWidth_m, length_m, phaseName_m, and Component::RefPartBunch_m.
Referenced by VariableRFCavityFringeField::initNull(), and VariableRFCavity().
| VariableRFCavity & VariableRFCavity::operator= | ( | const VariableRFCavity & | rhs | ) |
Assignment operator; performs deepcopy on time-dependence models
Definition at line 42 of file VariableRFCavity.cpp.
References amplitudeName_m, amplitudeTD_m, frequencyName_m, frequencyTD_m, ElementBase::getName(), halfHeight_m, halfWidth_m, length_m, phaseName_m, phaseTD_m, setAmplitudeModel(), setFrequencyModel(), setLength(), ElementBase::setName(), and setPhaseModel().
Referenced by VariableRFCavityFringeField::operator=().

|
virtual |
Set the amplitude (field gradient) time dependence
Definition at line 94 of file VariableRFCavity.cpp.
References amplitudeTD_m.
Referenced by initialise(), and operator=().
|
inlinevirtual |
Set the amplitude time dependence name
The name is used to find the amplitude model at accept time
Definition at line 178 of file VariableRFCavity.h.
References amplitudeName_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
virtual |
Set the frequency time dependence
Definition at line 102 of file VariableRFCavity.cpp.
References frequencyTD_m.
Referenced by initialise(), and operator=().
|
inlinevirtual |
Set the frequency time dependence name
The name is used to find the frequency model at accept time
Definition at line 190 of file VariableRFCavity.h.
References frequencyName_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
inlinevirtual |
Set the full height of the cavity
Definition at line 251 of file VariableRFCavity.h.
References halfHeight_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
virtual |
Set the length of the cavity
Definition at line 190 of file VariableRFCavity.cpp.
References geometry, length_m, and StraightGeometry::setElementLength().
Referenced by operator=(), OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().

|
virtual |
Set the phase time dependence
Definition at line 98 of file VariableRFCavity.cpp.
References phaseTD_m.
Referenced by initialise(), and operator=().
|
inlinevirtual |
Set the phase time dependence name
The name is used to find the phase model at accept time
Definition at line 184 of file VariableRFCavity.h.
References phaseName_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
inlinevirtual |
Set the full width of the cavity
Definition at line 255 of file VariableRFCavity.h.
References halfWidth_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
protected |
Definition at line 215 of file VariableRFCavity.h.
Referenced by initialise(), initNull(), operator=(), and setAmplitudeName().
|
protected |
Definition at line 212 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getAmplitude(), getAmplitudeModel(), operator=(), and setAmplitudeModel().
|
protected |
Definition at line 216 of file VariableRFCavity.h.
Referenced by initialise(), initNull(), operator=(), and setFrequencyName().
|
protected |
Definition at line 213 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getFrequency(), getFrequencyModel(), operator=(), and setFrequencyModel().
|
protected |
The cavity's geometry.
Definition at line 222 of file VariableRFCavity.h.
Referenced by getGeometry(), and setLength().
|
protected |
Definition at line 218 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getHeight(), initialise(), initNull(), operator=(), and setHeight().
|
protected |
Definition at line 217 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getWidth(), initialise(), initNull(), operator=(), and setWidth().
|
protected |
Definition at line 219 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getLength(), initNull(), operator=(), and setLength().
|
protected |
Definition at line 214 of file VariableRFCavity.h.
Referenced by initialise(), initNull(), operator=(), and setPhaseName().
|
protected |
Definition at line 211 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getPhase(), getPhaseModel(), operator=(), and setPhaseModel().
1.8.5