OPAL (Object Oriented Parallel Accelerator Library) 2022.1
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
21
22#include <memory>
23#include <string>
24#include <vector>
25
26class Filter;
27class ElementBase;
28
30public:
31 CSRWakeFunction(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 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.
65
66 // Effective length of dipole.
67 double Length_m;
68
69 // Radius of curvature of effective dipole.
71
72 std::string bendName_m;
73
75};
76
77#endif //CSRWAKEFUNCTION_HH
WakeType
Definition: WakeFunction.h:28
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)
std::vector< Filter * > filters_m
std::string bendName_m
LineDensity dlineDensitydz_m
double calcPsi(const double &psiInitial, const double &x, const double &Ds) const
void apply(PartBunchBase< double, 3 > *bunch) override
void calculateContributionInside(size_t sliceNumber, double angleOfSlice, double meshSpacing)
std::vector< double > Ez_m
std::vector< double > Psi_m
CSRWakeFunction(const std::string &name, std::vector< Filter * > filters, const unsigned int &N)
virtual WakeType getType() const override
LineDensity lineDensity_m
std::shared_ptr< Filter > defaultFilter_m
void initialize(const ElementBase *ref) override