39 std::string(
"The \"VARIABLE_RF_CAVITY_FRINGE_FIELD\" element defines an RF cavity ")+
40 std::string(
"with time dependent frequency, phase and amplitude.");
43 OpalElement(
SIZE,
"VARIABLE_RF_CAVITY_FRINGE_FIELD", doc_string.c_str()) {
45 "The name of the phase time dependence model, which should give the phase in [rad].");
47 "The name of the amplitude time dependence model, which should give the field in [MV/m]");
49 "The name of the frequency time dependence model, which should give the field in [MHz].");
51 "Full width of the cavity [m].");
53 "Full height of the cavity [m].");
55 "Length of the cavity field flat top [m].");
57 "Length of the cavity fringe fields [m].");
59 "Offset of the cavity centre from the beginning of the cavity [m].");
61 "Maximum power of y that will be evaluated in field calculations.");
69 const std::string &
name,
81 const std::string &
name) {
117 std::shared_ptr<endfieldmodel::EndFieldModel>
end(
tanh);
128 throw OpalException(
"OpalVariableRFCavityFringeField::convertToUnsigned",
130 " should be an unsigned int but a real value was found");
133 throw OpalException(
"OpalVariableRFCavityFringeField::convertToUnsigned",
134 "Value for "+
name+
" should be 0 or more");
Tps< T > tanh(const Tps< T > &x)
Hyperbolic tangent.
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
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 setPhaseName(std::string phase)
virtual void setHeight(double fullHeight)
virtual void setAmplitudeName(std::string amplitude)
virtual void setLength(double length)
virtual void setWidth(double fullWidth)
virtual void setFrequencyName(std::string frequency)
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.
void registerOwnership() const
virtual ~OpalVariableRFCavityFringeField()
static const std::string doc_string
static size_t convertToUnsigned(double value, std::string name)
OpalVariableRFCavityFringeField * clone()
OpalVariableRFCavityFringeField()
static constexpr double unsignedTolerance
The base class for all OPAL exceptions.