OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
CSRWakeFunction.h
Go to the documentation of this file.
1 //
2 // Class CSRWakeFunction
3 //
4 // Copyright (c) 2008 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
5 // All rights reserved
6 //
7 // This file is part of OPAL.
8 //
9 // OPAL is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
16 //
17 #ifndef CSRWAKEFUNCTION_HH
18 #define CSRWAKEFUNCTION_HH
19 
20 #include "Solvers/WakeFunction.h"
21 
22 #include <memory>
23 #include <vector>
24 #include <string>
25 
26 class Filter;
27 class ElementBase;
28 
30 public:
31  CSRWakeFunction(const std::string &name, std::vector<Filter *> filters, const unsigned int &N);
32 
33  void apply(PartBunchBase<double, 3> *bunch);
34 
35  void initialize(const ElementBase * ref);
36 
37  virtual const std::string getType() const;
38 
39 private:
40  void calculateLineDensity(PartBunchBase<double, 3> *bunch, std::pair<double, double> &meshInfo);
41 
42  void calculateContributionInside(size_t sliceNumber, double angleOfSlice, double meshSpacing);
43  void calculateContributionAfter(size_t sliceNumber, double angleOfSlice, double meshSpacing);
44  double calcPsi(const double &psiInitial, const double &x, const double &Ds) const;
45 
46  std::vector<Filter *> filters_m;
47  std::shared_ptr<Filter> defaultFilter_m;
49 
52 
53  // Longitudinal CSR field.
54  std::vector<double> Ez_m;
55 
56  // Retarded angle Psi;
57  std::vector<double> Psi_m;
58 
59  // Start position of CSR wake.
60  double Begin_m;
61 
62  // Start position of equivalent hard edge dipole that approximates actual
63  // dipole.
64  double FieldBegin_m;
65 
66  // Effective length of dipole.
67  double Length_m;
68 
69  // Radius of curvature of effective dipole.
70  double bendRadius_m;
71 
72  std::string bendName_m;
73 
75 
76 };
77 
78 #endif //CSRWAKEFUNCTION_HH
const std::string name
Definition: Filter.h:8
void calculateLineDensity(PartBunchBase< double, 3 > *bunch, std::pair< double, double > &meshInfo)
void calculateContributionAfter(size_t sliceNumber, double angleOfSlice, double meshSpacing)
virtual const std::string getType() const
std::string bendName_m
LineDensity dlineDensitydz_m
double calcPsi(const double &psiInitial, const double &x, const double &Ds) const
void calculateContributionInside(size_t sliceNumber, double angleOfSlice, double meshSpacing)
std::vector< double > Ez_m
std::vector< Filter * > filters_m
std::vector< double > Psi_m
void initialize(const ElementBase *ref)
CSRWakeFunction(const std::string &name, std::vector< Filter * > filters, const unsigned int &N)
LineDensity lineDensity_m
std::shared_ptr< Filter > defaultFilter_m
void apply(PartBunchBase< double, 3 > *bunch)