29 std::string(
"The \"VARIABLE_RF_CAVITY_FRINGE_FIELD\" element defines an RF cavity ") +
30 std::string(
"with time dependent frequency, phase and amplitude.");
33 OpalElement(
SIZE,
"VARIABLE_RF_CAVITY_FRINGE_FIELD", doc_string.c_str()) {
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");
140 throw OpalException(
"OpalVariableRFCavityFringeField::convertToUnsigned",
141 "Value for " + name +
" should be 0 or more");
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
virtual void setEndField(std::shared_ptr< endfieldmodel::EndFieldModel > endField)
std::string getString(const Attribute &attr)
Get string value.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
static const std::string doc_string
virtual void setFrequencyName(const std::string &frequency)
virtual void setWidth(double fullWidth)
static constexpr double unsignedTolerance
void setElement(ElementBase *)
Assign new CLASSIC element.
virtual void setCavityCentre(double zCentre)
static size_t convertToUnsigned(double value, const std::string &name)
Tps< T > tanh(const Tps< T > &x)
Hyperbolic tangent.
The base class for all OPAL exceptions.
virtual void setLength(double length)
virtual void setAmplitudeName(const std::string &litude)
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
ElementBase * getElement() const
Return the embedded CLASSIC element.
virtual ~OpalVariableRFCavityFringeField()
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
OpalVariableRFCavityFringeField * clone()
OpalVariableRFCavityFringeField()
double getReal(const Attribute &attr)
Return real value.
virtual void setHeight(double fullHeight)
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
virtual void setMaxOrder(size_t maxOrder)
virtual void setPhaseName(const std::string &phase)
virtual void update()
Update the embedded CLASSIC element.
void registerOwnership() const