OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
CSRIGFWakeFunction.h
Go to the documentation of this file.
1 //
2 // Class CSRIGFWakeFunction
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 CSRIGFWAKEFUNCTION_HH
18 #define CSRIGFWAKEFUNCTION_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  CSRIGFWakeFunction(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  void calculateGreenFunction(PartBunchBase<double, 3> *bunch, double meshSpacing);
45  double calcPsi(const double &psiInitial, const double &x, const double &Ds) const;
46 
47  std::vector<Filter *> filters_m;
48  std::shared_ptr<Filter> defaultFilter_m;
50 
53 
54  // Longitudinal CSR field.
55  std::vector<double> Ez_m;
56 
57  // Chi used to calculate the Green's function
58  std::vector<double> Chi_m;
59 
60  // Green's function
61  std::vector<double> Grn_m;
62 
63  // Retarded angle Psi; (for after dipole, Stupakov)
64  std::vector<double> Psi_m;
65 
66  // Start position of CSR wake.
67  double Begin_m;
68 
69  // Start position of equivalent hard edge dipole that approximates actual
70  // dipole.
71  double FieldBegin_m;
72 
73  // Effective length of dipole.
74  double Length_m;
75 
76  // Radius of curvature of effective dipole.
77  double bendRadius_m;
78 
79  std::string bendName_m;
80 
82 
83 };
84 
85 #endif //CSRIGFWAKEFUNCTION_HH
const std::string name
Definition: Filter.h:8
void calculateGreenFunction(PartBunchBase< double, 3 > *bunch, double meshSpacing)
void initialize(const ElementBase *ref)
void calculateLineDensity(PartBunchBase< double, 3 > *bunch, std::pair< double, double > &meshInfo)
std::vector< double > Chi_m
std::vector< double > Grn_m
std::vector< Filter * > filters_m
CSRIGFWakeFunction(const std::string &name, std::vector< Filter * > filters, const unsigned int &N)
void apply(PartBunchBase< double, 3 > *bunch)
void calculateContributionAfter(size_t sliceNumber, double angleOfSlice, double meshSpacing)
std::vector< double > Psi_m
virtual const std::string getType() const
std::vector< double > Ez_m
std::shared_ptr< Filter > defaultFilter_m
LineDensity dlineDensitydz_m
void calculateContributionInside(size_t sliceNumber, double angleOfSlice, double meshSpacing)
double calcPsi(const double &psiInitial, const double &x, const double &Ds) const