OPAL (Object Oriented Parallel Accelerator Library) 2024.2
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 <cstddef>
23#include <memory>
24#include <string>
25#include <vector>
26#include <utility>
27
28class Filter;
29class ElementBase;
30
32public:
33 CSRIGFWakeFunction(const std::string& name, std::vector<Filter*> filters, const unsigned int& N);
34
35 void apply(PartBunchBase<double, 3>* bunch) override;
36
37 void initialize(const ElementBase* ref) override;
38
39 virtual WakeType getType() const override;
40
41private:
42 void calculateLineDensity(PartBunchBase<double, 3>* bunch, std::pair<double, double>& meshInfo);
43
44 void calculateContributionInside(std::size_t sliceNumber, double angleOfSlice, double meshSpacing);
45 void calculateContributionAfter(std::size_t sliceNumber, double angleOfSlice, double meshSpacing);
46 void calculateGreenFunction(PartBunchBase<double, 3>* bunch, double meshSpacing);
47 double calcPsi(const double& psiInitial, const double& x, const double& Ds) const;
48
49 std::vector<Filter*> filters_m;
50 std::shared_ptr<Filter> defaultFilter_m;
52
55
56 // Longitudinal CSR field.
57 std::vector<double> Ez_m;
58
59 // Chi used to calculate the Green's function
60 std::vector<double> Chi_m;
61
62 // Green's function
63 std::vector<double> Grn_m;
64
65 // Retarded angle Psi; (for after dipole, Stupakov)
66 std::vector<double> Psi_m;
67
68 // Start position of CSR wake.
69 double Begin_m;
70
71 // Start position of equivalent hard edge dipole that approximates actual
72 // dipole.
74
75 // Effective length of dipole.
76 double Length_m;
77
78 // Radius of curvature of effective dipole.
80
81 std::string bendName_m;
82
84};
85
86#endif //CSRIGFWAKEFUNCTION_HH
WakeType
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
void initialize(const ElementBase *ref) override
std::vector< double > Psi_m
std::vector< double > Ez_m
void calculateContributionInside(std::size_t sliceNumber, double angleOfSlice, double meshSpacing)
std::shared_ptr< Filter > defaultFilter_m
void calculateContributionAfter(std::size_t sliceNumber, double angleOfSlice, double meshSpacing)
std::vector< Filter * > filters_m
double calcPsi(const double &psiInitial, const double &x, const double &Ds) const
virtual WakeType getType() const override