OPAL (Object Oriented Parallel Accelerator Library) 2022.1
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
21
22#include <memory>
23#include <string>
24#include <vector>
25
26class Filter;
27class ElementBase;
28
30public:
31 CSRIGFWakeFunction(const std::string& name, std::vector<Filter*> filters, const unsigned int& N);
32
33 void apply(PartBunchBase<double, 3>* bunch) override;
34
35 void initialize(const ElementBase* ref) override;
36
37 virtual WakeType getType() const override;
38
39private:
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.
72
73 // Effective length of dipole.
74 double Length_m;
75
76 // Radius of curvature of effective dipole.
78
79 std::string bendName_m;
80
82};
83
84#endif //CSRIGFWAKEFUNCTION_HH
WakeType
Definition: WakeFunction.h:28
const std::string name
Definition: Filter.h:8
void calculateGreenFunction(PartBunchBase< double, 3 > *bunch, double meshSpacing)
void apply(PartBunchBase< double, 3 > *bunch) override
void calculateLineDensity(PartBunchBase< double, 3 > *bunch, std::pair< double, double > &meshInfo)
std::vector< double > Chi_m
std::vector< double > Grn_m
CSRIGFWakeFunction(const std::string &name, std::vector< Filter * > filters, const unsigned int &N)
void initialize(const ElementBase *ref) override
void calculateContributionAfter(size_t sliceNumber, double angleOfSlice, double meshSpacing)
std::vector< double > Psi_m
std::vector< double > Ez_m
std::shared_ptr< Filter > defaultFilter_m
LineDensity dlineDensitydz_m
std::vector< Filter * > filters_m
void calculateContributionInside(size_t sliceNumber, double angleOfSlice, double meshSpacing)
double calcPsi(const double &psiInitial, const double &x, const double &Ds) const
virtual WakeType getType() const override