OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
#include <MultiBunchHandler.h>
Classes | |
struct | beaminfo_t |
struct | injection_t |
Public Types | |
enum class | MultiBunchMode : unsigned short { FORCE = 0 , AUTO = 1 } |
enum class | MultiBunchBinning : unsigned short { GAMMA = 0 , BUNCH = 1 } |
Public Member Functions | |
MultiBunchHandler (PartBunchBase< double, 3 > *beam, const int &numBunch, const double &eta, const double ¶, const std::string &mode, const std::string &binning) | |
void | saveBunch (PartBunchBase< double, 3 > *beam) |
bool | readBunch (PartBunchBase< double, 3 > *beam, const PartData &ref) |
short | injectBunch (PartBunchBase< double, 3 > *beam, const PartData &ref, bool &flagTransition) |
void | updateParticleBins (PartBunchBase< double, 3 > *beam) |
void | setMode (const std::string &mbmode) |
set the working sub-mode for multi-bunch mode: "FORCE" or "AUTO" More... | |
void | setBinning (std::string binning) |
void | setRadiusTurns (const double &radius) |
void | setNumBunch (short n) |
short | getNumBunch () const |
bool | isForceMode () const |
bool | calcBunchBeamParameters (PartBunchBase< double, 3 > *beam, short bunchNr) |
beaminfo_t & | getBunchInfo (short bunchNr) |
const beaminfo_t & | getBunchInfo (short bunchNr) const |
injection_t & | getInjectionValues () |
void | updateTime (const double &dt) |
void | updatePathLength (const std::vector< double > &lpaths) |
Private Attributes | |
std::string | onebunch_m |
short | numBunch_m |
The number of bunches specified in TURNS of RUN command. More... | |
double | eta_m |
MultiBunchMode | mode_m |
MultiBunchBinning | binning_m |
double | coeffDBunches_m |
double | radiusLastTurn_m |
double | radiusThisTurn_m |
short | bunchCount_m |
std::vector< beaminfo_t > | binfo_m |
injection_t | injection_m |
Definition at line 35 of file MultiBunchHandler.h.
|
strong |
Enumerator | |
---|---|
GAMMA | |
BUNCH |
Definition at line 92 of file MultiBunchHandler.h.
|
strong |
Enumerator | |
---|---|
FORCE | |
AUTO |
Definition at line 86 of file MultiBunchHandler.h.
MultiBunchHandler::MultiBunchHandler | ( | PartBunchBase< double, 3 > * | beam, |
const int & | numBunch, | ||
const double & | eta, | ||
const double & | para, | ||
const std::string & | mode, | ||
const std::string & | binning | ||
) |
Definition at line 41 of file MultiBunchHandler.cpp.
References AUTO, binfo_m, endl(), FORCE, OpalData::getInstance(), PartBins::getLastemittedBin(), PartBunchBase< T, Dim >::getNumBunch(), PartBunchBase< T, Dim >::getTotalNum(), gmsg, mode_m, PAssert_GT, PartBunchBase< T, Dim >::pbin_m, setBinning(), setMode(), and PartBunchBase< T, Dim >::setPBins().
bool MultiBunchHandler::calcBunchBeamParameters | ( | PartBunchBase< double, 3 > * | beam, |
short | bunchNr | ||
) |
Definition at line 405 of file MultiBunchHandler.cpp.
References allreduce(), PartBunchBase< T, Dim >::bunchNum, MultiBunchHandler::beaminfo_t::correlation, MultiBunchHandler::beaminfo_t::dEkin, dot(), MultiBunchHandler::beaminfo_t::ekin, MultiBunchHandler::beaminfo_t::emit, Units::eV2MeV, getBunchInfo(), OpalData::getInstance(), PartBunchBase< T, Dim >::getLocalNum(), PartBunchBase< T, Dim >::getM(), PartBunchBase< T, Dim >::getNumBunch(), PartBunchBase< T, Dim >::getT(), MultiBunchHandler::beaminfo_t::halo, max(), MultiBunchHandler::beaminfo_t::mean, MultiBunchHandler::beaminfo_t::nParticles, PartBunchBase< T, Dim >::P, pow(), MultiBunchHandler::beaminfo_t::prms, PartBunchBase< T, Dim >::R, MultiBunchHandler::beaminfo_t::rrms, Units::s2ns, PartBunchBase< T, Dim >::setLocalNumPerBunch(), PartBunchBase< T, Dim >::setTotalNumPerBunch(), sqrt(), and MultiBunchHandler::beaminfo_t::time.
Referenced by injectBunch(), and DataSink::writeMultiBunchStatistics().
|
inline |
Definition at line 210 of file MultiBunchHandler.h.
References binfo_m, PAssert_GE, and PAssert_LT.
Referenced by calcBunchBeamParameters(), DataSink::setMultiBunchInitialPathLengh(), and DataSink::writeMultiBunchStatistics().
|
inline |
Definition at line 218 of file MultiBunchHandler.h.
References binfo_m, PAssert_GE, and PAssert_LT.
|
inline |
Definition at line 226 of file MultiBunchHandler.h.
References injection_m.
|
inline |
Definition at line 198 of file MultiBunchHandler.h.
References bunchCount_m.
Referenced by DataSink::setMultiBunchInitialPathLengh(), and DataSink::writeMultiBunchStatistics().
short MultiBunchHandler::injectBunch | ( | PartBunchBase< double, 3 > * | beam, |
const PartData & | ref, | ||
bool & | flagTransition | ||
) |
Definition at line 254 of file MultiBunchHandler.cpp.
References AUTO, Communicate::barrier(), bunchCount_m, PartBunchBase< T, Dim >::calcBeamParameters(), calcBunchBeamParameters(), coeffDBunches_m, IpplInfo::Comm, endl(), FORCE, PartBunchBase< T, Dim >::get_centroid(), PartBunchBase< T, Dim >::get_rrms(), PartBunchBase< T, Dim >::getLocalNum(), PartBunchBase< T, Dim >::getTotalNum(), gmsg, mode_m, numBunch_m, radiusLastTurn_m, radiusThisTurn_m, readBunch(), Hypervolume::ref, saveBunch(), PartBunchBase< T, Dim >::setLocalNumPerBunch(), PartBunchBase< T, Dim >::setNumBunch(), PartBunchBase< T, Dim >::setTotalNumPerBunch(), and updateParticleBins().
|
inline |
Definition at line 204 of file MultiBunchHandler.h.
bool MultiBunchHandler::readBunch | ( | PartBunchBase< double, 3 > * | beam, |
const PartData & | ref | ||
) |
Definition at line 174 of file MultiBunchHandler.cpp.
References PartBunchBase< T, Dim >::Bin, binfo_m, PartBunchBase< T, Dim >::boundp(), bunchCount_m, PartBunchBase< T, Dim >::bunchNum, H5PartWrapper::close(), PartBunchBase< T, Dim >::create(), endl(), AmrPartBunch::getAmrParticleBase(), PartBunchBase< T, Dim >::getLocalNum(), IpplInfo::getNodes(), H5PartWrapper::getNumParticles(), IpplTimings::getTimer(), gmsg, injection_m, PartBunchBase< T, Dim >::M, IpplInfo::myNode(), onebunch_m, PartBunchBase< T, Dim >::P, PAssert_LT, PartBunchBase< T, Dim >::POrigin, PartBunchBase< T, Dim >::Q, PartBunchBase< T, Dim >::R, H5PartWrapperForPC::readStep(), Hypervolume::ref, REGULAR, PartBunchBase< T, Dim >::setLocalNumPerBunch(), PartBunchBase< T, Dim >::setTotalNumPerBunch(), IpplTimings::startTimer(), and IpplTimings::stopTimer().
Referenced by injectBunch().
void MultiBunchHandler::saveBunch | ( | PartBunchBase< double, 3 > * | beam | ) |
Definition at line 107 of file MultiBunchHandler.cpp.
References H5PartWrapper::close(), ParticleAttrib< T >::create(), endl(), PartBunchBase< T, Dim >::getLocalNum(), IpplTimings::getTimer(), gmsg, PartBunchBase< T, Dim >::M, onebunch_m, PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::POrigin, PartBunchBase< T, Dim >::Q, PartBunchBase< T, Dim >::R, IpplTimings::startTimer(), IpplTimings::stopTimer(), H5PartWrapperForPC::writeHeader(), and H5PartWrapperForPC::writeStep().
Referenced by injectBunch().
void MultiBunchHandler::setBinning | ( | std::string | binning | ) |
Definition at line 376 of file MultiBunchHandler.cpp.
References binning_m, BUNCH, endl(), GAMMA, and gmsg.
Referenced by MultiBunchHandler().
void MultiBunchHandler::setMode | ( | const std::string & | mbmode | ) |
set the working sub-mode for multi-bunch mode: "FORCE" or "AUTO"
Definition at line 361 of file MultiBunchHandler.cpp.
References AUTO, coeffDBunches_m, endl(), FORCE, gmsg, and mode_m.
Referenced by MultiBunchHandler().
|
inline |
Definition at line 192 of file MultiBunchHandler.h.
References bunchCount_m, and Hypervolume::n.
void MultiBunchHandler::setRadiusTurns | ( | const double & | radius | ) |
Definition at line 388 of file MultiBunchHandler.cpp.
References AUTO, endl(), OpalData::getInstance(), gmsg, mode_m, radiusLastTurn_m, and radiusThisTurn_m.
void MultiBunchHandler::updateParticleBins | ( | PartBunchBase< double, 3 > * | beam | ) |
Definition at line 341 of file MultiBunchHandler.cpp.
References binning_m, BUNCH, bunchCount_m, eta_m, GAMMA, IpplTimings::getTimer(), PartBunchBase< T, Dim >::resetPartBinBunch(), PartBunchBase< T, Dim >::resetPartBinID2(), IpplTimings::startTimer(), and IpplTimings::stopTimer().
Referenced by injectBunch().
void MultiBunchHandler::updatePathLength | ( | const std::vector< double > & | lpaths | ) |
Definition at line 558 of file MultiBunchHandler.cpp.
References binfo_m, bunchCount_m, and PAssert_EQ.
void MultiBunchHandler::updateTime | ( | const double & | dt | ) |
Definition at line 551 of file MultiBunchHandler.cpp.
References binfo_m, and bunchCount_m.
|
private |
Definition at line 184 of file MultiBunchHandler.h.
Referenced by getBunchInfo(), MultiBunchHandler(), readBunch(), updatePathLength(), and updateTime().
|
private |
Definition at line 171 of file MultiBunchHandler.h.
Referenced by setBinning(), and updateParticleBins().
|
private |
Definition at line 181 of file MultiBunchHandler.h.
Referenced by getNumBunch(), injectBunch(), readBunch(), setNumBunch(), updateParticleBins(), updatePathLength(), and updateTime().
|
private |
Definition at line 174 of file MultiBunchHandler.h.
Referenced by injectBunch(), and setMode().
|
private |
Definition at line 162 of file MultiBunchHandler.h.
Referenced by updateParticleBins().
|
private |
Definition at line 187 of file MultiBunchHandler.h.
Referenced by getInjectionValues(), and readBunch().
|
private |
Definition at line 167 of file MultiBunchHandler.h.
Referenced by injectBunch(), isForceMode(), MultiBunchHandler(), setMode(), and setRadiusTurns().
|
private |
The number of bunches specified in TURNS of RUN command.
Definition at line 159 of file MultiBunchHandler.h.
Referenced by injectBunch().
|
private |
Definition at line 156 of file MultiBunchHandler.h.
Referenced by readBunch(), and saveBunch().
|
private |
Definition at line 177 of file MultiBunchHandler.h.
Referenced by injectBunch(), and setRadiusTurns().
|
private |
Definition at line 178 of file MultiBunchHandler.h.
Referenced by injectBunch(), and setRadiusTurns().