OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
GreenWakeFunction Class Reference

#include <GreenWakeFunction.hh>

Inheritance diagram for GreenWakeFunction:
Inheritance graph
[legend]
Collaboration diagram for GreenWakeFunction:
Collaboration graph
[legend]

Classes

class  Wake
 

Public Member Functions

 ~GreenWakeFunction ()
 
 GreenWakeFunction (const std::string &name, ElementBase *element, std::vector< Filter * > filters, int NBIN, double Z0, double radius, double sigma, int acMode, double tau, int direction, bool constLength, std::string fname)
 just a Testfunction! Calculate the energy of the Wakefunction with the lambda More...
 
std::pair< int, int > distrIndices (int vectLen)
 given a vector of length N, distribute the indexes among the available processors More...
 
void apply (PartBunchBase< double, 3 > *bunch)
 
void setWakeFromFile (int NBin, double spacing)
 reads in the wakefield from file More...
 
virtual const std::string getType () const
 
- Public Member Functions inherited from WakeFunction
 WakeFunction (std::string name, ElementBase *elref, unsigned int n)
 
virtual ~WakeFunction ()
 
virtual void initialize (const ElementBase *ref)
 
const std::string & getName () const
 

Private Member Functions

template<class F >
double simpson (F &f, double a, double b, unsigned int N)
 Simpson-Integration from the function f from a to b with N steps. More...
 
void testApply (PartBunchBase< double, 3 > *bunch)
 Just a test function. More...
 
void compEnergy (const double K, const double charge, const double *lambda, double *OutEnergy)
 just a Testfunction! Calculate the energy of the Wakefunction with the lambda More...
 
void compEnergy (const double K, const double charge, std::vector< double > lambda, double *OutEnergy)
 Calculate the energy of the Wakefunction with the lambda. More...
 
void CalcWakeFFT (double spacing)
 Calculate the FFT of the Wakefunction. More...
 

Private Attributes

std::vector< double > lineDensity_m
 save the line Density of the particle bunch More...
 
std::vector< double > FftWField_m
 FFT of the zero padded wakefield. More...
 
int NBin_m
 divides the particle bunch in NBin slices More...
 
double Z0_m
 impedance More...
 
double radius_m
 radius More...
 
double sigma_m
 material constant More...
 
int acMode_m
 conductivity either 1="AC" or 2="DC" More...
 
double tau_m
 material constant More...
 
int direction_m
 direction either 1="Longitudinal" 2= "Transversal" More...
 
bool constLength_m
 true if the length of the particle bunch is considered as constant More...
 
std::string filename_m
 filename of the wakefield More...
 
std::vector< Filter * > filters_m
 

Additional Inherited Members

- Protected Attributes inherited from WakeFunction
const unsigned int nBins_m
 

Detailed Description

Definition at line 22 of file GreenWakeFunction.hh.

Constructor & Destructor Documentation

GreenWakeFunction::~GreenWakeFunction ( )

Definition at line 78 of file GreenWakeFunction.cpp.

GreenWakeFunction::GreenWakeFunction ( const std::string &  name,
ElementBase element,
std::vector< Filter * >  filters,
int  NBIN,
double  Z0,
double  radius,
double  sigma,
int  acMode,
double  tau,
int  direction,
bool  constLength,
std::string  fname 
)

just a Testfunction! Calculate the energy of the Wakefunction with the lambda

Todo:

In this code one can only apply either the longitudinal wakefield or the transversal wakefield. One should implement that both wakefields can be applied to the particle beam

NBins must be set equal to MT of the fieldsolver. This should be changed. (the length of lineDensity_m must be NBins and not to MT)

Parameters
[in]ref
[in]NBINnumber of Bins
[in]Z0impedance of the tube
[in]radiusradius of the tube
[in]sigmamaterial constant
[in]acMode1 for AC and 2 for DC
[in]taumaterial constant
[in]direction0 for transversal and 1 for Longitudinal
[in]constLengthtrue if the length of the particle bunch is considered as constant
[in]fnameread wake from file

Definition at line 46 of file GreenWakeFunction.cpp.

References endl(), and gmsg.

Here is the call graph for this function:

Member Function Documentation

void GreenWakeFunction::apply ( PartBunchBase< double, 3 > *  bunch)
virtual
void GreenWakeFunction::CalcWakeFFT ( double  spacing)
private

Calculate the FFT of the Wakefunction.

Parameters
[in]spacingdistance between 2 slice in the line distribution

Calculate the Wakefield on all processors

Reduce the results

Definition at line 407 of file GreenWakeFunction.cpp.

References acMode_m, direction_m, distrIndices(), FftWField_m, IpplInfo::myNode(), NBin_m, radius_m, real(), reduce(), sigma_m, simpson(), tau_m, and Z0_m.

Referenced by apply(), and testApply().

Here is the call graph for this function:

void GreenWakeFunction::compEnergy ( const double  K,
const double  charge,
const double *  lambda,
double *  OutEnergy 
)
private

just a Testfunction! Calculate the energy of the Wakefunction with the lambda

