29 std::string(
"The \"VARIABLE_RF_CAVITY_FRINGE_FIELD\" element defines an RF cavity ") +
30 std::string(
"with time dependent frequency, phase and amplitude.");
36 "The name of the phase time dependence model, which should give the phase in [rad].");
40 "The name of the amplitude time dependence model, which should give the field in [MV/m].");
44 "The name of the frequency time dependence model, which should give the field in [MHz].");
47 (
"WIDTH",
"Full width of the cavity [m].");
50 (
"HEIGHT",
"Full height of the cavity [m].");
53 (
"CENTRE_LENGTH",
"Length of the cavity field flat top [m].");
56 (
"END_LENGTH",
"Length of the cavity fringe fields [m].");
59 (
"CAVITY_CENTRE",
"Offset of the cavity centre from the beginning of the cavity [m].");
62 (
"MAX_ORDER",
"Maximum power of y that will be evaluated in field calculations.");
70 const std::string&
name,
124 std::shared_ptr<endfieldmodel::EndFieldModel>
end(
tanh);
132 const std::string&
name) {
135 throw OpalException(
"OpalVariableRFCavityFringeField::convertToUnsigned",
136 "Value for " +
name +
137 " should be an unsigned int but a real value was found");
139 if (std::floor(value) < -0.5) {
140 throw OpalException(
"OpalVariableRFCavityFringeField::convertToUnsigned",
141 "Value for " +
name +
" should be 0 or more");
143 size_t ret(std::floor(value));
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
Tps< T > tanh(const Tps< T > &x)
Hyperbolic tangent.
double getReal(const Attribute &attr)
Return real value.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
std::string getString(const Attribute &attr)
Get string value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
ElementBase * getElement() const
Return the embedded CLASSIC element.
void setElement(ElementBase *)
Assign new CLASSIC element.
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
virtual void setHeight(double fullHeight)
virtual void setPhaseName(const std::string &phase)
virtual void setAmplitudeName(const std::string &litude)
virtual void setLength(double length)
virtual void setFrequencyName(const std::string &frequency)
virtual void setWidth(double fullWidth)
virtual void setMaxOrder(size_t maxOrder)
virtual void setCavityCentre(double zCentre)
virtual void setEndField(std::shared_ptr< endfieldmodel::EndFieldModel > endField)
virtual void update()
Update the embedded CLASSIC element.
OpalElement(int size, const char *name, const char *help)
Exemplar constructor.
void registerOwnership() const
virtual ~OpalVariableRFCavityFringeField()
OpalVariableRFCavityFringeField(const std::string &name, OpalVariableRFCavityFringeField *parent)
static const std::string doc_string
OpalVariableRFCavityFringeField * clone()
OpalVariableRFCavityFringeField()
static constexpr double unsignedTolerance
static size_t convertToUnsigned(double value, const std::string &name)
The base class for all OPAL exceptions.