OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
RFCavityRep.h
Go to the documentation of this file.
1//
2// Class RFCavityRep
3// Representation for a RF cavity.
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 OPALX_RFCavityRep_HH
19#define OPALX_RFCavityRep_HH
20
24
25class RFCavityRep : public RFCavity {
26public:
28 explicit RFCavityRep(const std::string& name);
29
32 virtual ~RFCavityRep();
33
35 // Return an identical deep copy of the element.
36 virtual ElementBase* clone() const;
37
39 // This method constructs a Channel permitting read/write access to
40 // the attribute [b]aKey[/b] and returns it.
41 // If the attribute does not exist, it returns nullptr.
42 virtual Channel* getChannel(const std::string& aKey, bool = false);
43
45 // Version for non-constant object.
46 virtual AcceleratingField& getField();
47
49 // Version for constant object.
50 virtual const AcceleratingField& getField() const;
51
53 // Return the element geometry.
54 // Version for non-constant object.
56
58 // Return the element geometry
59 // Version for constant object.
60 virtual const StraightGeometry& getGeometry() const;
61
63 // Return the RF amplitude in Volts.
64 virtual double getAmplitude() const;
65
67 // Return the RF frequency in Hertz.
68 virtual double getFrequency() const;
69
71 // Return the RF phase in radians.
72 virtual double getPhase() const;
73
75 // Assign the RF amplitude in Volts.
76 virtual void setAmplitude(double V);
77
79 // Assign the RF frequency in Hertz.
80 virtual void setFrequency(double f);
81
83 // Assing the RF phase in radians.
84 virtual void setPhase(double phi);
85
87 // If [b]ignore[/b] is true, cavities are ignored for static calculations.
88 static void setIgnore(bool ignore = false);
89
90private:
91 // Not implemented.
92 void operator=(const RFCavityRep&);
93
96
99
101 static bool ignoreCavities;
102};
103
104#endif // OPALX_RFCavityRep_HH
Abstract interface for read/write access to variable.
Definition Channel.h:30
virtual void setPhase(double phi)
Set phase.
virtual void setFrequency(double f)
Set frequency.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
virtual StraightGeometry & getGeometry()
Get geometry.
virtual double getPhase() const
Get phase.
virtual ElementBase * clone() const
Return clone.
virtual double getAmplitude() const
Get amplitude.
void operator=(const RFCavityRep &)
StraightGeometry geometry
The cavity's geometry.
Definition RFCavityRep.h:95
virtual void setAmplitude(double V)
Set amplitude.
static bool ignoreCavities
Cavities are ignored (amplitude = 0) when this switch is set.
static void setIgnore(bool ignore=false)
Set ignore switch.
virtual AcceleratingField & getField()
Get field.
AcceleratingField field
The cavity's field.
Definition RFCavityRep.h:98
virtual double getFrequency() const
Get frequency.
virtual ~RFCavityRep()
Interface for standing wave cavities.
Definition RFCavity.h:34
A geometry representing a straight line.