OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
TravelingWaveRep.h
Go to the documentation of this file.
1 //
2 // Class TravelingWaveRep
3 // Representation for a traveling wave.
4 //
5 // Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // All rights reserved
7 //
8 // This file is part of OPAL.
9 //
10 // OPAL is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17 //
18 #ifndef CLASSIC_TravelingWaveRep_HH
19 #define CLASSIC_TravelingWaveRep_HH
20 
24 
25 
27 
28 public:
29 
31  explicit TravelingWaveRep(const std::string &name);
32 
35  virtual ~TravelingWaveRep();
36 
38  // Return an identical deep copy of the element.
39  virtual ElementBase *clone() const;
40 
42  // This method constructs a Channel permitting read/write access to
43  // the attribute [b]aKey[/b] and returns it.
44  // If the attribute does not exist, it returns NULL.
45  virtual Channel *getChannel(const std::string &aKey, bool = false);
46 
48  // Version for non-constant object.
49  virtual AcceleratingField &getField();
50 
52  // Version for constant object.
53  virtual const AcceleratingField &getField() const;
54 
56  // Return the element geometry.
57  // Version for non-constant object.
58  virtual StraightGeometry &getGeometry();
59 
61  // Return the element geometry
62  // Version for constant object.
63  virtual const StraightGeometry &getGeometry() const;
64 
66  // Return the RF amplitude in Volts.
67  virtual double getAmplitude() const;
68 
70  // Return the RF frequency in Hertz.
71  virtual double getFrequency() const;
72 
74  // Return the RF phase in radians.
75  virtual double getPhase() const;
76 
78  // Assign the RF amplitude in Volts.
79  virtual void setAmplitude(double V);
80 
82  // Assign the RF frequency in Hertz.
83  virtual void setFrequency(double f);
84 
86  // Assing the RF phase in radians.
87  virtual void setPhase(double phi);
88 
90  // If [b]ignore[/b] is true, cavities are ignored for static calculations.
91  static void setIgnore(bool ignore = false);
92 
93 private:
94 
95  // Not implemented.
96  void operator=(const TravelingWaveRep &);
97 
100 
103 
105  static bool ignoreCavities;
106 };
107 
108 #endif // CLASSIC_TravelingWaveRep_HH
const std::string name
Interface for Traveling Wave.
Definition: TravelingWave.h:37
virtual double getPhase() const
Get phase.
virtual void setPhase(double phi)
Set phase.
virtual StraightGeometry & getGeometry()
Get geometry.
static bool ignoreCavities
Cavities are ignored (amplitude = 0) when this switch is set.
virtual void setFrequency(double f)
Set frequency.
static void setIgnore(bool ignore=false)
Set ignore switch.
virtual ElementBase * clone() const
Return clone.
StraightGeometry geometry
The cavity's geometry.
void operator=(const TravelingWaveRep &)
virtual double getAmplitude() const
Get amplitude.
virtual void setAmplitude(double V)
Set amplitude.
virtual double getFrequency() const
Get frequency.
AcceleratingField field
The cavity's field.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
virtual AcceleratingField & getField()
Get field.
virtual ~TravelingWaveRep()
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32