OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
core of the envelope tracker based on Rene Bakkers BET implementation More...
#include <EnvelopeBunch.h>
Public Member Functions | |
EnvelopeBunch (const PartData *ref) | |
Default constructor. More... | |
EnvelopeBunch (const std::vector< OpalParticle > &, const PartData *ref) | |
Conversion. More... | |
EnvelopeBunch (const EnvelopeBunch &)=delete | |
Copy constructor (implement if needed) More... | |
virtual | ~EnvelopeBunch () |
void | createBunch () |
create and initialize local num slices More... | |
void | distributeSlices (int nSlice=101) |
distributes nSlice amongst processors and initializes slices More... | |
void | initialize (int sli, double charge, double energy, double width, double te, double frac, double current, double center, double bX, double bY, double mX, double mY, double Bz, int nbin) |
bool | isRadial () |
check if solver includes radial More... | |
bool | isOffaxis () |
check if solver includes off-axis tracking More... | |
void | calcBeamParameters () |
calculates envelope statistics More... | |
void | computeSpaceCharge () |
void | timeStep (double tStep, double zCat=0.0) |
performs a time-step for all active slices (also handles emission) More... | |
void | derivs (double tc, double Y[], double dYdt[]) |
helper function to calculate derivatives need in RH equation More... | |
double | Eavg () |
calculate the average energy of the bunch More... | |
double | zAvg () |
calculate <z> [m] More... | |
double | zTail () |
calculate tail of bunch [m] More... | |
double | zHead () |
calculate the head of the bunch [m] More... | |
double | time () |
read time-stamp of bunch More... | |
void | setEx (double emi) |
set emittance X More... | |
void | setEy (double emi) |
set emittance Y More... | |
void | setSolverParameter (int s) |
set the DE solver flag More... | |
void | setEnergy (double, double=0.0) |
void | setExternalFields (int i, const Vector_t &EF, const Vector_t &BF, const Vector_t &KR, const Vector_t &KT) |
void | getExternalFields (int i, Vector_t &EF, Vector_t &BF, Vector_t &KR, Vector_t &KT) const |
double | get_sPos () |
return reference position More... | |
double | AvBField () |
returns average magnetic field More... | |
double | AvEField () |
returns average electric field More... | |
int | getLocalNum () |
returns the number of local slices More... | |
int | getTotalNum () |
returns the total number of slices More... | |
double | getT () |
returns the current time of the bunch More... | |
double | get_meanKineticEnergy () |
returns the mean energy More... | |
double | get_dEdt () |
returns the energy spread More... | |
Vector_t | sigmax () |
returns vector with rms position More... | |
Vector_t | sigmap () |
returns vector with rms momenta More... | |
Vector_t | emtn () |
returns vector with emittance More... | |
Vector_t | get_norm_emit () |
returns vector with normalized emittance More... | |
Vector_t | maxX () |
returns vector with the max spatial extends of the bunch More... | |
Vector_t | minX () |
returns vector with the min spatial extends of the bunch More... | |
Vector_t | maxP () |
returns vector with the max momentum of the bunch More... | |
Vector_t | minP () |
returns vector with the min momentum of the bunch More... | |
double | getChargePerParticle () |
returns charge per slice More... | |
Vector_t | get_rrms () |
returns RMS x,y,z More... | |
Vector_t | get_prms () |
returns RMSP x,y,z More... | |
size_t | mySliceStartOffset () |
size_t | mySliceEndOffset () |
size_t | numMySlices () |
Inform & | slprint (Inform &os) |
void | setCharge (double _Q) |
set the charge of the bunch More... | |
double | getGamma (int i) |
returns gamma of slice i More... | |
double | getBeta (int i) |
returns beta of slice i More... | |
void | setBeta (int i, double val) |
void | setR (int i, const Vector_t &R) |
Vector_t | getR (int i) |
void | setP (int i, const Vector_t &P) |
Vector_t | getP (int i) |
void | setZ (int i, double coo) |
set Z coordinate of slice i More... | |
double | getZ (int i) |
returns Z coordinate of slice i More... | |
double | getX (int i) |
returns X coordinate of slice i More... | |
void | setX (int i, double val) |
double | getY (int i) |
returns Y coordinate of slice i More... | |
void | setY (int i, double val) |
double | getX0 (int i) |
returns X coordinate of the centroid of slice i More... | |
void | setX0 (int i, double val) |
double | getY0 (int i) |
returns Y coordinate of the centroid of slice i More... | |
void | setY0 (int i, double val) |
double | getPx (int i) |
returns X momenta of slice i More... | |
void | setPx (int i, double val) |
double | getPy (int i) |
returns Y momenta of slice i More... | |
void | setPy (int i, double val) |
double | getPz (int i) |
returns Z momenta of slice i More... | |
double | getPx0 (int i) |
returns angular deflection centroid in x of slice i More... | |
void | setPx0 (int i, double val) |
double | getPy0 (int i) |
returns angular deflection centroid in y of slice i More... | |
void | setPy0 (int i, double val) |
void | get_bounds (Vector_t &min, Vector_t &max) |
returns bounds of envelope bunch More... | |
![]() | |
PartBunch (const PartData *ref) | |
Default constructor. More... | |
PartBunch ()=delete | |
PartBunch (const PartBunch &)=delete | |
PartBunch & | operator= (const PartBunch &)=delete |
~PartBunch () | |
void | runTests () |
void | initialize (FieldLayout_t *fLayout) |
void | do_binaryRepart () |
double | getRho (int x, int y, int z) |
const Mesh_t & | getMesh () const |
Mesh_t & | getMesh () |
FieldLayout_t & | getFieldLayout () |
void | setBCAllPeriodic () |
void | setBCAllOpen () |
void | setBCForDCBeam () |
VectorPair_t | getEExtrema () |
void | computeSelfFields () |
void | computeSelfFields (int b) |
void | computeSelfFields_cycl (double gamma) |
Calculates the self electric field from the charge density distribution for use in cyclotrons. More... | |
void | computeSelfFields_cycl (int b) |
Calculates the self electric field from the charge density distribution for use in cyclotrons. More... | |
void | resetInterpolationCache (bool clearCache=false) |
void | swap (unsigned int i, unsigned int j) |
Inform & | print (Inform &os) |
![]() | |
PartBunchBase (AbstractParticle< double, Dim > *pb) | |
PartBunchBase (AbstractParticle< double, Dim > *pb, const PartData *ref) | |
PartBunchBase (const PartBunchBase &rhs)=delete | |
virtual | ~PartBunchBase () |
bool | getIfBeamEmitting () |
int | getLastEmittedEnergyBin () |
size_t | getNumberOfEmissionSteps () |
int | getNumberOfEnergyBins () |
void | Rebin () |
void | setEnergyBins (int numberOfEnergyBins) |
bool | weHaveEnergyBins () |
void | switchToUnitlessPositions (bool use_dt_per_particle=false) |
void | switchOffUnitlessPositions (bool use_dt_per_particle=false) |
void | setDistribution (Distribution *d, std::vector< Distribution * > addedDistributions, size_t &np) |
bool | isGridFixed () |
bool | hasBinning () |
void | setTEmission (double t) |
double | getTEmission () |
bool | doEmission () |
bool | weHaveBins () const |
void | setPBins (PartBins *pbin) |
void | setPBins (PartBinsCyc *pbin) |
size_t | emitParticles (double eZ) |
Emit particles in the given bin i.e. copy the particles from the bin structure into the particle container. More... | |
void | updateNumTotal () |
void | rebin () |
int | getNumBins () |
int | getLastemittedBin () |
void | setLocalBinCount (size_t num, int bin) |
void | calcGammas () |
Compute the gammas of all bins. More... | |
void | calcGammas_cycl () |
double | getBinGamma (int bin) |
Get gamma of one bin. More... | |
virtual void | setBinCharge (int bin, double q) |
Set the charge of one bin to the value of q and all other to zero. More... | |
virtual void | setBinCharge (int bin) |
Set the charge of all other the ones in bin to zero. More... | |
size_t | calcNumPartsOutside (Vector_t x) |
returns the number of particles outside of a box defined by x More... | |
void | calcLineDensity (unsigned int nBins, std::vector< double > &lineDensity, std::pair< double, double > &meshInfo) |
void | setBeamFrequency (double v) |
virtual void | boundp () |
void | boundp_destroy () |
size_t | boundp_destroyT () |
size_t | destroyT () |
void | get_bounds (Vector_t &rmin, Vector_t &rmax) |
void | getLocalBounds (Vector_t &rmin, Vector_t &rmax) |
std::pair< Vector_t, double > | getBoundingSphere () |
std::pair< Vector_t, double > | getLocalBoundingSphere () |
void | push_back (OpalParticle p) |
void | set_part (FVector< double, 6 > z, int ii) |
void | set_part (OpalParticle p, int ii) |
OpalParticle | get_part (int ii) |
void | maximumAmplitudes (const FMatrix< double, 6, 6 > &D, double &axmax, double &aymax) |
Return maximum amplitudes. More... | |
void | setdT (double dt) |
double | getdT () const |
void | setT (double t) |
void | incrementT () |
double | getT () const |
double | get_sPos () |
void | set_sPos (double s) |
double | get_gamma () const |
double | get_meanKineticEnergy () const |
Vector_t | get_origin () const |
Vector_t | get_maxExtent () const |
Vector_t | get_centroid () const |
Vector_t | get_rrms () const |
Vector_t | get_rprms () const |
Vector_t | get_rmean () const |
Vector_t | get_prms () const |
Vector_t | get_pmean () const |
Vector_t | get_pmean_Distribution () const |
Vector_t | get_emit () const |
Vector_t | get_norm_emit () const |
Vector_t | get_halo () const |
virtual Vector_t | get_hr () const |
double | get_Dx () const |
double | get_Dy () const |
double | get_DDx () const |
double | get_DDy () const |
virtual void | set_meshEnlargement (double dh) |
void | gatherLoadBalanceStatistics () |
size_t | getLoadBalance (int p) const |
void | get_PBounds (Vector_t &min, Vector_t &max) const |
void | calcBeamParameters () |
void | calcBeamParametersInitial () |
double | getCouplingConstant () const |
void | setCouplingConstant (double c) |
void | setCharge (double q) |
void | setChargeZeroPart (double q) |
void | setMass (double mass) |
double | getEkin () const |
Need Ek for the Schottky effect calculation (eV) More... | |
double | getWorkFunctionRf () const |
Need the work function for the Schottky effect calculation (eV) More... | |
double | getLaserEnergy () const |
Need the laser energy for the Schottky effect calculation (eV) More... | |
double | getCharge () const |
get the total charge per simulation particle More... | |
double | getChargePerParticle () const |
get the macro particle charge More... | |
virtual void | setSolver (FieldSolver *fs) |
bool | hasFieldSolver () |
std::string | getFieldSolverType () const |
void | setStepsPerTurn (int n) |
int | getStepsPerTurn () const |
void | setGlobalTrackStep (long long n) |
step in multiple TRACK commands More... | |
long long | getGlobalTrackStep () const |
void | setLocalTrackStep (long long n) |
step in a TRACK command More... | |
void | incTrackSteps () |
long long | getLocalTrackStep () const |
void | setNumBunch (short n) |
short | getNumBunch () const |
void | setTotalNumPerBunch (size_t numpart, short n) |
size_t | getTotalNumPerBunch (short n) const |
void | setLocalNumPerBunch (size_t numpart, short n) |
size_t | getLocalNumPerBunch (short n) const |
void | countTotalNumPerBunch () |
void | setGlobalMeanR (Vector_t globalMeanR) |
Vector_t | getGlobalMeanR () |
void | setGlobalToLocalQuaternion (Quaternion_t globalToLocalQuaternion) |
Quaternion_t | getGlobalToLocalQuaternion () |
void | setSteptoLastInj (int n) |
int | getSteptoLastInj () |
double | calcMeanPhi () |
calculate average angle of longitudinal direction of bins More... | |
bool | resetPartBinID2 (const double eta) |
reset Bin[] for each particle according to the method given in paper PAST-AB(064402) by G. Fubiani et al. More... | |
bool | resetPartBinBunch () |
double | getdE () |
virtual void | actT () |
const PartData * | getReference () const |
double | getEmissionDeltaT () |
Quaternion_t | getQKs3D () |
void | setQKs3D (Quaternion_t q) |
Vector_t | getKs3DRefr () |
void | setKs3DRefr (Vector_t r) |
Vector_t | getKs3DRefp () |
void | setKs3DRefp (Vector_t p) |
void | iterateEmittedBin (int binNumber) |
void | calcEMean () |
void | correctEnergy (double avrgp) |
Inform & | print (Inform &os) |
size_t | getTotalNum () const |
void | setTotalNum (size_t n) |
void | setLocalNum (size_t n) |
size_t | getLocalNum () const |
size_t | getDestroyNum () const |
size_t | getGhostNum () const |
unsigned int | getMinimumNumberOfParticlesPerCore () const |
void | setMinimumNumberOfParticlesPerCore (unsigned int n) |
ParticleLayout< double, Dim > & | getLayout () |
const ParticleLayout< double, Dim > & | getLayout () const |
bool | getUpdateFlag (UpdateFlags_t f) const |
void | setUpdateFlag (UpdateFlags_t f, bool val) |
ParticleBConds< Position_t, Dimension > & | getBConds () |
void | setBConds (const ParticleBConds< Position_t, Dimension > &bc) |
bool | singleInitNode () const |
void | resetID () |
void | update () |
void | update (const ParticleAttrib< char > &canSwap) |
void | createWithID (unsigned id) |
void | create (size_t M) |
void | globalCreate (size_t np) |
void | destroy (size_t M, size_t I, bool doNow=false) |
void | performDestroy (bool updateLocalNum=false) |
void | ghostDestroy (size_t M, size_t I) |
FMatrix< double, 2 *Dim, 2 *Dim > | getSigmaMatrix () |
double | getQ () const |
Access to reference data. More... | |
double | getM () const |
double | getP () const |
double | getE () const |
ParticleType::type | getPType () const |
double | getInitialBeta () const |
double | getInitialGamma () const |
void | resetQ (double q) |
void | resetM (double m) |
void | setPType (ParticleType::type) |
Private Member Functions | |
void | synchronizeSlices () |
synchronize z position and betas of all slices (needed in calcI and space charge calculation) More... | |
void | runStats (EnvelopeBunchParameter sp, double *xAvg, double *xMax, double *xMin, double *rms, int *nValid) |
run statistics on slices More... | |
void | calcEmittance (double *emtnx, double *emtny, double *emtx, double *emty, int *nValid) |
calculate bunch emittance More... | |
void | calcEnergyChirp (double *g0, double *dgdt, double *gInc, int *nValid) |
calculate the energy chirp and uncorrelated energy spread More... | |
void | setBinnedLShape (EnvelopeBunchShape shape, double z0, double w, double frac) |
set longitudinal shape of bunch (initial distribution) More... | |
void | setTShape (double enx, double eny, double rx, double ry, double b0) |
set transverse shape of bunch (initial distribution) More... | |
void | setTOffset (double x0, double px0, double y0, double py0) |
set transverse offset of bunch More... | |
double | moveZ0 (double zC) |
move the complete bunch forward such that the head of the bunch matches the cahtode position More... | |
void | backup () |
backup slice values More... | |
double | tReset (double dt=0.0) |
void | cSpaceCharge () |
void | calcI () |
calculates the current current distribution More... | |
Private Attributes | |
int | numSlices_m |
number of total slices in bunch More... | |
int | numMySlices_m |
number of my slices in bunch More... | |
size_t | mySliceStartOffset_m |
first global slice on this processor More... | |
size_t | mySliceEndOffset_m |
last global slice on this processor More... | |
std::vector< double > | z_m |
synchronized z positions for parallel tracker More... | |
std::vector< double > | b_m |
synchronized betas for parallel tracker More... | |
std::vector< std::vector< int > > | bins_m |
bins for emission More... | |
double | hbin_m |
emission bin width More... | |
int | nebin_m |
number of bins for emission More... | |
int | firstBinWithValue_m |
first bin on processor containing slices More... | |
int | activeSlices_m |
number of active slices More... | |
int | solver_m |
see enum SolverParameters More... | |
int | dStat_m |
see enum DataStatus More... | |
double | t_m |
local time in bunch [s] More... | |
double | t_offset_m |
accumulated time offset by tReset function More... | |
double | emtnx0_m |
intrinsic normalized emittance of slice [m rad] More... | |
double | emtny0_m |
double | emtbx0_m |
intrinsic normalized emittance Bush effect [m rad] More... | |
double | emtby0_m |
double | dx0_m |
offset of the coordinate system when tracking along the s-axis [m] More... | |
double | dy0_m |
double | dfi_x_m |
rotation of coordinate system when tracking along the s-axis [rad] More... | |
double | dfi_y_m |
double | Bz0_m |
magnetic field on cathode [T] More... | |
double | Q_m |
total bunch charge [C] More... | |
double | I0avg_m |
average current on creation of bunch (see setLshape) More... | |
Vector_t | Esl_m |
electric field More... | |
Vector_t | Bsl_m |
magnetic field More... | |
Vector_t | KRsl_m |
radial focussing term beam More... | |
Vector_t | KTsl_m |
transverse kick of beam More... | |
std::unique_ptr< Vector_t[]> | KR |
define value of radial kick for each slice More... | |
std::unique_ptr< Vector_t[]> | KT |
define value of transversal kick for each slice More... | |
std::unique_ptr< Vector_t[]> | EF |
external E fields More... | |
std::unique_ptr< Vector_t[]> | BF |
external B fields More... | |
std::vector< std::shared_ptr < EnvelopeSlice > > | slices_m |
array of slices More... | |
unsigned int | activeSlice_m |
int | sign_m |
gives the sign of charge Q More... | |
int | currentSlice_m |
current Slice set in run() & cSpaceCharge() and used in derivs() & zcsI() More... | |
double | zCat_m |
cathode position More... | |
std::vector< double > | Exw_m |
transverse wake field x More... | |
std::vector< double > | Eyw_m |
transverse wake field y More... | |
std::vector< double > | Ezw_m |
longitudinal wake field More... | |
std::vector< double > | Esct_m |
Longitudinal Space-charge field. More... | |
std::vector< double > | G_m |
Transverse Space-charge term: Eq.(9) More... | |
int | nValid_m |
double | z0_m |
double | emission_time_step_m |
size_t | lastEmittedBin_m |
double | E_m |
double | dEdt_m |
double | Einc_m |
double | tau_m |
double | I_m |
double | Irms_m |
double | Rx_m |
double | Ry_m |
double | RxMax_m |
double | RyMax_m |
double | RxMin_m |
double | RyMin_m |
double | Px_m |
double | Py_m |
double | x0_m |
double | y0_m |
double | x0Max_m |
double | y0Max_m |
double | x0Min_m |
double | y0Min_m |
double | Ez_m |
double | Bz_m |
Vector_t | maxX_m |
Vector_t | minX_m |
Vector_t | maxP_m |
Vector_t | minP_m |
Vector_t | sigmax_m |
Vector_t | sigmap_m |
Vector_t | emtn_m |
Vector_t | norm_emtn_m |
double | curZHead_m |
double | curZTail_m |
Additional Inherited Members | |
![]() | |
enum | { Dim = Dimension } |
typedef IpplParticleBase < Layout_t > | pbase_t |
![]() | |
enum | UnitState_t |
typedef AbstractParticle < double, Dim >::ParticlePos_t | ParticlePos_t |
typedef AbstractParticle < double, Dim > ::ParticleIndex_t | ParticleIndex_t |
typedef AbstractParticle < double, Dim >::UpdateFlags | UpdateFlags_t |
typedef AbstractParticle < double, Dim >::Position_t | Position_t |
typedef std::pair< Vector_t, Vector_t > | VectorPair_t |
![]() | |
static const unsigned | Dimension |
![]() | |
size_t | calcMoments () |
void | calcMomentsInitial () |
double | calculateAngle (double x, double y) |
angle range [0~2PI) degree More... | |
![]() | |
IpplTimings::TimerRef | boundpTimer_m |
IpplTimings::TimerRef | boundpBoundsTimer_m |
IpplTimings::TimerRef | boundpUpdateTimer_m |
IpplTimings::TimerRef | statParamTimer_m |
IpplTimings::TimerRef | histoTimer_m |
const PartData * | reference |
UnitState_t | unit_state_ |
UnitState_t | stateOfLastBoundP_ |
double | centroid_m [2 *Dim] |
holds the centroid of the beam More... | |
FMatrix< double, 2 *Dim, 2 *Dim > | moments_m |
6x6 matrix of the moments of the beam More... | |
double | dt_m |
holds the timestep in seconds More... | |
double | t_m |
holds the actual time of the integration More... | |
double | eKin_m |
mean energy of the bunch (MeV) More... | |
double | dE_m |
energy spread of the beam in MeV More... | |
double | spos_m |
the position along design trajectory More... | |
Vector_t | globalMeanR_m |
Quaternion_t | globalToLocalQuaternion_m |
Vector_t | rmax_m |
maximal extend of particles More... | |
Vector_t | rmin_m |
minimal extend of particles More... | |
Vector_t | rrms_m |
rms beam size (m) More... | |
Vector_t | prms_m |
rms momenta More... | |
Vector_t | rmean_m |
mean position (m) More... | |
Vector_t | pmean_m |
mean momenta More... | |
Vector_t | eps_m |
rms emittance (not normalized) More... | |
Vector_t | eps_norm_m |
rms normalized emittance More... | |
Vector_t | halo_m |
Vector_t | rprms_m |
rms correlation More... | |
double | Dx_m |
dispersion x & y More... | |
double | Dy_m |
double | DDx_m |
derivative of the dispersion More... | |
double | DDy_m |
Vector_t | hr_m |
meshspacing of cartesian mesh More... | |
Vektor< int, 3 > | nr_m |
meshsize of cartesian mesh More... | |
FieldSolver * | fs_m |
stores the used field solver More... | |
double | couplingConstant_m |
double | qi_m |
int | distDump_m |
counter to store the distribution dump More... | |
int | fieldDBGStep_m |
double | dh_m |
Mesh enlargement. More... | |
double | tEmission_m |
in % how much the mesh is enlarged More... | |
std::unique_ptr< double[]> | bingamma_m |
holds the gamma of the bin More... | |
std::unique_ptr< size_t[]> | binemitted_m |
int | stepsPerTurn_m |
steps per turn for OPAL-cycl More... | |
long long | localTrackStep_m |
step in a TRACK command More... | |
long long | globalTrackStep_m |
if multiple TRACK commands More... | |
short | numBunch_m |
current bunch number More... | |
std::vector< size_t > | bunchTotalNum_m |
number of particles per bunch More... | |
std::vector< size_t > | bunchLocalNum_m |
int | SteptoLastInj_m |
std::unique_ptr< size_t[]> | globalPartPerNode_m |
Distribution * | dist_m |
bool | dcBeam_m |
double | periodLength_m |
std::shared_ptr < AbstractParticle< double, Dim > > | pbase |
core of the envelope tracker based on Rene Bakkers BET implementation
Definition at line 60 of file EnvelopeBunch.h.
EnvelopeBunch::EnvelopeBunch | ( | const PartData * | ref | ) |
Default constructor.
Definition at line 64 of file EnvelopeBunch.cpp.
References calcITimer_m, IpplTimings::getTimer(), isValid_m, and spaceChargeTimer_m.
EnvelopeBunch::EnvelopeBunch | ( | const std::vector< OpalParticle > & | rhs, |
const PartData * | ref | ||
) |
Conversion.
Definition at line 76 of file EnvelopeBunch.cpp.
|
delete |
Copy constructor (implement if needed)
|
virtual |
Definition at line 84 of file EnvelopeBunch.cpp.
double EnvelopeBunch::AvBField | ( | ) |
returns average magnetic field
Definition at line 1405 of file EnvelopeBunch.cpp.
References BF, IpplInfo::getComm(), numMySlices_m, and numSlices_m.
Referenced by calcBeamParameters().
double EnvelopeBunch::AvEField | ( | ) |
returns average electric field
Definition at line 1417 of file EnvelopeBunch.cpp.
References EF, IpplInfo::getComm(), numMySlices_m, and numSlices_m.
Referenced by calcBeamParameters().
|
inlineprivate |
backup slice values
Definition at line 568 of file EnvelopeBunch.h.
References slices_m.
Referenced by moveZ0(), setBinnedLShape(), setEnergy(), setTShape(), and timeStep().
void EnvelopeBunch::calcBeamParameters | ( | ) |
calculates envelope statistics
Definition at line 87 of file EnvelopeBunch.cpp.
References AvBField(), AvEField(), Bz_m, Physics::c, calcEmittance(), calcEnergyChirp(), dEdt_m, E_m, Einc_m, Physics::EMASS, emtn_m, Ez_m, I_m, Irms_m, maxP_m, maxX_m, minP_m, minX_m, norm_emtn_m, numSlices_m, nValid_m, Physics::pi, Px_m, Py_m, Physics::q_e, Q_m, runStats(), Rx_m, RxMax_m, RxMin_m, Ry_m, RyMax_m, RyMin_m, sigmap_m, sigmax_m, solver_m, sp_beta, sp_I, sp_Px, sp_Py, sp_Pz, sp_Rx, sp_Ry, sp_x0, sp_y0, sp_z, sqrt(), IpplTimings::startTimer(), PartBunchBase< double, 3 >::statParamTimer_m, IpplTimings::stopTimer(), sv_offaxis, sv_radial, tau_m, Physics::two_pi, x0_m, x0Max_m, x0Min_m, y0_m, y0Max_m, y0Min_m, and z0_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope(), ParallelSliceTracker::updateSpaceOrientation(), StatWriter::write(), and H5PartWrapperForPS::writeStepHeader().
|
private |
calculate bunch emittance
emtnx | normalized emittance x |
emtny | normalized emittance y |
emtx | emittance x |
emty | emittance y |
nValid | number of valid slices |
Definition at line 294 of file EnvelopeBunch.cpp.
References Physics::c, emtbx0_m, emtby0_m, emtnx0_m, emtny0_m, numMySlices_m, reduce(), SLI_beta, SLI_px, SLI_py, SLI_x, SLI_y, SLI_z, slices_m, solver_m, sqrt(), sv_radial, and zCat_m.
Referenced by calcBeamParameters().
|
private |
calculate the energy chirp and uncorrelated energy spread
g0 | average gamma |
dgdt | chirp |
gInc | incoherent energy spread |
nValid | number of valid slices |
Definition at line 373 of file EnvelopeBunch.cpp.
References Physics::c, IpplInfo::Comm, IpplInfo::getComm(), Communicate::getNodes(), gt(), linfit(), numMySlices_m, pow(), reduce(), SLI_beta, SLI_z, slices_m, sqrt(), zAvg(), and zCat_m.
Referenced by calcBeamParameters().
|
private |
calculates the current current distribution
Definition at line 714 of file EnvelopeBunch.cpp.
References b_m, Physics::c, IpplInfo::Comm, currentProfile_m, ds_currentCalculated, dStat_m, endl(), fabs(), IpplInfo::getComm(), itype_lin, mySliceEndOffset_m, mySliceStartOffset_m, numSlices_m, Physics::q_e, Q_m, sgSmooth(), sqrt(), z_m, zHead(), and zTail().
Referenced by computeSpaceCharge().
void EnvelopeBunch::computeSpaceCharge | ( | ) |
Definition at line 1165 of file EnvelopeBunch.cpp.
References calcI(), calcITimer_m, cSpaceCharge(), currentProfile_m, Q_m, PartBunchBase< double, 3 >::selfFieldTimer_m, spaceChargeTimer_m, IpplTimings::startTimer(), IpplTimings::stopTimer(), and synchronizeSlices().
Referenced by ParallelSliceTracker::computeSpaceChargeFields().
void EnvelopeBunch::createBunch | ( | ) |
create and initialize local num slices
Definition at line 491 of file EnvelopeBunch.cpp.
References b_m, BF, Bz0_m, currentProfile_m, dfi_x_m, dfi_y_m, ds_fieldsSynchronized, ds_slicesSynchronized, dStat_m, dx0_m, dy0_m, EF, emtbx0_m, emtby0_m, emtnx0_m, emtny0_m, Esct_m, Exw_m, Eyw_m, Ezw_m, G_m, getLocalNum(), I0avg_m, KR, KT, numSlices_m, Q_m, slices_m, solver_m, sv_lwakes, sv_offaxis, sv_radial, sv_twakes, t_m, t_offset_m, and z_m.
Referenced by Distribution::doRestartOpalE(), and initialize().
|
private |
culates space-charge fields Calculate longitudinal-, and transverse space-charge fields for bunch Output is stored in the global class arrays Esct and G, respectively.
Definition at line 927 of file EnvelopeBunch.cpp.
References BETA_MIN1, Physics::c, currentProfile_m, endl(), Physics::epsilon_0, Esct_m, fabs(), G_m, getBeta(), IpplInfo::getComm(), getGamma(), itype_lin, mySliceStartOffset_m, numMySlices_m, numSlices_m, Physics::pi, Q_m, PartBunchBase< double, 3 >::R, SLI_beta, SLI_x, SLI_y, SLI_z, slices_m, sqrt(), Physics::two_pi, z_m, zHead(), and zTail().
Referenced by computeSpaceCharge().
void EnvelopeBunch::derivs | ( | double | tc, |
double | Y[], | ||
double | dYdt[] | ||
) |
helper function to calculate derivatives need in RH equation
tc | time |
Y[] | in/out array of slice parameters |
dYdt[] | derivation wrt to time of slice parameters |
derivs for RK routine
Y[SLI_z] = z dz/dt = beta*c*cos(a) cos(a) = 1 - (px0^2 + py0^2)/c2 Y[SLI_beta] = beta db/dt = (e0/mc)*(E_acc + E_sc)/gamma^3 Y[SLI_x] = x dx/dt = px = Y[SLI_px] Y[SLI_px] = px dpx/dt = f(x,beta) - (beta*gamma^2(db/dt)*px + Kr*x) Y[SLI_y] = y dy/dt = py = Y[SLI_py] Y[SLI_py] = py dpy/dt = f(y,beta) - (beta*gamma^2(db/dt)*py + Kr*y) Y[SLI_x0] = x0 dx0/dt = px0 = Y[SLI_px0] Y[SLI_px0] = px0 dpx0/dt= -(beta*gamma^2(db/dt)*px0) + Kt*x0 Y[SLI_y0] = y0 dy0/dt = py0 = Y[SLI_py0] Y[SLI_py0] = py0 dpy0/dt= -(beta*gamma^2(db/dt)*py0) + Kt*y0
Transversal space charge blowup: f(x,beta) = c^2*I/(2Ia)/(x*beta*gamma^3)
ALT: SLI_z (commented by Rene) dYdt[SLI_z] = Y[SLI_beta]*c*sqrt(1.0 - (pow(Y[SLI_px0],2) + pow(Y[SLI_py0],2))/pow(c*Y[SLI_beta],2)); dYdt[SLI_z] = Y[SLI_beta]*c*cos(Y[SLI_px0]/Y[SLI_beta]/c)*cos(Y[SLI_py0]/Y[SLI_beta]/c);
\[ \dot{z} = \beta c cos(\alpha) \]
minimum spot-size due to emittance
\[ \left(\frac{\epsilon_n c}{\gamma}\right)^2 \]
\[ \dot{\sigma} = p \]
\[ \ddot{\sigma} = -\gamma^2\beta\dot{\beta}\dot{\sigma} - K\sigma + 2c^2\left(\frac{I}{2I_0}\right)\frac{G}{\beta R^2}(1-\beta)^2 \sigma + \left(\frac{\epsilon_n c}{\gamma}\right)^2 \frac{1}{\sigma^3} \]
\[ \dot{\sigma} = p \]
Definition at line 1092 of file EnvelopeBunch.cpp.
References activeSlices_m, Physics::alpha, Physics::c, cos(), currentProfile_m, currentSlice_m, curZHead_m, curZTail_m, Physics::e0m, Physics::e0mc, emtbx0_m, emtby0_m, emtnx0_m, emtny0_m, Esct_m, Esl_m, Exw_m, Eyw_m, Ezw_m, G_m, Physics::Ia, KRsl_m, KTsl_m, numSlices_m, pow(), Q_m, SLI_beta, SLI_px, SLI_px0, SLI_py, SLI_py0, SLI_x, SLI_x0, SLI_y, SLI_y0, SLI_z, solver_m, sqrt(), sv_offaxis, and sv_radial.
void EnvelopeBunch::distributeSlices | ( | int | nSlice = 101 | ) |
distributes nSlice amongst processors and initializes slices
Definition at line 464 of file EnvelopeBunch.cpp.
References IpplInfo::Comm, Communicate::getNodes(), Communicate::myNode(), mySliceEndOffset_m, mySliceStartOffset_m, numMySlices_m, and numSlices_m.
Referenced by Distribution::doRestartOpalE(), and initialize().
double EnvelopeBunch::Eavg | ( | ) |
calculate the average energy of the bunch
Definition at line 1429 of file EnvelopeBunch.cpp.
References Physics::c, Physics::EMASS, IpplInfo::getComm(), numMySlices_m, Physics::q_e, SLI_z, slices_m, sum(), and zCat_m.
Referenced by ParallelSliceTracker::execute(), get_meanKineticEnergy(), and ParallelSliceTracker::switchElements().
|
inline |
returns vector with emittance
Definition at line 178 of file EnvelopeBunch.h.
References emtn_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope().
returns bounds of envelope bunch
Definition at line 357 of file EnvelopeBunch.h.
References zHead(), and zTail().
Referenced by ParallelSliceTracker::computeExternalFields(), ParallelSliceTracker::execute(), ParallelSliceTracker::writeLastStepPhaseSpace(), and ParallelSliceTracker::writePhaseSpace().
|
inline |
returns the energy spread
Definition at line 172 of file EnvelopeBunch.h.
References dEdt_m.
Referenced by StatWriter::write().
|
inline |
returns the mean energy
Definition at line 170 of file EnvelopeBunch.h.
References Eavg().
Referenced by slprint(), H5PartWrapperForPS::stashPhaseSpaceEnvelope(), StatWriter::write(), and H5PartWrapperForPS::writeStepHeader().
|
inline |
returns vector with normalized emittance
Definition at line 180 of file EnvelopeBunch.h.
References norm_emtn_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope(), StatWriter::write(), and H5PartWrapperForPS::writeStepHeader().
|
inline |
returns RMSP x,y,z
Definition at line 194 of file EnvelopeBunch.h.
References sigmap_m.
Referenced by StatWriter::write(), and H5PartWrapperForPS::writeStepHeader().
|
inline |
returns RMS x,y,z
Definition at line 192 of file EnvelopeBunch.h.
References sigmax_m.
Referenced by StatWriter::write(), and H5PartWrapperForPS::writeStepHeader().
double EnvelopeBunch::get_sPos | ( | ) |
return reference position
Definition at line 1444 of file EnvelopeBunch.cpp.
References IpplInfo::getComm(), numMySlices_m, SLI_z, and slices_m.
Referenced by ParallelSliceTracker::dumpStats(), ParallelSliceTracker::execute(), H5PartWrapperForPS::stashPhaseSpaceEnvelope(), and H5PartWrapperForPS::writeStepHeader().
|
inlinevirtual |
returns beta of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 215 of file EnvelopeBunch.h.
References numMySlices_m, SLI_beta, and slices_m.
Referenced by cSpaceCharge(), and H5PartWrapperForPS::writeStepData().
|
inline |
returns charge per slice
Definition at line 190 of file EnvelopeBunch.h.
References numSlices_m, and Q_m.
Referenced by Distribution::doRestartOpalE(), H5PartWrapperForPS::stashPhaseSpaceEnvelope(), and StatWriter::write().
|
inline |
Definition at line 150 of file EnvelopeBunch.h.
|
inlinevirtual |
returns gamma of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 209 of file EnvelopeBunch.h.
References numMySlices_m, and slices_m.
Referenced by cSpaceCharge().
|
inline |
returns the number of local slices
Definition at line 164 of file EnvelopeBunch.h.
References numMySlices_m.
Referenced by ParallelSliceTracker::changeDT(), ParallelSliceTracker::computeExternalFields(), createBunch(), H5PartWrapperForPS::stashPhaseSpaceEnvelope(), and H5PartWrapperForPS::writeStepData().
|
inline |
Definition at line 248 of file EnvelopeBunch.h.
References numMySlices_m, PartBunchBase< double, 3 >::P, SLI_beta, SLI_px, SLI_py, and slices_m.
Referenced by ParallelSliceTracker::computeExternalFields().
|
inlinevirtual |
returns X momenta of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 311 of file EnvelopeBunch.h.
References numMySlices_m, SLI_px, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns angular deflection centroid in x of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 337 of file EnvelopeBunch.h.
References numMySlices_m, SLI_px0, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns Y momenta of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 321 of file EnvelopeBunch.h.
References numMySlices_m, SLI_py, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns angular deflection centroid in y of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 347 of file EnvelopeBunch.h.
References numMySlices_m, SLI_py0, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns Z momenta of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 331 of file EnvelopeBunch.h.
References Physics::m_e, numMySlices_m, SLI_beta, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inline |
Definition at line 231 of file EnvelopeBunch.h.
References numMySlices_m, PartBunchBase< double, 3 >::R, SLI_x, SLI_y, SLI_z, and slices_m.
Referenced by ParallelSliceTracker::computeExternalFields().
|
inline |
returns the current time of the bunch
Definition at line 168 of file EnvelopeBunch.h.
References t_m.
Referenced by ParallelSliceTracker::autophaseCavities(), ParallelSliceTracker::computeExternalFields(), ParallelSliceTracker::execute(), ParallelSliceTracker::setTime(), H5PartWrapperForPS::stashPhaseSpaceEnvelope(), ParallelSliceTracker::switchElements(), ParallelSliceTracker::updateReferenceParticle(), StatWriter::write(), ParallelSliceTracker::writePhaseSpace(), and H5PartWrapperForPS::writeStepHeader().
|
inline |
returns the total number of slices
Definition at line 166 of file EnvelopeBunch.h.
References numSlices_m.
Referenced by ParallelSliceTracker::execute(), slprint(), H5PartWrapperForPS::stashPhaseSpaceEnvelope(), and StatWriter::write().
|
inlinevirtual |
returns X coordinate of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 271 of file EnvelopeBunch.h.
References numMySlices_m, SLI_x, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns X coordinate of the centroid of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 291 of file EnvelopeBunch.h.
References numMySlices_m, SLI_x0, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns Y coordinate of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 281 of file EnvelopeBunch.h.
References numMySlices_m, SLI_y, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns Y coordinate of the centroid of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 301 of file EnvelopeBunch.h.
References numMySlices_m, SLI_y0, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
|
inlinevirtual |
returns Z coordinate of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 265 of file EnvelopeBunch.h.
References numMySlices_m, SLI_z, and slices_m.
Referenced by H5PartWrapperForPS::writeStepData().
void EnvelopeBunch::initialize | ( | int | sli, |
double | charge, | ||
double | energy, | ||
double | width, | ||
double | te, | ||
double | frac, | ||
double | current, | ||
double | center, | ||
double | bX, | ||
double | bY, | ||
double | mX, | ||
double | mY, | ||
double | Bz, | ||
int | nbin | ||
) |
Definition at line 1374 of file EnvelopeBunch.cpp.
References activeSlices_m, bsRect, createBunch(), distributeSlices(), emission_time_step_m, endl(), lastEmittedBin_m, nebin_m, setBinnedLShape(), setCharge(), setEnergy(), setSolverParameter(), and setTShape().
Referenced by Distribution::createOpalE().
|
inline |
check if solver includes off-axis tracking
Definition at line 98 of file EnvelopeBunch.h.
References solver_m, and sv_offaxis.
|
inline |
check if solver includes radial
Definition at line 95 of file EnvelopeBunch.h.
|
inline |
returns vector with the max momentum of the bunch
Definition at line 186 of file EnvelopeBunch.h.
References maxP_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope(), and H5PartWrapperForPS::writeStepHeader().
|
inline |
returns vector with the max spatial extends of the bunch
Definition at line 182 of file EnvelopeBunch.h.
References maxX_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope().
|
inline |
returns vector with the min momentum of the bunch
Definition at line 188 of file EnvelopeBunch.h.
References minP_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope(), and H5PartWrapperForPS::writeStepHeader().
|
inline |
returns vector with the min spatial extends of the bunch
Definition at line 184 of file EnvelopeBunch.h.
References minX_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope().
|
private |
move the complete bunch forward such that the head of the bunch matches the cahtode position
Definition at line 1041 of file EnvelopeBunch.cpp.
References backup(), endl(), numMySlices_m, SLI_z, slices_m, zCat_m, and zHead().
|
inline |
Definition at line 197 of file EnvelopeBunch.h.
References mySliceEndOffset_m.
Referenced by Distribution::doRestartOpalE().
|
inline |
Definition at line 196 of file EnvelopeBunch.h.
References mySliceStartOffset_m.
Referenced by Distribution::doRestartOpalE().
|
inline |
Definition at line 198 of file EnvelopeBunch.h.
References numMySlices_m.
|
private |
run statistics on slices
sp | parameter to run statistics on |
xAvg | average |
xMax | max |
xMin | min |
rms | rms |
nValid | number of valid slices |
Definition at line 159 of file EnvelopeBunch.cpp.
References BETA_MIN1, IpplInfo::getComm(), max(), min(), numMySlices_m, SLI_beta, SLI_px, SLI_px0, SLI_py, SLI_py0, SLI_x, SLI_x0, SLI_y, SLI_y0, SLI_z, slices_m, sp_beta, sp_gamma, sp_I, sp_Px, sp_px0, sp_Py, sp_py0, sp_Pz, sp_Rx, sp_Ry, sp_x0, sp_y0, sp_z, sqrt(), and zCat_m.
Referenced by calcBeamParameters().
|
inline |
Definition at line 219 of file EnvelopeBunch.h.
References numMySlices_m, SLI_beta, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
private |
set longitudinal shape of bunch (initial distribution)
shape | of bunch (currently rectangular or Gauss) |
z0 | center of the bunch [m] |
w | length of the bunch [m] |
frac | fraction of Gauss (length) used |
Definition at line 570 of file EnvelopeBunch.cpp.
References backup(), bins_m, bsGauss, bsRect, Physics::c, IpplInfo::Comm, Physics::e, fabs(), findRoot(), firstBinWithValue_m, Communicate::getNodes(), hbin_m, I0avg_m, mySliceEndOffset_m, mySliceStartOffset_m, nebin_m, numMySlices_m, numSlices_m, Q_m, reduce(), SLI_beta, SLI_z, slices_m, and sqrt().
Referenced by initialize().
|
inline |
set the charge of the bunch
Definition at line 203 of file EnvelopeBunch.h.
References abs(), Q_m, and sign_m.
Referenced by Distribution::doRestartOpalE(), initialize(), and TrackRun::setupSliceTracker().
void EnvelopeBunch::setEnergy | ( | double | E0, |
double | dE = 0.0 |
||
) |
Definition at line 686 of file EnvelopeBunch.cpp.
References backup(), Physics::c, Physics::EMASS, fabs(), numMySlices_m, Physics::q_e, SLI_beta, SLI_z, slices_m, sqrt(), and zAvg().
Referenced by initialize().
|
inline |
|
inline |
Definition at line 143 of file EnvelopeBunch.h.
References BF, EF, KR, and KT.
Referenced by ParallelSliceTracker::computeExternalFields().
|
inline |
|
inline |
Definition at line 241 of file EnvelopeBunch.h.
References numMySlices_m, SLI_beta, SLI_px, SLI_py, slices_m, and sqrt().
Referenced by ParallelSliceTracker::computeExternalFields().
|
inline |
Definition at line 315 of file EnvelopeBunch.h.
References numMySlices_m, SLI_px, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
Definition at line 341 of file EnvelopeBunch.h.
References numMySlices_m, SLI_px0, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
Definition at line 325 of file EnvelopeBunch.h.
References numMySlices_m, SLI_py, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
Definition at line 351 of file EnvelopeBunch.h.
References numMySlices_m, SLI_py0, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
Definition at line 224 of file EnvelopeBunch.h.
References numMySlices_m, SLI_x, SLI_y, SLI_z, and slices_m.
Referenced by ParallelSliceTracker::computeExternalFields().
|
inline |
set the DE solver flag
Definition at line 139 of file EnvelopeBunch.h.
References solver_m.
Referenced by initialize().
|
private |
set transverse offset of bunch
x0 | coordinate [m] |
px0 | divergence [rad] |
y0 | coordinate [m] |
py0 | divergence [rad] |
Definition at line 677 of file EnvelopeBunch.cpp.
References numMySlices_m, SLI_px0, SLI_py0, SLI_x0, SLI_y0, and slices_m.
|
private |
set transverse shape of bunch (initial distribution)
enx | normalized emittance x [m rad] |
eny | normalized emittance y [m rad] |
rx | radius x [m] |
ry | radius y [m] |
b0 | Bz0 [T] |
Definition at line 651 of file EnvelopeBunch.cpp.
References backup(), Bz0_m, Physics::c, Physics::EMASS, emtbx0_m, emtby0_m, emtnx0_m, emtny0_m, numMySlices_m, Physics::q_e, SLI_px, SLI_py, SLI_x, SLI_y, and slices_m.
Referenced by initialize().
|
inline |
Definition at line 275 of file EnvelopeBunch.h.
References numMySlices_m, SLI_x, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
Definition at line 295 of file EnvelopeBunch.h.
References numMySlices_m, SLI_x0, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
Definition at line 285 of file EnvelopeBunch.h.
References numMySlices_m, SLI_y, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
Definition at line 305 of file EnvelopeBunch.h.
References numMySlices_m, SLI_y0, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inlinevirtual |
set Z coordinate of slice i
Reimplemented from PartBunchBase< double, 3 >.
Definition at line 259 of file EnvelopeBunch.h.
References numMySlices_m, SLI_z, and slices_m.
Referenced by H5PartWrapperForPS::readStepData().
|
inline |
returns vector with rms momenta
Definition at line 176 of file EnvelopeBunch.h.
References sigmap_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope().
|
inline |
returns vector with rms position
Definition at line 174 of file EnvelopeBunch.h.
References sigmax_m.
Referenced by H5PartWrapperForPS::stashPhaseSpaceEnvelope().
Definition at line 1523 of file EnvelopeBunch.cpp.
References Physics::e, endl(), get_meanKineticEnergy(), PartBunchBase< double, 3 >::getdT(), getTotalNum(), Q_m, and zAvg().
Referenced by operator<<().
|
private |
synchronize z position and betas of all slices (needed in calcI and space charge calculation)
Definition at line 699 of file EnvelopeBunch.cpp.
References b_m, IpplInfo::getComm(), mySliceStartOffset_m, numMySlices_m, numSlices_m, SLI_beta, SLI_z, slices_m, and z_m.
Referenced by computeSpaceCharge().
|
inline |
void EnvelopeBunch::timeStep | ( | double | tStep, |
double | zCat = 0.0 |
||
) |
performs a time-step for all active slices (also handles emission)
tStep | dt for timestep |
zCat | position of cathode (default: 0.0) |
mark calling of this function + update vars
subtract average orbit for when tracking along the s-axis
Definition at line 1198 of file EnvelopeBunch.cpp.
References activeSlice_m, activeSlices_m, backup(), BF, Bsl_m, Physics::c, currentSlice_m, curZHead_m, curZTail_m, dfi_x_m, dfi_y_m, ds_slicesSynchronized, ds_spaceCharge, dStat_m, dx0_m, dy0_m, EF, endl(), Esl_m, isValid_m, KR, KRsl_m, KT, KTsl_m, numMySlices_m, numSlices_m, odeint(), pow(), reduce(), rk4(), sin(), SLI_beta, SLI_px0, SLI_py0, SLI_x0, SLI_y0, SLI_z, slices_m, SLNPAR, solver_m, sqrt(), sv_fixedStep, sv_s_path, t_m, zCat_m, zHead(), and zTail().
Referenced by ParallelSliceTracker::timeIntegration().
|
private |
reset time of bunch (returns the offset applied) time difference (0.0 - auto-sync)
Definition at line 1055 of file EnvelopeBunch.cpp.
References PartBunchBase< double, 3 >::dt, t_m, t_offset_m, and zAvg().
double EnvelopeBunch::zAvg | ( | ) |
calculate <z> [m]
Definition at line 1460 of file EnvelopeBunch.cpp.
References IpplInfo::getComm(), isValid_m, numMySlices_m, SLI_z, slices_m, and sum().
Referenced by calcEnergyChirp(), ParallelSliceTracker::execute(), setEnergy(), slprint(), and tReset().
double EnvelopeBunch::zHead | ( | ) |
calculate the head of the bunch [m]
Definition at line 1502 of file EnvelopeBunch.cpp.
References IpplInfo::getComm(), isValid_m, max(), numMySlices_m, SLI_z, and slices_m.
Referenced by calcI(), cSpaceCharge(), get_bounds(), moveZ0(), ParallelSliceTracker::switchElements(), and timeStep().
double EnvelopeBunch::zTail | ( | ) |
calculate tail of bunch [m]
Definition at line 1481 of file EnvelopeBunch.cpp.
References IpplInfo::getComm(), isValid_m, min(), numMySlices_m, SLI_z, and slices_m.
Referenced by calcI(), cSpaceCharge(), get_bounds(), ParallelSliceTracker::switchElements(), and timeStep().
|
private |
Definition at line 431 of file EnvelopeBunch.h.
Referenced by timeStep().
|
private |
number of active slices
Definition at line 389 of file EnvelopeBunch.h.
Referenced by derivs(), initialize(), and timeStep().
|
private |
synchronized betas for parallel tracker
Definition at line 379 of file EnvelopeBunch.h.
Referenced by calcI(), createBunch(), and synchronizeSlices().
|
private |
external B fields
Definition at line 428 of file EnvelopeBunch.h.
Referenced by AvBField(), createBunch(), setExternalFields(), and timeStep().
|
private |
|
private |
|
private |
magnetic field on cathode [T]
Definition at line 408 of file EnvelopeBunch.h.
Referenced by createBunch(), and setTShape().
|
private |
Definition at line 478 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
IpplTimings::TimerRef EnvelopeBunch::calcITimer_m |
Definition at line 86 of file EnvelopeBunch.h.
Referenced by computeSpaceCharge(), and EnvelopeBunch().
std::unique_ptr<Profile> EnvelopeBunch::currentProfile_m |
current profile of bunch (fit)
Definition at line 84 of file EnvelopeBunch.h.
Referenced by calcI(), computeSpaceCharge(), createBunch(), cSpaceCharge(), and derivs().
|
private |
current Slice set in run() & cSpaceCharge() and used in derivs() & zcsI()
Definition at line 435 of file EnvelopeBunch.h.
Referenced by derivs(), and timeStep().
|
private |
Definition at line 491 of file EnvelopeBunch.h.
Referenced by derivs(), and timeStep().
|
private |
Definition at line 492 of file EnvelopeBunch.h.
Referenced by derivs(), and timeStep().
|
private |
Definition at line 454 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), and get_dEdt().
|
private |
rotation of coordinate system when tracking along the s-axis [rad]
Definition at line 406 of file EnvelopeBunch.h.
Referenced by createBunch(), and timeStep().
|
private |
Definition at line 406 of file EnvelopeBunch.h.
Referenced by createBunch(), and timeStep().
|
private |
see enum DataStatus
Definition at line 394 of file EnvelopeBunch.h.
Referenced by calcI(), createBunch(), and timeStep().
|
private |
offset of the coordinate system when tracking along the s-axis [m]
Definition at line 404 of file EnvelopeBunch.h.
Referenced by createBunch(), and timeStep().
|
private |
Definition at line 404 of file EnvelopeBunch.h.
Referenced by createBunch(), and timeStep().
|
private |
Definition at line 453 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
external E fields
Definition at line 426 of file EnvelopeBunch.h.
Referenced by AvEField(), createBunch(), setExternalFields(), and timeStep().
|
private |
Definition at line 455 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 451 of file EnvelopeBunch.h.
Referenced by initialize().
|
private |
intrinsic normalized emittance Bush effect [m rad]
Definition at line 402 of file EnvelopeBunch.h.
Referenced by calcEmittance(), createBunch(), derivs(), and setTShape().
|
private |
Definition at line 402 of file EnvelopeBunch.h.
Referenced by calcEmittance(), createBunch(), derivs(), and setTShape().
|
private |
Definition at line 485 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), and emtn().
|
private |
intrinsic normalized emittance of slice [m rad]
Definition at line 400 of file EnvelopeBunch.h.
Referenced by calcEmittance(), createBunch(), derivs(), setEx(), and setTShape().
|
private |
Definition at line 400 of file EnvelopeBunch.h.
Referenced by calcEmittance(), createBunch(), derivs(), setEy(), and setTShape().
|
private |
Longitudinal Space-charge field.
Definition at line 445 of file EnvelopeBunch.h.
Referenced by createBunch(), cSpaceCharge(), and derivs().
|
private |
electric field
Definition at line 414 of file EnvelopeBunch.h.
Referenced by derivs(), and timeStep().
|
private |
transverse wake field x
Definition at line 439 of file EnvelopeBunch.h.
Referenced by createBunch(), and derivs().
|
private |
transverse wake field y
Definition at line 441 of file EnvelopeBunch.h.
Referenced by createBunch(), and derivs().
|
private |
Definition at line 477 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
longitudinal wake field
Definition at line 443 of file EnvelopeBunch.h.
Referenced by createBunch(), and derivs().
|
private |
first bin on processor containing slices
Definition at line 387 of file EnvelopeBunch.h.
Referenced by setBinnedLShape().
|
private |
Transverse Space-charge term: Eq.(9)
Definition at line 447 of file EnvelopeBunch.h.
Referenced by createBunch(), cSpaceCharge(), and derivs().
|
private |
|
private |
average current on creation of bunch (see setLshape)
Definition at line 412 of file EnvelopeBunch.h.
Referenced by createBunch(), and setBinnedLShape().
|
private |
Definition at line 457 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 458 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
bool EnvelopeBunch::isValid_m |
Definition at line 81 of file EnvelopeBunch.h.
Referenced by EnvelopeBunch(), timeStep(), ParallelSliceTracker::writeLastStepPhaseSpace(), zAvg(), zHead(), and zTail().
|
private |
define value of radial kick for each slice
Definition at line 422 of file EnvelopeBunch.h.
Referenced by createBunch(), setExternalFields(), and timeStep().
|
private |
radial focussing term beam
Definition at line 418 of file EnvelopeBunch.h.
Referenced by derivs(), and timeStep().
|
private |
define value of transversal kick for each slice
Definition at line 424 of file EnvelopeBunch.h.
Referenced by createBunch(), setExternalFields(), and timeStep().
|
private |
transverse kick of beam
Definition at line 420 of file EnvelopeBunch.h.
Referenced by derivs(), and timeStep().
|
private |
Definition at line 452 of file EnvelopeBunch.h.
Referenced by initialize().
|
private |
Definition at line 481 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), and maxP().
|
private |
Definition at line 479 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), and maxX().
|
private |
Definition at line 482 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), and minP().
|
private |
Definition at line 480 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), and minX().
|
private |
last global slice on this processor
Definition at line 375 of file EnvelopeBunch.h.
Referenced by calcI(), distributeSlices(), mySliceEndOffset(), and setBinnedLShape().
|
private |
first global slice on this processor
Definition at line 373 of file EnvelopeBunch.h.
Referenced by calcI(), cSpaceCharge(), distributeSlices(), mySliceStartOffset(), setBinnedLShape(), and synchronizeSlices().
|
private |
number of bins for emission
Definition at line 385 of file EnvelopeBunch.h.
Referenced by initialize(), and setBinnedLShape().
|
private |
Definition at line 486 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), and get_norm_emit().
|
private |
number of my slices in bunch
Definition at line 371 of file EnvelopeBunch.h.
Referenced by AvBField(), AvEField(), calcEmittance(), calcEnergyChirp(), cSpaceCharge(), distributeSlices(), Eavg(), get_sPos(), getBeta(), getGamma(), getLocalNum(), getP(), getPx(), getPx0(), getPy(), getPy0(), getPz(), getR(), getX(), getX0(), getY(), getY0(), getZ(), moveZ0(), numMySlices(), runStats(), setBeta(), setBinnedLShape(), setEnergy(), setP(), setPx(), setPx0(), setPy(), setPy0(), setR(), setTOffset(), setTShape(), setX(), setX0(), setY(), setY0(), setZ(), synchronizeSlices(), timeStep(), zAvg(), zHead(), and zTail().
|
private |
number of total slices in bunch
Definition at line 369 of file EnvelopeBunch.h.
Referenced by AvBField(), AvEField(), calcBeamParameters(), calcI(), createBunch(), cSpaceCharge(), derivs(), distributeSlices(), getChargePerParticle(), getTotalNum(), setBinnedLShape(), synchronizeSlices(), and timeStep().
|
private |
Definition at line 449 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 465 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 466 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
total bunch charge [C]
Definition at line 410 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), calcI(), computeSpaceCharge(), createBunch(), cSpaceCharge(), derivs(), getChargePerParticle(), setBinnedLShape(), setCharge(), and slprint().
|
private |
Definition at line 459 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 461 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 463 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 460 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 462 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 464 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 484 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), get_prms(), and sigmap().
|
private |
Definition at line 483 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), get_rrms(), and sigmax().
|
private |
gives the sign of charge Q
Definition at line 433 of file EnvelopeBunch.h.
Referenced by setCharge().
|
private |
array of slices
Definition at line 430 of file EnvelopeBunch.h.
Referenced by backup(), calcEmittance(), calcEnergyChirp(), createBunch(), cSpaceCharge(), Eavg(), get_sPos(), getBeta(), getGamma(), getP(), getPx(), getPx0(), getPy(), getPy0(), getPz(), getR(), getX(), getX0(), getY(), getY0(), getZ(), moveZ0(), runStats(), setBeta(), setBinnedLShape(), setEnergy(), setP(), setPx(), setPx0(), setPy(), setPy0(), setR(), setTOffset(), setTShape(), setX(), setX0(), setY(), setY0(), setZ(), synchronizeSlices(), timeStep(), zAvg(), zHead(), and zTail().
|
private |
see enum SolverParameters
Definition at line 392 of file EnvelopeBunch.h.
Referenced by calcBeamParameters(), calcEmittance(), createBunch(), derivs(), isOffaxis(), isRadial(), setSolverParameter(), and timeStep().
IpplTimings::TimerRef EnvelopeBunch::spaceChargeTimer_m |
Definition at line 87 of file EnvelopeBunch.h.
Referenced by computeSpaceCharge(), and EnvelopeBunch().
|
private |
local time in bunch [s]
Definition at line 396 of file EnvelopeBunch.h.
Referenced by createBunch(), getT(), time(), timeStep(), and tReset().
|
private |
accumulated time offset by tReset function
Definition at line 398 of file EnvelopeBunch.h.
Referenced by createBunch(), and tReset().
|
private |
Definition at line 456 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 467 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 469 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 471 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 468 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 470 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 472 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
Definition at line 450 of file EnvelopeBunch.h.
Referenced by calcBeamParameters().
|
private |
synchronized z positions for parallel tracker
Definition at line 377 of file EnvelopeBunch.h.
Referenced by calcI(), createBunch(), cSpaceCharge(), and synchronizeSlices().
|
private |
cathode position
Definition at line 437 of file EnvelopeBunch.h.
Referenced by calcEmittance(), calcEnergyChirp(), Eavg(), moveZ0(), runStats(), and timeStep().