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");
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
Tps< T > tanh(const Tps< T > &x)
Hyperbolic tangent.
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(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.
Calculate the Tanh function (e.g.
virtual void setHeight(double fullHeight)
Set the full height of the cavity.
virtual void setPhaseName(const std::string &phase)
Set the phase time dependence name.
virtual void setAmplitudeName(const std::string &litude)
Set the amplitude time dependence name.
virtual void setLength(double length)
Set the length of the cavity.
virtual void setFrequencyName(const std::string &frequency)
Set the frequency time dependence name.
virtual void setWidth(double fullWidth)
Set the full width of the cavity.
Generates a field like Ey = E0*a(t)*y^{2n+1} g_n(z) sin{f(t)*t-q(t)} Ez = E0*a(t)*y^{2n} f_n(z) sin{f...
virtual void setMaxOrder(size_t maxOrder)
Set the maximum y power.
virtual void setCavityCentre(double zCentre)
Get the offset of centre of the cavity field from the element start in metres.
virtual void setEndField(std::shared_ptr< endfieldmodel::EndFieldModel > endField)
Set the endFieldModel.
virtual void update()
Update the embedded CLASSIC element.
void registerOwnership() const
virtual ~OpalVariableRFCavityFringeField()
Destructor does nothing.
static const std::string doc_string
OpalVariableRFCavityFringeField * clone()
Inherited copy constructor.
OpalVariableRFCavityFringeField()
Default constructor.
static constexpr double unsignedTolerance
static size_t convertToUnsigned(double value, const std::string &name)
Check for conversion to unsigned int.
virtual void update()
Update the OpalVariableRFCavity with new parameters from UI parser.
The base class for all OPAL exceptions.