OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
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 (std::string amplitude) |
virtual void | setPhaseName (std::string phase) |
virtual void | setFrequencyName (std::string frequency) |
virtual StraightGeometry & | getGeometry () override |
virtual const StraightGeometry & | getGeometry () const override |
virtual EMField & | getField () override |
Not implemented. More... | |
virtual const EMField & | getField () const override |
Not implemented. More... | |
![]() | |
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 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 &) |
![]() | |
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< ElementBase::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 | setElementPosition (double elemedge) |
Access to ELEMEDGE attribute. More... | |
double | getElementPosition () const |
bool | isElementPositionSet () const |
![]() | |
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 () |
void | initialise () const |
![]() | |
bool | isInsideTransverse (const Vector_t &r) const |
![]() | |
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 |
StraightGeometry | geometry |
The cavity's geometry. More... | |
![]() | |
double | exit_face_slope_m |
PartBunchBase< double, 3 > * | RefPartBunch_m |
bool | online_m |
![]() | |
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 | |
static const double | lengthUnit_m = 1e3 |
![]() | |
static const std::vector< double > | defaultAperture_m |
Additional Inherited Members | |
![]() | |
enum | ApertureType { RECTANGULAR , ELLIPTICAL , CONIC_RECTANGULAR , CONIC_ELLIPTICAL } |
enum | ElementType { BEAMLINE , CCOLLIMATOR , CORRECTOR , CYCLOTRON , DEGRADER , DRIFT , FLEXIBLECOLLIMATOR , MARKER , MONITOR , MPSPLITINTEGRATOR , MULTIPOLE , MULTIPOLET , OFFSET , PROBE , RBEND , RBEND3D , RFCAVITY , RING , SBEND3D , SBEND , SEPTUM , SOLENOID , SOURCE , STRIPPER , TRAVELINGWAVE , UNDULATOR , VACUUM , VARIABLERFCAVITY , ANY } |
![]() | |
static std::string | getTypeString (ElementType type) |
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 49 of file VariableRFCavity.h.
|
explicit |
Constructor with given name.
Definition at line 37 of file VariableRFCavity.cpp.
References initNull().
VariableRFCavity::VariableRFCavity | ( | const VariableRFCavity & | var | ) |
Copy Constructor; performs deepcopy on time-dependence models
Definition at line 45 of file VariableRFCavity.cpp.
References initNull().
VariableRFCavity::VariableRFCavity | ( | ) |
Default constructor
Definition at line 41 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 74 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 175 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 131 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 142 of file VariableRFCavity.cpp.
References _length, abs(), amplitudeTD_m, frequencyTD_m, halfHeight_m, halfWidth_m, phaseTD_m, Attrib::Distribution::R, 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 158 of file VariableRFCavity.cpp.
References apply(), and Attrib::Distribution::R.
|
inlineoverridevirtual |
Implements Component.
Definition at line 124 of file VariableRFCavity.h.
|
overridevirtual |
Inheritable deepcopy method
Implements ElementBase.
Reimplemented in VariableRFCavityFringeField.
Definition at line 171 of file VariableRFCavity.cpp.
References VariableRFCavity().
|
overridevirtual |
Finalise following tracking
Just sets RefPartBunch_m to NULL
Implements Component.
Definition at line 167 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 229 of file VariableRFCavity.h.
References amplitudeTD_m.
|
virtual |
Definition at line 88 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 237 of file VariableRFCavity.h.
References frequencyTD_m.
|
virtual |
Definition at line 96 of file VariableRFCavity.cpp.
References frequencyTD_m.
|
overridevirtual |
Implements ElementBase.
Definition at line 116 of file VariableRFCavity.cpp.
References geometry.
|
overridevirtual |
Set the cavity geometry
Implements ElementBase.
Definition at line 112 of file VariableRFCavity.cpp.
References geometry.
|
inlinevirtual |
Definition at line 241 of file VariableRFCavity.h.
References halfHeight_m, and lengthUnit_m.
|
inlinevirtual |
Definition at line 249 of file VariableRFCavity.h.
References _length, and lengthUnit_m.
|
inlinevirtual |
Get the phase at a given time
phase | the time at which the phase is calculated |
Definition at line 233 of file VariableRFCavity.h.
References phaseTD_m.
|
virtual |
Definition at line 92 of file VariableRFCavity.cpp.
References phaseTD_m.
|
inlinevirtual |
Definition at line 245 of file VariableRFCavity.h.
References halfWidth_m, and lengthUnit_m.
|
protected |
Definition at line 180 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(), VariableRFCavityFringeField::accept(), and VariableRFCavityFringeField::initialise().
|
overridevirtual |
Initialise ready for tracking
Just sets RefPartBunch_m
Implements Component.
Reimplemented in VariableRFCavityFringeField.
Definition at line 163 of file VariableRFCavity.cpp.
References Component::RefPartBunch_m.
|
protected |
Definition at line 78 of file VariableRFCavity.cpp.
References _length, amplitudeName_m, frequencyName_m, halfHeight_m, halfWidth_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 50 of file VariableRFCavity.cpp.
References _length, amplitudeName_m, amplitudeTD_m, frequencyName_m, frequencyTD_m, ElementBase::getName(), halfHeight_m, halfWidth_m, lengthUnit_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 100 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 184 of file VariableRFCavity.h.
References amplitudeName_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
virtual |
Set the frequency time dependence
Definition at line 108 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 198 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 253 of file VariableRFCavity.h.
References halfHeight_m, and lengthUnit_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
virtual |
Set the length of the cavity
Definition at line 197 of file VariableRFCavity.cpp.
References _length, geometry, lengthUnit_m, and StraightGeometry::setElementLength().
Referenced by operator=(), OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
virtual |
Set the phase time dependence
Definition at line 104 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 191 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 257 of file VariableRFCavity.h.
References halfWidth_m, and lengthUnit_m.
Referenced by OpalVariableRFCavity::update(), and OpalVariableRFCavityFringeField::update().
|
protected |
Definition at line 221 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getLength(), initNull(), operator=(), and setLength().
|
protected |
Definition at line 217 of file VariableRFCavity.h.
Referenced by initialise(), initNull(), operator=(), and setAmplitudeName().
|
protected |
Definition at line 214 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getAmplitude(), getAmplitudeModel(), operator=(), and setAmplitudeModel().
|
protected |
Definition at line 218 of file VariableRFCavity.h.
Referenced by initialise(), initNull(), operator=(), and setFrequencyName().
|
protected |
Definition at line 215 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getFrequency(), getFrequencyModel(), operator=(), and setFrequencyModel().
|
protected |
The cavity's geometry.
Definition at line 223 of file VariableRFCavity.h.
Referenced by getGeometry(), and setLength().
|
protected |
Definition at line 220 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getHeight(), initialise(), initNull(), operator=(), and setHeight().
|
protected |
Definition at line 219 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getWidth(), initialise(), initNull(), operator=(), and setWidth().
|
staticprotected |
Definition at line 224 of file VariableRFCavity.h.
Referenced by getHeight(), getLength(), getWidth(), operator=(), setHeight(), setLength(), and setWidth().
|
protected |
Definition at line 216 of file VariableRFCavity.h.
Referenced by initialise(), initNull(), operator=(), and setPhaseName().
|
protected |
Definition at line 213 of file VariableRFCavity.h.
Referenced by apply(), VariableRFCavityFringeField::apply(), getPhase(), getPhaseModel(), operator=(), and setPhaseModel().