Parameters
[in]Ka constant
[in]chargea constant
[in]lambdathe distribution of the Particles
[out]OutEnergythis is the Output

Definition at line 290 of file GreenWakeFunction.cpp.

References FftWField_m, NBin_m, and real().

Referenced by apply(), and testApply().

Here is the call graph for this function:

void GreenWakeFunction::compEnergy ( const double  K,
const double  charge,
std::vector< double >  lambda,
double *  OutEnergy 
)
private

Calculate the energy of the Wakefunction with the lambda.

Parameters
[in]Ka constant
[in]chargea constant
[in]lambdathe distribution of the Particles
[out]OutEnergythis is the Output

Definition at line 350 of file GreenWakeFunction.cpp.

References FftWField_m, NBin_m, and real().

Here is the call graph for this function:

pair< int, int > GreenWakeFunction::distrIndices ( int  vectLen)

given a vector of length N, distribute the indexes among the available processors

Todo:
make this function general available
Parameters
[in]lengthof vector
[out]first,:lowIndex, second: hiIndex

Definition at line 95 of file GreenWakeFunction.cpp.

References IpplInfo::getNodes(), and IpplInfo::myNode().

Referenced by CalcWakeFFT().

Here is the call graph for this function:

const std::string GreenWakeFunction::getType ( ) const
virtual

Implements WakeFunction.

Definition at line 592 of file GreenWakeFunction.cpp.

void GreenWakeFunction::setWakeFromFile ( int  NBin,
double  spacing 
)

reads in the wakefield from file

Definition at line 515 of file GreenWakeFunction.cpp.

References endl(), FftWField_m, filename_m, Hypervolume::fs, name, NBin_m, and real().

Referenced by apply().

Here is the call graph for this function:

template<class F >
double GreenWakeFunction::simpson ( F &  f,
double  a,
double  b,
unsigned int  N 
)
inlineprivate

Simpson-Integration from the function f from a to b with N steps.

Parameters
[in]fthe function to integrate
[in]aintegrate from a
[in]bintegrate to b
[in]NNumber of integration points
Returns
function value of the integration

Definition at line 121 of file GreenWakeFunction.hh.

Referenced by CalcWakeFFT().

void GreenWakeFunction::testApply ( PartBunchBase< double, 3 > *  bunch)
private

Just a test function.

Definition at line 244 of file GreenWakeFunction.cpp.

References acMode_m, CalcWakeFFT(), compEnergy(), constLength_m, direction_m, Physics::e, FftWField_m, K, NBin_m, radius_m, sigma_m, tau_m, testLambda, and Z0_m.

Referenced by apply().

Here is the call graph for this function:

Member Data Documentation

int GreenWakeFunction::acMode_m
private

conductivity either 1="AC" or 2="DC"

Definition at line 155 of file GreenWakeFunction.hh.

Referenced by CalcWakeFFT(), and testApply().

bool GreenWakeFunction::constLength_m
private

true if the length of the particle bunch is considered as constant

Definition at line 161 of file GreenWakeFunction.hh.

Referenced by apply(), and testApply().

int GreenWakeFunction::direction_m
private

direction either 1="Longitudinal" 2= "Transversal"

Definition at line 159 of file GreenWakeFunction.hh.

Referenced by apply(), CalcWakeFFT(), and testApply().

std::vector<double> GreenWakeFunction::FftWField_m
private

FFT of the zero padded wakefield.

Definition at line 144 of file GreenWakeFunction.hh.

Referenced by apply(), CalcWakeFFT(), compEnergy(), setWakeFromFile(), and testApply().

std::string GreenWakeFunction::filename_m
private

filename of the wakefield

Definition at line 163 of file GreenWakeFunction.hh.

Referenced by apply(), and setWakeFromFile().

std::vector<Filter *> GreenWakeFunction::filters_m
private

Definition at line 165 of file GreenWakeFunction.hh.

Referenced by apply().

std::vector<double> GreenWakeFunction::lineDensity_m
private

save the line Density of the particle bunch

Definition at line 142 of file GreenWakeFunction.hh.

Referenced by apply().

int GreenWakeFunction::NBin_m
private

divides the particle bunch in NBin slices

Definition at line 147 of file GreenWakeFunction.hh.

Referenced by apply(), CalcWakeFFT(), compEnergy(), setWakeFromFile(), and testApply().

double GreenWakeFunction::radius_m
private

radius

Definition at line 151 of file GreenWakeFunction.hh.

Referenced by CalcWakeFFT(), and testApply().

double GreenWakeFunction::sigma_m
private

material constant

Definition at line 153 of file GreenWakeFunction.hh.

Referenced by CalcWakeFFT(), and testApply().

double GreenWakeFunction::tau_m
private

material constant

Definition at line 157 of file GreenWakeFunction.hh.

Referenced by CalcWakeFFT(), and testApply().

double GreenWakeFunction::Z0_m
private

impedance

Definition at line 149 of file GreenWakeFunction.hh.

Referenced by apply(), CalcWakeFFT(), and testApply().


The documentation for this class was generated from the following files: