OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ParallelPlate.h
Go to the documentation of this file.
1 #ifndef CLASSIC_ParallelPlate_HH
2 #define CLASSIC_ParallelPlate_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: ParallelPlate.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: ParallelPlate
13 // Defines the abstract interface for parallel plate element.
14 //
15 // ------------------------------------------------------------------------
16 // Class category: AbsBeamline
17 // ------------------------------------------------------------------------
18 //
19 // $Date: 2010/10/12 $
20 // $Author: ChuanWang $
21 //
22 // ------------------------------------------------------------------------
23 
24 
25 #include "AbsBeamline/Component.h"
26 
27 template <class T, unsigned Dim>
28 class PartBunchBase;
29 
30 // Class ParallelPlate
31 // ------------------------------------------------------------------------
33 // Class ParallelPlate defines the abstract interface for RF cavities.
34 
35 
36 class ParallelPlate: public Component {
37 
38 public:
39 
40  //enum CavityType { SW, SGSW };
42  explicit ParallelPlate(const std::string &name);
43 
44  ParallelPlate();
46  virtual ~ParallelPlate();
47 
49  virtual void accept(BeamlineVisitor &) const override;
50 
51 
52 
53  void getDimensions(double &zBegin, double &zEnd) const override;
54 
55  ElementBase::ElementType getType() const override;
56 
57  std::string getFieldMapFN() const;
58 
59  void setAmplitude(double vPeak);
60  double getAmplitude() const ;
61 
62  void setFrequency(double freq);
63  double getFrequency() const ;
64 
65  void setPhase(double phase);
66  double getPhase() const ;
67 
68  // void setElementLength(double length);
69  // double getElementLength() const;
70 
71  virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override;
72 
73  virtual bool apply(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override;
74 
75  virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override;
76 
77  virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
78 
79  virtual void initialise(PartBunchBase<double, 3> *bunch);
80 
81  virtual void finalise() override;
82 
83  virtual bool bends() const override;
84 
85 
86 private:
87  std::string filename_m;
89  double scale_m;
90  double phase_m;
91  double frequency_m;
92  double length_m;
93  double ptime_m;
94 
95  // Not implemented.
96  void operator=(const ParallelPlate &);
97 };
98 
99 #endif // CLASSIC_ParallelPlate_HH
void setPhase(double phase)
void setFrequency(double freq)
Interface for RF cavity.
Definition: ParallelPlate.h:36
std::string filename_m
Definition: ParallelPlate.h:87
void getDimensions(double &zBegin, double &zEnd) const override
void setAmplitude(double vPeak)
virtual ~ParallelPlate()
Class: DataSink.
Definition: OpalData.h:29
double getPhase() const
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override
virtual void accept(BeamlineVisitor &) const override
Apply visitor to ParallelPlate.
virtual bool bends() const override
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
double getAmplitude() const
const std::string name
ElementBase::ElementType getType() const override
Get element type std::string.
virtual void finalise() override
double frequency_m
Definition: ParallelPlate.h:91
Interface for a single beam element.
Definition: Component.h:51
void operator=(const ParallelPlate &)
Abstract algorithm.
std::string getFieldMapFN() const
double getFrequency() const