CSRIGFWakeFunction.hh 1.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#ifndef CSRIGFWAKEFUNCTION_HH
#define CSRIGFWAKEFUNCTION_HH

#include "Solvers/WakeFunction.hh"
#include <vector>
#include <string>

class ElementBase;
class Filter;

class CSRIGFWakeFunction: public WakeFunction {
public:
    CSRIGFWakeFunction(const std::string &name, ElementBase *element, std::vector<Filter *> filters, const unsigned int &N);

    void apply(PartBunch &bunch);

    void initialize(const ElementBase * ref);

    virtual const std::string getType() const;

private:
    void calculateLineDensity(PartBunch & bunch, double meshSpacing);
    void calculateContributionInside(size_t sliceNumber, double angleOfSlice, double meshSpacing);
    void calculateContributionAfter(size_t sliceNumber, double angleOfSlice, double meshSpacing);
    void calculateGreenFunction(PartBunch &bunch, double meshSpacing);
    double calcPsi(const double &psiInitial, const double &x, const double &Ds) const;

    std::vector<Filter *> filters_m;
29
    LineDensity lineDensity_m;
30 31 32 33
    LineDensity dlineDensitydz_m;

    // Longitudinal CSR field.
    std::vector<double> Ez_m;
34

35 36
    // Chi used to calculate the Green's function
    std::vector<double> Chi_m;
37

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
    // Green's function
    std::vector<double> Grn_m;

    // Retarded angle Psi; (for after dipole, Stupakov)
    std::vector<double> Psi_m;

    // Start position of CSR wake.
    double Begin_m;

    // Start position of equivalent hard edge dipole that approximates actual
    // dipole.
    double FieldBegin_m;

    // Effective length of dipole.
    double Length_m;

    // Radius of curvature of effective dipole.
    double bendRadius_m;

    std::string bendName_m;

    double totalBendAngle_m;

};

#endif //CSRIGFWAKEFUNCTION_HH