OPAL (Object Oriented Parallel Accelerator Library) 2024.2
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 <cstddef>
23#include <memory>
24#include <string>
25#include <utility>
26#include <vector>
27
28class Filter;
29class ElementBase;
30
32public:
33 CSRWakeFunction(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 double calcPsi(const double& psiInitial, const double& x, const double& Ds) const;
47
48 std::vector<Filter*> filters_m;
49 std::shared_ptr<Filter> defaultFilter_m;
51
54
55 // Longitudinal CSR field.
56 std::vector<double> Ez_m;
57
58 // Retarded angle Psi;
59 std::vector<double> Psi_m;
60
61 // Start position of CSR wake.
62 double Begin_m;
63
64 // Start position of equivalent hard edge dipole that approximates actual
65 // dipole.
67
68 // Effective length of dipole.
69 double Length_m;
70
71 // Radius of curvature of effective dipole.
73
74 std::string bendName_m;
75
77};
78
79#endif //CSRWAKEFUNCTION_HH
WakeType
const std::string name
Definition Filter.h:8
void calculateLineDensity(PartBunchBase< double, 3 > *bunch, std::pair< double, double > &meshInfo)
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 calculateContributionAfter(std::size_t sliceNumber, double angleOfSlice, double meshSpacing)
std::vector< double > Ez_m
std::vector< double > Psi_m
virtual WakeType getType() const override
LineDensity lineDensity_m
std::shared_ptr< Filter > defaultFilter_m
void initialize(const ElementBase *ref) override
void calculateContributionInside(std::size_t sliceNumber, double angleOfSlice, double meshSpacing)