19#ifndef CLASSIC_ABSBEAMLINE_VariableRFCavityFringeField_HH
20#define CLASSIC_ABSBEAMLINE_VariableRFCavityFringeField_HH
93 virtual bool apply(
const size_t& i,
const double& t,
128 (std::shared_ptr<endfieldmodel::EndFieldModel> endField);
135 virtual inline std::shared_ptr<endfieldmodel::EndFieldModel>
143 double& startField,
double& endField)
override;
168 std::vector<std::vector<double> >
f_m;
169 std::vector<std::vector<double> >
g_m;
170 std::vector<std::vector<double> >
h_m;
Generates a field like E = a(t) * sin{2*pi * integral(f(tau),0,t) + q(t)} B = 0 where E0,...
void initialise() const
Lookup the time dependencies and update.
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...
std::shared_ptr< endfieldmodel::EndFieldModel > endField_m
virtual ~VariableRFCavityFringeField()
Destructor does nothing.
std::vector< std::vector< double > > getBxCoefficients() const
Get the coefficients for Bx.
std::vector< std::vector< double > > f_m
VariableRFCavityFringeField & operator=(const VariableRFCavityFringeField &)
Assignment operator; performs deepcopy on time-dependence models.
virtual double getCavityCentre() const
Set the offset of centre of the cavity field from the element start in metres.
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override
Calculate the field at the position of the i^th particle.
std::vector< std::vector< double > > getEzCoefficients() const
Get the coefficients for Ez.
VariableRFCavityFringeField()
Default constructor.
virtual void setMaxOrder(size_t maxOrder)
Set the maximum y power.
std::vector< std::vector< double > > getEyCoefficients() const
Get the coefficients for Ey.
virtual std::shared_ptr< endfieldmodel::EndFieldModel > getEndField() const
Get the endFieldModel.
std::vector< std::vector< double > > h_m
void initialiseCoefficients()
Set the coefficients for calculating the field expansion.
std::vector< std::vector< double > > g_m
void printCoefficients(std::ostream &out) const
Print the coefficients to ostream out.
virtual size_t getMaxOrder() const
Get the maximum y power that will be used in field calculations.
virtual void accept(BeamlineVisitor &) const override
Apply visitor to RFCavity.
virtual ElementBase * clone() const override
Inheritable deepcopy method.
virtual void setCavityCentre(double zCentre)
Get the offset of centre of the cavity field from the element start in metres.
void initialise() const
Lookup the time dependencies and update.
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override
Calculate the field at a given position.
virtual void setEndField(std::shared_ptr< endfieldmodel::EndFieldModel > endField)
Set the endFieldModel.